tcm_vhost: Expose ABI version via VHOST_SCSI_GET_ABI_VERSION
Subsystems (4)
PATCH 1/1 tcm_vhost: Expose ABI version via VHOST_SCSI_GET_ABI_VERSION
From: Nicholas Bellinger <[email protected]>
As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new VHOST_SCSI_GET_ABI_VERSION ioctl operation.
As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current rev) is for current WIP v3.6 kernel merge candiate code.
I think this is what you had in mind, and hopefully it will make MST happy too. The incremental vhost-scsi patches against Zhi's QEMU are going out shortly ahead of cutting a new vhost-scsi RFC over the next days.
Please have a look and let me know if you have any concerns here.
Thanks!
--- drivers/vhost/tcm_vhost.c | 9 +++++++++ drivers/vhost/tcm_vhost.h | 11 +++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)
drivers/vhost/tcm_vhost.c +9 -0
@@ -977,6 +977,15 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,return -EFAULT ;return vhost_scsi_clear_endpoint (vs, &backend); +case VHOST_SCSI_GET_ABI_VERSION : +if (copy_from_user (&backend, argp,sizeof backend)) +return -EFAULT ; + + backend.abi_version =VHOST_SCSI_ABI_VERSION ; + +if (copy_to_user (argp, &backend,sizeof backend)) +return -EFAULT ; +return 0 ;case VHOST_GET_FEATURES : features =VHOST_FEATURES ;if (copy_to_user (featurep, &features,sizeof features))
drivers/vhost/tcm_vhost.h +11 -0
@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };
@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)
Signature · 1 line
1.7.2.5
Quoted 71 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new
VHOST_SCSI_GET_ABI_VERSIONioctl operation.As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current rev) is for current WIP v3.6 kernel merge candiate code.
I think this is what you had in mind, and hopefully it will make MST happy too. The incremental vhost-scsi patches against Zhi's QEMU are going out shortly ahead of cutting a new vhost-scsi RFC over the next days.
Please have a look and let me know if you have any concerns here.
Thanks!
Reported-by Anthony Liguori <[email protected]>Cc Stefan Hajnoczi <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Zhi Yong Wu <[email protected]>Signed-off-by Nicholas Bellinger <[email protected]>--- drivers/vhost/tcm_vhost.c | 9 +++++++++ drivers/vhost/tcm_vhost.h | 11 +++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)drivers/vhost/tcm_vhost.c +9
-0@@ -977,6 +977,15 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,return -EFAULT ;return vhost_scsi_clear_endpoint (vs, &backend); +case VHOST_SCSI_GET_ABI_VERSION : +if (copy_from_user (&backend, argp,sizeof backend)) +return -EFAULT ; + + backend.abi_version =VHOST_SCSI_ABI_VERSION ; + +if (copy_to_user (argp, &backend,sizeof backend)) +return -EFAULT ; +return 0 ;case VHOST_GET_FEATURES : features =VHOST_FEATURES ;if (copy_to_user (featurep, &features,sizeof features))drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 4 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)
No, you just broke the ABI for version "0" here, that's not how you do this at all.
greg k-h
Quoted 71 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new
VHOST_SCSI_GET_ABI_VERSIONioctl operation.As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current rev) is for current WIP v3.6 kernel merge candiate code.
I think this is what you had in mind, and hopefully it will make MST happy too. The incremental vhost-scsi patches against Zhi's QEMU are going out shortly ahead of cutting a new vhost-scsi RFC over the next days.
Please have a look and let me know if you have any concerns here.
Thanks!
Reported-by Anthony Liguori <[email protected]>Cc Stefan Hajnoczi <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Zhi Yong Wu <[email protected]>Signed-off-by Nicholas Bellinger <[email protected]>--- drivers/vhost/tcm_vhost.c | 9 +++++++++ drivers/vhost/tcm_vhost.h | 11 +++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)drivers/vhost/tcm_vhost.c +9
-0@@ -977,6 +977,15 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl,return -EFAULT ;return vhost_scsi_clear_endpoint (vs, &backend); +case VHOST_SCSI_GET_ABI_VERSION : +if (copy_from_user (&backend, argp,sizeof backend)) +return -EFAULT ; + + backend.abi_version =VHOST_SCSI_ABI_VERSION ; + +if (copy_to_user (argp, &backend,sizeof backend)) +return -EFAULT ; +return 0 ;case VHOST_GET_FEATURES : features =VHOST_FEATURES ;if (copy_to_user (featurep, &features,sizeof features))drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 4 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)
No, you just broke the ABI for version "0" here, that's not how you do this at all.
greg k-h
Quoted 29 lines · Greg Kroah-Hartman
Quoted 28 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new
VHOST_SCSI_GET_ABI_VERSIONioctl operation.As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current rev) is for current WIP v3.6 kernel merge candiate code.
I think this is what you had in mind, and hopefully it will make MST happy too. The incremental vhost-scsi patches against Zhi's QEMU are going out shortly ahead of cutting a new vhost-scsi RFC over the next days.
Please have a look and let me know if you have any concerns here.
Thanks!
Reported-by Anthony Liguori <[email protected]>Cc Stefan Hajnoczi <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Zhi Yong Wu <[email protected]>Signed-off-by Nicholas Bellinger <[email protected]>--- drivers/vhost/tcm_vhost.c | 9 +++++++++ drivers/vhost/tcm_vhost.h | 11 +++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)
<SNIP>
Quoted 22 lines
Quoted 22 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };
Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for tcm_vhost moving forward, with no back-wards compat for the ABI=0 prototype userspace code because:
- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have an GET_ABI_VERSION ioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developers
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
Stefan & Co folks, do you have a preference for a starting point..?
Thanks,
--nab
Quoted 29 lines · Greg Kroah-Hartman
Quoted 28 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new
VHOST_SCSI_GET_ABI_VERSIONioctl operation.As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current rev) is for current WIP v3.6 kernel merge candiate code.
I think this is what you had in mind, and hopefully it will make MST happy too. The incremental vhost-scsi patches against Zhi's QEMU are going out shortly ahead of cutting a new vhost-scsi RFC over the next days.
Please have a look and let me know if you have any concerns here.
Thanks!
Reported-by Anthony Liguori <[email protected]>Cc Stefan Hajnoczi <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Zhi Yong Wu <[email protected]>Signed-off-by Nicholas Bellinger <[email protected]>--- drivers/vhost/tcm_vhost.c | 9 +++++++++ drivers/vhost/tcm_vhost.h | 11 +++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)
<SNIP>
Quoted 22 lines
Quoted 22 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };
Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for tcm_vhost moving forward, with no back-wards compat for the ABI=0 prototype userspace code because:
- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have an GET_ABI_VERSION ioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developers
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
Stefan & Co folks, do you have a preference for a starting point..?
Thanks,
--nab
Quoted 69 lines · Nicholas A. Bellinger
Quoted 29 lines · Greg Kroah-Hartman
Quoted 28 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
As requested by Anthony, here is a patch against target-pending/for-next-merge to expose an ABI version to userspace via a new
VHOST_SCSI_GET_ABI_VERSIONioctl operation.As mentioned in the comment, ABI Rev 0 is for pre 2012 out-of-tree code, and ABI Rev 1 (the current rev) is for current WIP v3.6 kernel merge candiate code.
I think this is what you had in mind, and hopefully it will make MST happy too. The incremental vhost-scsi patches against Zhi's QEMU are going out shortly ahead of cutting a new vhost-scsi RFC over the next days.
Please have a look and let me know if you have any concerns here.
Thanks!
Reported-by Anthony Liguori <[email protected]>Cc Stefan Hajnoczi <[email protected]>Cc Michael S. Tsirkin <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Zhi Yong Wu <[email protected]>Signed-off-by Nicholas Bellinger <[email protected]>--- drivers/vhost/tcm_vhost.c | 9 +++++++++ drivers/vhost/tcm_vhost.h | 11 +++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)<SNIP>
Quoted 22 lines
Quoted 22 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:
Quoted 7 lines
- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developersSo I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the GET_ABI_VERSION ioctl() at this stage is fine, especially considering that the userspace code that talks to tcm_vhost isn't in mainline in userspace yet either.
Stefan
Quoted 6 lines · Nicholas A. Bellinger
Quoted 6 lines
Quoted 6 lines
drivers/vhost/tcm_vhost.h +0
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {
Quoted 8 lines
Quoted 8 lines
drivers/vhost/tcm_vhost.h struct tcm_vhost_tport { · line 88
Quoted 8 lines
drivers/vhost/tcm_vhost.h +6
-0#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/
If it's out of tree, why consider it at all? Put a stable ABI in tree and extend it in compatible ways.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Nicholas A. Bellinger
Quoted 8 lines
Quoted 8 lines
drivers/vhost/tcm_vhost.h +0
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h>
Quoted 12 lines
Quoted 6 lines
Quoted 6 lines
drivers/vhost/tcm_vhost.h struct tcm_vhost_tport { · line 88
Quoted 6 lines
drivers/vhost/tcm_vhost.h +6
-0+/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ If it's out of tree, why consider it at all? Put a stable ABI in tree and extend it in compatible ways.
This comment was supposed to convey that ABI=0 vhost-scsi userspace code is not supported with tcm_vhost mainline code.
But obviously that was not clear enough here. Updating the comment to reflect to make this clear.
So the main question here was if it's fine to start with ABI=1, and require >= ABI=1 for all vhost-scsi userspace code to function with tcm_vhost.
The idea was to avoid confusion for the ABI=0 vhost-scsi code that's been floating around for the last 2 years.
--nab
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Nicholas A. Bellinger
Quoted 8 lines
Quoted 8 lines
drivers/vhost/tcm_vhost.h +0
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h>
Quoted 12 lines
Quoted 6 lines
Quoted 6 lines
drivers/vhost/tcm_vhost.h struct tcm_vhost_tport { · line 88
Quoted 6 lines
drivers/vhost/tcm_vhost.h +6
-0+/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ If it's out of tree, why consider it at all? Put a stable ABI in tree and extend it in compatible ways.
This comment was supposed to convey that ABI=0 vhost-scsi userspace code is not supported with tcm_vhost mainline code.
But obviously that was not clear enough here. Updating the comment to reflect to make this clear.
So the main question here was if it's fine to start with ABI=1, and require >= ABI=1 for all vhost-scsi userspace code to function with tcm_vhost.
The idea was to avoid confusion for the ABI=0 vhost-scsi code that's been floating around for the last 2 years.
--nab
Quoted 4 lines · Stefan Hajnoczi
Quoted 3 lines · Nicholas A. Bellinger
Quoted 2 lines · Greg Kroah-Hartman
Quoted 1 line · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
<SNIP>
Quoted 41 lines
Quoted 41 lines
Quoted 23 lines
Quoted 23 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developers
Quoted 8 lines
Quoted 3 lines
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the
GET_ABI_VERSIONioctl()at this stage is fine, especially considering that the userspace code that talks totcm_vhostisn't in mainline in userspace yet either.
Do you have a preference for a VHOST_SCSI_ABI_VERSION starting point here..?
I thought that v1 would be helpful to avoid confusion with the older userspace code, but don't really have a strong opinion either way..
Let me know what you'd prefer here, and I'll make the changes to tcm_vhost + vhost-scsi patch series accordingly.
Thanks!
--nab
Quoted 4 lines · Stefan Hajnoczi
Quoted 3 lines · Nicholas A. Bellinger
Quoted 2 lines · Greg Kroah-Hartman
Quoted 1 line · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
<SNIP>
Quoted 41 lines
Quoted 41 lines
Quoted 23 lines
Quoted 23 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developers
Quoted 8 lines
Quoted 3 lines
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the
GET_ABI_VERSIONioctl()at this stage is fine, especially considering that the userspace code that talks totcm_vhostisn't in mainline in userspace yet either.
Do you have a preference for a VHOST_SCSI_ABI_VERSION starting point here..?
I thought that v1 would be helpful to avoid confusion with the older userspace code, but don't really have a strong opinion either way..
Let me know what you'd prefer here, and I'll make the changes to tcm_vhost + vhost-scsi patch series accordingly.
Thanks!
--nab
Quoted 59 lines · Nicholas A. Bellinger
Quoted 4 lines · Stefan Hajnoczi
Quoted 3 lines · Nicholas A. Bellinger
Quoted 2 lines · Greg Kroah-Hartman
Quoted 1 line · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
<SNIP>
Quoted 41 lines
Quoted 41 lines
Quoted 23 lines
Quoted 23 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developersQuoted 8 lines
Quoted 3 lines
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the
GET_ABI_VERSIONioctl()at this stage is fine, especially considering that the userspace code that talks totcm_vhostisn't in mainline in userspace yet either.
Quoted 8 lines
Do you have a preference for a
VHOST_SCSI_ABI_VERSIONstarting point here..?I thought that v1 would be helpful to avoid confusion with the older userspace code, but don't really have a strong opinion either way..
Let me know what you'd prefer here, and I'll make the changes to
tcm_vhost+ vhost-scsi patch series accordingly.
I don't think 0 for out-of-tree is needed. I'd start at 0 but either way is okay.
The main thing I would like to confirm is that this only versions the tcm_vhost ioctls? In that case a single version number works.
Stefan
Quoted 59 lines · Nicholas A. Bellinger
Quoted 4 lines · Stefan Hajnoczi
Quoted 3 lines · Nicholas A. Bellinger
Quoted 2 lines · Greg Kroah-Hartman
Quoted 1 line · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
<SNIP>
Quoted 41 lines
Quoted 41 lines
Quoted 23 lines
Quoted 23 lines
drivers/vhost/tcm_vhost.h +10
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ + +#define VHOST_SCSI_ABI_VERSION 1 +struct vhost_scsi_target { +int abi_version;unsigned char vhost_wwpn[TRANSPORT_IQN_LEN ];unsigned short vhost_tpgt; };Quoted 9 lines
drivers/vhost/tcm_vhost.h struct vhost_scsi_target { · line 101
Quoted 5 lines
drivers/vhost/tcm_vhost.h +1
-0@@ -88,3 +98,4 @@ struct vhost_scsi_target {/* VHOST_SCSI specific defines */ #define VHOST_SCSI_SET_ENDPOINT _IOW(VHOST_VIRTIO, 0x40, struct vhost_scsi_target)#define VHOST_SCSI_CLEAR_ENDPOINT _IOW(VHOST_VIRTIO, 0x41, struct vhost_scsi_target) +#define VHOST_SCSI_GET_ABI_VERSION _IOW(VHOST_VIRTIO, 0x42, struct vhost_scsi_target)No, you just broke the ABI for version "0" here, that's not how you do this at all.
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developersQuoted 8 lines
Quoted 3 lines
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the
GET_ABI_VERSIONioctl()at this stage is fine, especially considering that the userspace code that talks totcm_vhostisn't in mainline in userspace yet either.
Quoted 8 lines
Do you have a preference for a
VHOST_SCSI_ABI_VERSIONstarting point here..?I thought that v1 would be helpful to avoid confusion with the older userspace code, but don't really have a strong opinion either way..
Let me know what you'd prefer here, and I'll make the changes to
tcm_vhost+ vhost-scsi patch series accordingly.
I don't think 0 for out-of-tree is needed. I'd start at 0 but either way is okay.
The main thing I would like to confirm is that this only versions the tcm_vhost ioctls? In that case a single version number works.
Stefan
Quoted 6 lines · Stefan Hajnoczi
Quoted 5 lines · Nicholas A. Bellinger
Quoted 4 lines · Stefan Hajnoczi
Quoted 3 lines · Nicholas A. Bellinger
Quoted 2 lines · Greg Kroah-Hartman
Quoted 1 line · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
<SNIP>
Quoted 21 lines
Quoted 21 lines
Quoted 8 lines
Quoted 8 lines
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developersQuoted 8 lines
Quoted 3 lines
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the
GET_ABI_VERSIONioctl()at this stage is fine, especially considering that the userspace code that talks totcm_vhostisn't in mainline in userspace yet either.Do you have a preference for a
VHOST_SCSI_ABI_VERSIONstarting point here..?
Quoted 9 lines
Quoted 5 lines
I thought that v1 would be helpful to avoid confusion with the older userspace code, but don't really have a strong opinion either way..
Let me know what you'd prefer here, and I'll make the changes to
tcm_vhost+ vhost-scsi patch series accordingly.I don't think 0 for out-of-tree is needed. I'd start at 0 but either way is okay.
<nod>
In that case, respinning a -v5 for tcm_vhost to start from ABI=0 and will post an updated patch shortly.
Quoted 3 lines
The main thing I would like to confirm is that this only versions the
tcm_vhostioctls? In that case a single version number works.
Correct, the GET_ABI_VERSION call is only intended to identify the changing of tcm_vhost ioctls.
Quoted 6 lines · Stefan Hajnoczi
Quoted 5 lines · Nicholas A. Bellinger
Quoted 4 lines · Stefan Hajnoczi
Quoted 3 lines · Nicholas A. Bellinger
Quoted 2 lines · Greg Kroah-Hartman
Quoted 1 line · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
<SNIP>
Quoted 21 lines
Quoted 21 lines
Quoted 8 lines
Quoted 8 lines
The intention of this patch is use ABI=1 as a starting point for
tcm_vhostmoving forward, with no back-wards compat for the ABI=0 prototype userspace code because:- It's based on a slightly older version of QEMU (updating the QEMU series now)
- It does not have anGET_ABI_VERSIONioctl cmd (that starts with ABI=1)
- It has a small user-base of target + virtio-scsi developersQuoted 8 lines
Quoted 3 lines
So I did consider just starting from ABI=0, but figured this would help reduce the confusion for QEMU userspace wrt to the vhost-scsi code that's been floating around out-of-tree for the last 2 years.
There is no real user base beyond the handful of people who have hacked on this. Adding the
GET_ABI_VERSIONioctl()at this stage is fine, especially considering that the userspace code that talks totcm_vhostisn't in mainline in userspace yet either.Do you have a preference for a
VHOST_SCSI_ABI_VERSIONstarting point here..?
Quoted 9 lines
Quoted 5 lines
I thought that v1 would be helpful to avoid confusion with the older userspace code, but don't really have a strong opinion either way..
Let me know what you'd prefer here, and I'll make the changes to
tcm_vhost+ vhost-scsi patch series accordingly.I don't think 0 for out-of-tree is needed. I'd start at 0 but either way is okay.
<nod>
In that case, respinning a -v5 for tcm_vhost to start from ABI=0 and will post an updated patch shortly.
Quoted 3 lines
The main thing I would like to confirm is that this only versions the
tcm_vhostioctls? In that case a single version number works.
Correct, the GET_ABI_VERSION call is only intended to identify the changing of tcm_vhost ioctls.
Quoted 10 lines · Nicholas A. Bellinger
In that case, respinning a -v5 for
tcm_vhostto start from ABI=0 and will post an updated patch shortly.Quoted 3 lines
The main thing I would like to confirm is that this only versions the
tcm_vhostioctls? In that case a single version number works.Correct, the
GET_ABI_VERSIONcall is only intended to identify the changing oftcm_vhostioctls.
Why use version numbers at all?
Feature maps are better, because you can get very fine granularity.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 5 lines · Avi Kivity
Quoted 4 lines · Nicholas A. Bellinger
In that case, respinning a -v5 for
tcm_vhostto start from ABI=0 and will post an updated patch shortly.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
The main thing I would like to confirm is that this only versions the
tcm_vhostioctls? In that case a single version number works.Correct, the
GET_ABI_VERSIONcall is only intended to identify the changing oftcm_vhostioctls.Why use version numbers at all?
This was a request by QEMU folks..
Quoted 3 lines
Feature maps are better, because you can get very fine granularity.
Example..? If there is a better way to handle ioctl compat I'd certainly like to hear about it.
Michael S. Tsirkin
maintainerQuoted 30 lines · Nicholas A. Bellinger
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Nicholas A. Bellinger
Quoted 8 lines
Quoted 8 lines
drivers/vhost/tcm_vhost.h +0
-0@@ -80,7 +80,17 @@ struct tcm_vhost_tport {#include <linux/vhost.h> Quoted 12 lines
Quoted 6 lines
Quoted 6 lines
drivers/vhost/tcm_vhost.h struct tcm_vhost_tport { · line 88
Quoted 6 lines
drivers/vhost/tcm_vhost.h +6
-0+/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: All pre 2012 revisions used by prototype out-of-tree code +* ABI Rev 1: 2012 version for v3.6 kernel merge candiate +*/ If it's out of tree, why consider it at all? Put a stable ABI in tree and extend it in compatible ways.
This comment was supposed to convey that ABI=0 vhost-scsi userspace code is not supported with
tcm_vhostmainline code.But obviously that was not clear enough here. Updating the comment to reflect to make this clear.
Quoted 14 lines
So the main question here was if it's fine to start with ABI=1, and require >= ABI=1 for all vhost-scsi userspace code to function with
tcm_vhost.The idea was to avoid confusion for the ABI=0 vhost-scsi code that's been floating around for the last 2 years.
--nab
Yes but I am guessing that code does not invoke the ABI ioctl?
Signature · 1 line
MST
Michael S. Tsirkin
maintainerQuoted 2 lines · Nicholas A. Bellinger
If there is a better way to handle ioctl compat I'd
certainly like to hear about it.
You basically don't touch exiting commands, always add new ones. For example if you want to simply stop some ioctl from working for old userspace, the simplest way is to change ioctl number.
Signature · 1 line
MST
Quoted 5 lines · Nicholas A. Bellinger
Quoted 1 line
Example..? If there is a better way to handle ioctl compat I'd certainly like to hear about it.
r = ioctl(fd, KVM_CHECK_EXTENSION, KVM_CAP_ASSIGN_DEV_IRQ); if (r == -1)
...
if (r)
// ioctl(fd, KVM_ASSIGN_DEV_IRQ, ...) is available
else
not available
Signature · 1 line
error compiling committee.c: too many arguments to function