vhost-scsi: Add support for host virtualized target
Subsystems (4)
v3 cover vhost-scsi: Add support for host virtualized target
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1 to support the upstream tcm_vhost host virtualized target driver now available in v3.6-rc kernel code. This series is based upon last week's commit 346fe0c4c0b, and is aiming for a future QEMU v1.3 merge.
The patch series is available directly from:
git://git.kernel.org/pub/scm/virt/kvm/nab/qemu-kvm.git vhost-scsi-merge-v3
This -v3 series contains further review changes based upon feedback from MST, Paolo, and Blue. It also contains the changes to function against the changes in target-pending/master -> headed for v3.6-rc3 code.
Changes from v3 -> v2:
- Move qdev_prop_vhost_scsi + DEFINE_PROP_VHOST_SCSI defs into vhost-scsi.[c,h] (reported by MST)
- Add enum vhost_scsi_vq_list for VHostSCSI->vqs[] enumeration (reported by MST)
- Add missing braces around single like if statement to following QEMU style (reported by Blue Swirl)
- Change vhost_scsi_target->vhost_wwpn to char *, in order to drop casts to pstrcpy in vhost_scsi_start() + vhost_scsi_stop() (reported by Blue Swirl)
- Change VHOST_SCSI_GET_ABI_VERSION to 'int' type (MST)
- Add vhost-scsi.h include for DEFINE_PROP_VHOST_SCSI (mst + nab)
- Move vhost-scsi related struct members ahead of *cmd_vqs[0] within VirtIOSCSI definition. (paolo + nab)
- Fix 4 byte alignment of vhost_scsi_target (MST)
- Convert fprintf(stderr, ...) usage to -> error_report() (reported by MST)
- Do explict memset of backend before calling VHOST_SCSI_CLEAR_ENDPOINT in vhost_scsi_stop() (reported by MST)
- Add support for vhostfd passing in vhost_scsi_add() (reported by MST)
- Move net_handle_fd_param() -> monitor_handle_fd_param() for generic usage by net/ + vhost-scsi (reported by MST)
- Change vhost_scsi_add() to use monitor_handle_fd_param() (reported by MST)
Changes from v1 -> v2:
- Expose ABI version via VHOST_SCSI_GET_ABI_VERSION + use Rev 0 as starting point for v3.6-rc code (Stefan + ALiguori + nab)
- Fix upstream qemu conflict in hw/qdev-properties.c
- Make GET_ABI_VERSION use int (nab + mst)
- Drop unnecessary event-notifier changes (nab)
- Fix vhost-scsi case lables in configure (reported by paolo)
- Convert qdev_prop_vhost_scsi to use ->get() + ->set() following qdev_prop_netdev (reported by paolo)
- Fix typo in qemu-options.hx definition of vhost-scsi (reported by paolo)
- Squash virtio-scsi: use the vhost-scsi host device from stefan (nab)
- Fix up virtio_scsi_properties[] conflict w/ upstream qemu (nab)
- Drop usage of to_virtio_scsi() in virtio_scsi_set_status() (reported by paolo)
- Use modern VirtIOSCSIConf define in virtio-scsi.h (reported by paolo)
- Use s->conf->vhost_scsi instead of proxyconf->vhost_scsi in virtio_scsi_init() (reported by paolo)
- Only register QEMU SCSI bus is vhost-scsi is not active (reported by paolo)
- Fix incorrect VirtIOSCSI->cmd_vqs[0] definition (nab)
Thanks again to everyone who has been reviewing this series!
--nab
Nicholas Bellinger (2):
monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param
virtio-scsi: Set max_target=0 during vhost-scsi operation
Stefan Hajnoczi (3):
vhost: Pass device path to vhost_dev_init()
vhost-scsi: add -vhost-scsi host device for use with tcm-vhost
virtio-scsi: Add start/stop functionality for vhost-scsi
configure | 10 +++ hw/Makefile.objs | 1 + hw/qdev-properties.c | 41 +++++++++++ hw/vhost-scsi.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/vhost-scsi.h | 62 ++++++++++++++++ hw/vhost.c | 5 +- hw/vhost.h | 3 +- hw/vhost_net.c | 2 +- hw/virtio-pci.c | 2 + hw/virtio-scsi.c | 55 ++++++++++++++- hw/virtio-scsi.h | 1 + monitor.c | 18 +++++ monitor.h | 1 + net.c | 18 ----- net.h | 2 - net/socket.c | 2 +- net/tap.c | 4 +- qemu-common.h | 1 + qemu-config.c | 19 +++++ qemu-options.hx | 4 + vl.c | 18 +++++ 21 files changed, 431 insertions(+), 28 deletions(-) create mode 100644 hw/vhost-scsi.c create mode 100644 hw/vhost-scsi.h
Signature · 1 line
1.7.2.5
RFC v3 1/5 monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param
From: Nicholas Bellinger <[email protected]>
This patch renames+moves the net_handle_fd_param() caller used to obtain a file descriptor from either qemu_parse_fd() (the normal case) or from monitor_get_fd() (migration case) into a generically prefixed monitor_handle_fd_param() to be used by vhost-scsi code.
Also update net/[socket,tap].c consumers to use the new prefix.
--- monitor.c | 18 ++++++++++++++++++ monitor.h | 1 + net.c | 18 ------------------ net.h | 2 -- net/socket.c | 2 +- net/tap.c | 4 ++-- 6 files changed, 22 insertions(+), 23 deletions(-)
monitor.c +18 -0
@@ -2389,6 +2389,24 @@ int monitor_get_fd(Monitor *mon, const char *fdname)return -1 ; } +int monitor_handle_fd_param (Monitor *mon,const char *fdname) +{ +int fd; + +if (!qemu_isdigit (fdname[0 ]) && mon) { + + fd =monitor_get_fd (mon, fdname); +if (fd ==-1 ) { +error_report ("No file descriptor named %s found" , fdname); +return -1 ; + } + }else { + fd =qemu_parse_fd (fdname); + } + +return fd; +} +/* mon_cmds and info_cmds would be sorted at runtime */ static mon_cmd_t mon_cmds[] = { #include "hmp-commands.h"
monitor.h +1 -0
@@ -65,6 +65,7 @@ int monitor_read_block_device_key(Monitor *mon, const char *device, void *opaque);int monitor_get_fd (Monitor *mon,const char *fdname); +int monitor_handle_fd_param (Monitor *mon,const char *fdname); void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
net.c +0 -18
@@ -522,24 +522,6 @@ int qemu_find_nic_model(NICInfo *nd, const char * const *models,return -1 ; } -int net_handle_fd_param (Monitor *mon,const char *param) -{ -int fd; - -if (!qemu_isdigit (param[0 ]) && mon) { - - fd =monitor_get_fd (mon, param); -if (fd ==-1 ) { -error_report ("No file descriptor named %s found" , param); -return -1 ; - } - }else { - fd =qemu_parse_fd (param); - } - -return fd; -} -static int net_init_nic (const NetClientOptions *opts,const char *name,NetClientState *peer) {
net.h +0 -2
@@ -168,8 +168,6 @@ int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret);void qdev_set_nic_properties (DeviceState *dev,NICInfo *nd); -int net_handle_fd_param (Monitor *mon,const char *param); -#define POLYNOMIAL 0x04c11db6unsigned compute_mcast_idx (const uint8_t *ep);
net/socket.c +1 -1
@@ -629,7 +629,7 @@ int net_init_socket(const NetClientOptions *opts, const char *name,if (sock->has_fd) {int fd; - fd =net_handle_fd_param (cur_mon, sock->fd); + fd =monitor_handle_fd_param (cur_mon, sock->fd);if (fd ==-1 || !net_socket_fd_init (peer,"socket" , name, fd,1 )) {return -1 ; }
net/tap.c +2 -2
@@ -610,7 +610,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,return -1 ; } - fd =net_handle_fd_param (cur_mon, tap->fd); + fd =monitor_handle_fd_param (cur_mon, tap->fd);if (fd ==-1 ) {return -1 ; }
@@ -686,7 +686,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,int vhostfd;if (tap->has_vhostfd) { - vhostfd =net_handle_fd_param (cur_mon, tap->vhostfd); + vhostfd =monitor_handle_fd_param (cur_mon, tap->vhostfd);if (vhostfd ==-1 ) {return -1 ; }
Signature · 1 line
1.7.2.5
RFC v3 1/5 monitor: Rename+move net_handle_fd_param -> monitor_handle_fd_param
In reply to Nicholas A. BellingerFrom: Nicholas Bellinger <[email protected]>
This patch renames+moves the net_handle_fd_param() caller used to obtain a file descriptor from either qemu_parse_fd() (the normal case) or from monitor_get_fd() (migration case) into a generically prefixed monitor_handle_fd_param() to be used by vhost-scsi code.
Also update net/[socket,tap].c consumers to use the new prefix.
--- monitor.c | 18 ++++++++++++++++++ monitor.h | 1 + net.c | 18 ------------------ net.h | 2 -- net/socket.c | 2 +- net/tap.c | 4 ++-- 6 files changed, 22 insertions(+), 23 deletions(-)
monitor.c +18 -0
@@ -2389,6 +2389,24 @@ int monitor_get_fd(Monitor *mon, const char *fdname)return -1 ; } +int monitor_handle_fd_param (Monitor *mon,const char *fdname) +{ +int fd; + +if (!qemu_isdigit (fdname[0 ]) && mon) { + + fd =monitor_get_fd (mon, fdname); +if (fd ==-1 ) { +error_report ("No file descriptor named %s found" , fdname); +return -1 ; + } + }else { + fd =qemu_parse_fd (fdname); + } + +return fd; +} +/* mon_cmds and info_cmds would be sorted at runtime */ static mon_cmd_t mon_cmds[] = { #include "hmp-commands.h"
monitor.h +1 -0
@@ -65,6 +65,7 @@ int monitor_read_block_device_key(Monitor *mon, const char *device, void *opaque);int monitor_get_fd (Monitor *mon,const char *fdname); +int monitor_handle_fd_param (Monitor *mon,const char *fdname); void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
net.c +0 -18
@@ -522,24 +522,6 @@ int qemu_find_nic_model(NICInfo *nd, const char * const *models,return -1 ; } -int net_handle_fd_param (Monitor *mon,const char *param) -{ -int fd; - -if (!qemu_isdigit (param[0 ]) && mon) { - - fd =monitor_get_fd (mon, param); -if (fd ==-1 ) { -error_report ("No file descriptor named %s found" , param); -return -1 ; - } - }else { - fd =qemu_parse_fd (param); - } - -return fd; -} -static int net_init_nic (const NetClientOptions *opts,const char *name,NetClientState *peer) {
net.h +0 -2
@@ -168,8 +168,6 @@ int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret);void qdev_set_nic_properties (DeviceState *dev,NICInfo *nd); -int net_handle_fd_param (Monitor *mon,const char *param); -#define POLYNOMIAL 0x04c11db6unsigned compute_mcast_idx (const uint8_t *ep);
net/socket.c +1 -1
@@ -629,7 +629,7 @@ int net_init_socket(const NetClientOptions *opts, const char *name,if (sock->has_fd) {int fd; - fd =net_handle_fd_param (cur_mon, sock->fd); + fd =monitor_handle_fd_param (cur_mon, sock->fd);if (fd ==-1 || !net_socket_fd_init (peer,"socket" , name, fd,1 )) {return -1 ; }
net/tap.c +2 -2
@@ -610,7 +610,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,return -1 ; } - fd =net_handle_fd_param (cur_mon, tap->fd); + fd =monitor_handle_fd_param (cur_mon, tap->fd);if (fd ==-1 ) {return -1 ; }
@@ -686,7 +686,7 @@ int net_init_tap(const NetClientOptions *opts, const char *name,int vhostfd;if (tap->has_vhostfd) { - vhostfd =net_handle_fd_param (cur_mon, tap->vhostfd); + vhostfd =monitor_handle_fd_param (cur_mon, tap->vhostfd);if (vhostfd ==-1 ) {return -1 ; }
Signature · 1 line
1.7.2.5
RFC v3 2/5 vhost: Pass device path to vhost_dev_init()
In reply to Nicholas A. BellingerFrom: Stefan Hajnoczi <[email protected]>
The path to /dev/vhost-net is currently hardcoded in vhost_dev_init(). This needs to be changed so that /dev/vhost-scsi can be used. Pass in the device path instead of hardcoding it.
--- hw/vhost.c | 5 +++-- hw/vhost.h | 3 ++- hw/vhost_net.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-)
hw/vhost.c +3 -2
@@ -747,14 +747,15 @@ static void vhost_eventfd_del(MemoryListener *listener, { } -int vhost_dev_init (struct vhost_dev *hdev,int devfd,bool force) +int vhost_dev_init (struct vhost_dev *hdev,int devfd,const char *devpath, +bool force) {uint64_t features;int r;if (devfd >=0 ) { hdev->control = devfd; }else { - hdev->control =open ("/dev/vhost-net" ,O_RDWR ); + hdev->control =open (devpath,O_RDWR );if (hdev->control <0 ) {return -errno; }
hw/vhost.h +2 -1
@@ -44,7 +44,8 @@ struct vhost_dev {bool force; }; -int vhost_dev_init (struct vhost_dev *hdev,int devfd,bool force); +int vhost_dev_init (struct vhost_dev *hdev,int devfd,const char *devpath, +bool force);void vhost_dev_cleanup (struct vhost_dev *hdev);bool vhost_dev_query (struct vhost_dev *hdev,VirtIODevice *vdev);int vhost_dev_start (struct vhost_dev *hdev,VirtIODevice *vdev);
hw/vhost_net.c +1 -1
@@ -109,7 +109,7 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd, (1 <<VHOST_NET_F_VIRTIO_NET_HDR ); net->backend = r; - r =vhost_dev_init (&net->dev, devfd, force); + r =vhost_dev_init (&net->dev, devfd,"/dev/vhost-net" , force);if (r <0 ) { goto fail; }
Signature · 1 line
1.7.2.5
RFC v3 2/5 vhost: Pass device path to vhost_dev_init()
In reply to Nicholas A. BellingerFrom: Stefan Hajnoczi <[email protected]>
The path to /dev/vhost-net is currently hardcoded in vhost_dev_init(). This needs to be changed so that /dev/vhost-scsi can be used. Pass in the device path instead of hardcoding it.
--- hw/vhost.c | 5 +++-- hw/vhost.h | 3 ++- hw/vhost_net.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-)
hw/vhost.c +3 -2
@@ -747,14 +747,15 @@ static void vhost_eventfd_del(MemoryListener *listener, { } -int vhost_dev_init (struct vhost_dev *hdev,int devfd,bool force) +int vhost_dev_init (struct vhost_dev *hdev,int devfd,const char *devpath, +bool force) {uint64_t features;int r;if (devfd >=0 ) { hdev->control = devfd; }else { - hdev->control =open ("/dev/vhost-net" ,O_RDWR ); + hdev->control =open (devpath,O_RDWR );if (hdev->control <0 ) {return -errno; }
hw/vhost.h +2 -1
@@ -44,7 +44,8 @@ struct vhost_dev {bool force; }; -int vhost_dev_init (struct vhost_dev *hdev,int devfd,bool force); +int vhost_dev_init (struct vhost_dev *hdev,int devfd,const char *devpath, +bool force);void vhost_dev_cleanup (struct vhost_dev *hdev);bool vhost_dev_query (struct vhost_dev *hdev,VirtIODevice *vdev);int vhost_dev_start (struct vhost_dev *hdev,VirtIODevice *vdev);
hw/vhost_net.c +1 -1
@@ -109,7 +109,7 @@ struct vhost_net *vhost_net_init(NetClientState *backend, int devfd, (1 <<VHOST_NET_F_VIRTIO_NET_HDR ); net->backend = r; - r =vhost_dev_init (&net->dev, devfd, force); + r =vhost_dev_init (&net->dev, devfd,"/dev/vhost-net" , force);if (r <0 ) { goto fail; }
Signature · 1 line
1.7.2.5
RFC v3 3/5 vhost-scsi: add -vhost-scsi host device for use with tcm-vhost
In reply to Nicholas A. BellingerFrom: Stefan Hajnoczi <[email protected]>
This patch adds a new type of host device that drives the vhost_scsi device. The syntax to add vhost-scsi is:
qemu -vhost-scsi id=vhost-scsi0,wwpn=...,tpgt=123
The virtio-scsi emulated device will make use of vhost-scsi to process virtio-scsi requests inside the kernel and hand them to the in-kernel SCSI target stack using the tcm_vhost fabric driver.
The tcm_vhost driver was merged into the upstream linux kernel for 3.6-rc2, and the commit can be found here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=057cbf49a1f08297
Changelog v2 -> v3:
- Move qdev_prop_vhost_scsi + DEFINE_PROP_VHOST_SCSI defs into vhost-scsi.[c,h] (reported by MST)
- Add enum vhost_scsi_vq_list for VHostSCSI->vqs[] enumeration (reported by MST)
- Add missing braces around single like if statement to following QEMU style (reported by Blue Swirl)
- Change vhost_scsi_target->vhost_wwpn to char *, in order to drop casts to pstrcpy in vhost_scsi_start() + vhost_scsi_stop() (reported by Blue Swirl)
- Change VHOST_SCSI_GET_ABI_VERSION to 'int' type (MST)
- Fix 4 byte alignment of vhost_scsi_target (MST)
- Convert fprintf(stderr, ...) usage to -> error_report() (reported by MST)
- Do explict memset of backend before calling VHOST_SCSI_CLEAR_ENDPOINT in vhost_scsi_stop() (reported by MST)
- Add support for vhostfd passing in vhost_scsi_add() (reported by MST)
- Change vhost_scsi_add() to use monitor_handle_fd_param() (reported by MST)
Changelog v1 -> v2:
- Expose ABI version via VHOST_SCSI_GET_ABI_VERSION + use Rev 0 as starting point for v3.6-rc code (Stefan + ALiguori + nab)
- Fix upstream qemu conflict in hw/qdev-properties.c
- Make GET_ABI_VERSION use int (nab + mst)
- Fix vhost-scsi case lables in configure (reported by paolo)
- Convert qdev_prop_vhost_scsi to use ->get() + ->set() following qdev_prop_netdev (reported by paolo)
- Fix typo in qemu-options.hx definition of vhost-scsi (reported by paolo)
Changelog v0 -> v1:
- Add VHOST_SCSI_SET_ENDPOINT call (stefan)
- Enable vhost notifiers for multiple queues (Zhi)
- clear vhost-scsi endpoint on stopped (Zhi)
- Add CONFIG_VHOST_SCSI for QEMU build configure (nab)
- Rename vhost_vring_target -> vhost_scsi_target (mst + nab)
- Add support for VHOST_SCSI_GET_ABI_VERSION ioctl (aliguori + nab)
--- configure | 10 +++ hw/Makefile.objs | 1 + hw/qdev-properties.c | 41 +++++++++++ hw/vhost-scsi.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/vhost-scsi.h | 62 ++++++++++++++++ qemu-common.h | 1 + qemu-config.c | 19 +++++ qemu-options.hx | 4 + vl.c | 18 +++++ 9 files changed, 346 insertions(+), 0 deletions(-) create mode 100644 hw/vhost-scsi.c create mode 100644 hw/vhost-scsi.h
configure +10 -0
@@ -168,6 +168,7 @@ libattr="" xfs="" vhost_net="no" +vhost_scsi="no" kvm="no" gprof="no" debug_tcg="no"
@@ -513,6 +514,7 @@ Haiku) usb="linux" kvm="yes" vhost_net="yes" + vhost_scsi="yes" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then audio_possible_drivers="$audio_possible_drivers fmod" fi
@@ -818,6 +820,10 @@ for opt do ;; --enable-vhost-net) vhost_net="yes" ;; + --disable-vhost-scsi) vhost_scsi="no" + ;; + --enable-vhost-scsi) vhost_scsi="yes" + ;; --disable-opengl) opengl="no" ;; --enable-opengl) opengl="yes"
@@ -3116,6 +3122,7 @@ echo "posix_madvise $posix_madvise" echo "uuid support $uuid" echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" +echo "vhost-scsi support $vhost_scsi" echo "Trace backend $trace_backend" echo "Trace output file $trace_file-<pid>" echo "spice support $spice"
@@ -3828,6 +3835,9 @@ case "$target_arch2" in if test "$vhost_net" = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak fi + if test "$vhost_scsi" = "yes" ; then + echo "CONFIG_VHOST_SCSI=y" >> $config_target_mak + fi fi esac case "$target_arch2" in
hw/Makefile.objs +1 -0
@@ -169,6 +169,7 @@ obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o virtio-scsi.o obj-$(CONFIG_SOFTMMU) += vhost_net.o obj-$(CONFIG_VHOST_NET) += vhost.o +obj-$(CONFIG_VHOST_SCSI) += vhost-scsi.o obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/ obj-$(CONFIG_NO_PCI) += pci-stub.o obj-$(CONFIG_VGA) += vga.o
hw/qdev-properties.c +41 -0
53 lines not on this page · raw message
hw/vhost-scsi.c new file +190 -0
190 lines not on this page · raw message
hw/vhost-scsi.h new file +62 -0
62 lines not on this page · raw message
qemu-common.h +1 -0
@@ -280,6 +280,7 @@ typedef struct EventNotifier EventNotifier;typedef struct VirtIODevice VirtIODevice ;typedef struct QEMUSGList QEMUSGList ;typedef struct SHPCDevice SHPCDevice ; +typedef struct VHostSCSI VHostSCSI ;typedef uint64_t pcibus_t ;
qemu-config.c +19 -0
@@ -626,6 +626,24 @@ QemuOptsList qemu_boot_opts = { }, }; +QemuOptsList qemu_vhost_scsi_opts = { + .name ="vhost-scsi" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_vhost_scsi_opts.head), + .desc = { + { + .name ="wwpn" , + .type =QEMU_OPT_STRING , + }, { + .name ="tpgt" , + .type =QEMU_OPT_NUMBER , + }, { + .name ="vhostfd" , + .type =QEMU_OPT_STRING , + }, + {/* end of list */ } + }, +}; +static QemuOptsList *vm_config_groups[32 ] = { &qemu_drive_opts, &qemu_chardev_opts,
@@ -641,6 +659,7 @@ static QemuOptsList *vm_config_groups[32] = { &qemu_machine_opts, &qemu_boot_opts, &qemu_iscsi_opts, + &qemu_vhost_scsi_opts, NULL, };
qemu-options.hx +4 -0
@@ -565,6 +565,10 @@ possible drivers and properties, use @code{-device ?} and ETEXI DEFHEADING() +DEF("vhost-scsi", HAS_ARG, QEMU_OPTION_vhost_scsi, + "-vhost-scsi wwpn=string0,tpgt=number0\n" + " add vhost-scsi device\n", + QEMU_ARCH_ALL) DEFHEADING(File system options:)
vl.c +18 -0
@@ -144,6 +144,7 @@ int main(int argc, char **argv)#include "qemu-options.h" #include "qmp-commands.h" #include "main-loop.h" +#include "hw/vhost-scsi.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" #endif
@@ -1858,6 +1859,14 @@ static int fsdev_init_func(QemuOpts *opts, void *opaque) }#endif +static int vhost_scsi_init_func (QemuOpts *opts,void *opaque) +{ +if (!vhost_scsi_add_opts (opts)) { +return -1 ; + } +return 0 ; +} +static int mon_init_func (QemuOpts *opts,void *opaque) {CharDriverState *chr;
@@ -2617,6 +2626,11 @@ int main(int argc, char **argv, char **envp) }break ;#endif +case QEMU_OPTION_vhost_scsi: +if (!qemu_opts_parse (qemu_find_opts ("vhost-scsi" ), optarg,0 )) { +exit (1 ); + } +break ;#ifdef CONFIG_SLIRP case QEMU_OPTION_tftp: legacy_tftp_prefix = optarg;
@@ -3337,6 +3351,10 @@ int main(int argc, char **argv, char **envp) exit(1); }#endif +if (qemu_opts_foreach (qemu_find_opts ("vhost-scsi" ), + vhost_scsi_init_func,NULL ,1 )) { +exit (1 ); + }os_daemonize ();
Signature · 1 line
1.7.2.5
Michael S. Tsirkin
maintainerRe: [RFC-v3 3/5] vhost-scsi: add -vhost-scsi host device for use with tcm-vhost
Quoted 7 lines · Nicholas A. Bellinger
From: Stefan Hajnoczi <[email protected]>
This patch adds a new type of host device that drives the
vhost_scsidevice. The syntax to add vhost-scsi is:qemu -vhost-scsi id=vhost-scsi0,wwpn=...,tpgt=123
Quoted 9 lines
The virtio-scsi emulated device will make use of vhost-scsi to process virtio-scsi requests inside the kernel and hand them to the in-kernel SCSI target stack using the
tcm_vhostfabric driver.The
tcm_vhostdriver was merged into the upstream linux kernel for 3.6-rc2, and the commit can be found here:http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=057cbf49a1f08297
In the future, please put changelog after --- or in the cover
letter: we do not need it in git history.
I fixed this up.
Quoted 557 lines
Changelog v2 -> v3:
- Move
qdev_prop_vhost_scsi+DEFINE_PROP_VHOST_SCSIdefs into vhost-scsi.[c,h] (reported by MST)
- Add enumvhost_scsi_vq_listfor VHostSCSI->vqs[] enumeration (reported by MST)
- Add missing braces around single like if statement to following QEMU style (reported by Blue Swirl)
- Changevhost_scsi_target->vhost_wwpnto char *, in order to drop casts to pstrcpy invhost_scsi_start()+vhost_scsi_stop()(reported by Blue Swirl)
- ChangeVHOST_SCSI_GET_ABI_VERSIONto 'int' type (MST)
- Fix 4 byte alignment ofvhost_scsi_target(MST)
- Convertfprintf(stderr, ...)usage to ->error_report()(reported by MST)
- Do explict memset of backend before callingVHOST_SCSI_CLEAR_ENDPOINTinvhost_scsi_stop()(reported by MST)
- Add support for vhostfd passing invhost_scsi_add()(reported by MST)
- Changevhost_scsi_add()to usemonitor_handle_fd_param()(reported by MST)Changelog v1 -> v2:
- Expose ABI version via
VHOST_SCSI_GET_ABI_VERSION+ use Rev 0 as starting point for v3.6-rc code (Stefan + ALiguori + nab)
- Fix upstream qemu conflict inhw/qdev-properties.c
- MakeGET_ABI_VERSIONuse int (nab + mst)
- Fix vhost-scsi case lables in configure (reported by paolo)
- Convertqdev_prop_vhost_scsito use ->get() + ->set() followingqdev_prop_netdev(reported by paolo)
- Fix typo in qemu-options.hx definition of vhost-scsi (reported by paolo)Changelog v0 -> v1:
- Add
VHOST_SCSI_SET_ENDPOINTcall (stefan)
- Enable vhost notifiers for multiple queues (Zhi)
- clear vhost-scsi endpoint on stopped (Zhi)
- AddCONFIG_VHOST_SCSIfor QEMU build configure (nab)
- Renamevhost_vring_target->vhost_scsi_target(mst + nab)
- Add support forVHOST_SCSI_GET_ABI_VERSIONioctl (aliguori + nab)Cc Stefan Hajnoczi <[email protected]>Cc Zhi Yong Wu <[email protected]>Cc Anthony Liguori <[email protected]>Cc Paolo Bonzini <[email protected]>Cc Michael S. Tsirkin <[email protected]>Signed-off-by Nicholas Bellinger <[email protected]>--- configure | 10 +++ hw/Makefile.objs | 1 + hw/qdev-properties.c | 41 +++++++++++ hw/vhost-scsi.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/vhost-scsi.h | 62 ++++++++++++++++ qemu-common.h | 1 + qemu-config.c | 19 +++++ qemu-options.hx | 4 + vl.c | 18 +++++ 9 files changed, 346 insertions(+), 0 deletions(-) create mode 100644 hw/vhost-scsi.c create mode 100644 hw/vhost-scsi.hconfigure +10
-0@@ -168,6 +168,7 @@ libattr="" xfs="" vhost_net="no" +vhost_scsi="no" kvm="no" gprof="no" debug_tcg="no"@@ -513,6 +514,7 @@ Haiku) usb="linux" kvm="yes" vhost_net="yes" + vhost_scsi="yes" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then audio_possible_drivers="$audio_possible_drivers fmod" fi@@ -818,6 +820,10 @@ for opt do ;; --enable-vhost-net) vhost_net="yes" ;; + --disable-vhost-scsi) vhost_scsi="no" + ;; + --enable-vhost-scsi) vhost_scsi="yes" + ;; --disable-opengl) opengl="no" ;; --enable-opengl) opengl="yes"@@ -3116,6 +3122,7 @@ echo "posix_madvise $posix_madvise" echo "uuid support $uuid" echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" +echo "vhost-scsi support $vhost_scsi" echo "Trace backend $trace_backend" echo "Trace output file $trace_file-<pid>" echo "spice support $spice"@@ -3828,6 +3835,9 @@ case "$target_arch2" in if test "$vhost_net" = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak fi + if test "$vhost_scsi" = "yes" ; then + echo "CONFIG_VHOST_SCSI=y" >> $config_target_mak + fi fi esac case "$target_arch2" inhw/Makefile.objs +1
-0@@ -169,6 +169,7 @@ obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o virtio-scsi.o obj-$(CONFIG_SOFTMMU) += vhost_net.o obj-$(CONFIG_VHOST_NET) += vhost.o +obj-$(CONFIG_VHOST_SCSI) += vhost-scsi.o obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/ obj-$(CONFIG_NO_PCI) += pci-stub.o obj-$(CONFIG_VGA) += vga.ohw/qdev-properties.c +41
-0@@ -4,6 +4,7 @@#include "blockdev.h" #include "hw/block-common.h" #include "net/hub.h" +#include "vhost-scsi.h" void *qdev_get_prop_ptr (DeviceState *dev,Property *prop) {@@ -696,6 +697,46 @@ PropertyInfo qdev_prop_vlan = { .set = set_vlan, }; +/* --- vhost-scsi --- */ + +static int parse_vhost_scsi_dev (DeviceState *dev,const char *str,void **ptr) +{ +VHostSCSI *p; + + p =find_vhost_scsi (str); +if (p ==NULL ) { +return -ENOENT ; + } + + *ptr = p; +return 0 ; +} + +static const char *print_vhost_scsi_dev (void *ptr) +{ +VHostSCSI *p = ptr; + +return (p) ?vhost_scsi_get_id (p) :"<null>" ; +} + +static void get_vhost_scsi_dev (Object *obj,Visitor *v,void *opaque, +const char *name,Error **errp) +{ +get_pointer (obj, v, opaque, print_vhost_scsi_dev, name, errp); +} + +static void set_vhost_scsi_dev (Object *obj,Visitor *v,void *opaque, +const char *name,Error **errp) +{ +set_pointer (obj, v, opaque, parse_vhost_scsi_dev, name, errp); +} + +PropertyInfo qdev_prop_vhost_scsi = { + .name ="vhost-scsi" , + .get = get_vhost_scsi_dev, + .set = set_vhost_scsi_dev, +}; +/* --- pointer --- */ /* Not a proper property, just for dirty hacks. TODO Remove it! */ hw/vhost-scsi.c new file +190
-0@@ -0,0 +1,190 @@ +/* +* vhost_scsi host device +* +* Copyright IBM, Corp. 2011 +* +* Authors: +* Stefan Hajnoczi <[email protected]> +* +* Changes for QEMU mainline + tcm_vhost kernel upstream: +* Nicholas Bellinger <[email protected]> +* +* This work is licensed under the terms of the GNU LGPL, version 2 or later. +* See the COPYING.LIB file in the top-level directory. +* +*/ + +#include <sys/ioctl.h> +#include "config.h" +#include "qemu-queue.h" +#include "monitor.h" +#include "vhost-scsi.h" +#include "vhost.h" + +struct VHostSCSI { +const char *id; +const char *wwpn; +uint16_t tpgt; +int vhostfd; +struct vhost_dev dev; +struct vhost_virtqueue vqs[VHOST_SCSI_VQ_NUM ]; +QLIST_ENTRY (VHostSCSI) list; +}; + +static QLIST_HEAD(, VHostSCSI) vhost_scsi_list = +QLIST_HEAD_INITIALIZER (vhost_scsi_list); + +VHostSCSI *find_vhost_scsi (const char *id) +{ +VHostSCSI *vs; + + QLIST_FOREACH(vs, &vhost_scsi_list, list) { +if (!strcmp (id, vs->id)) { +return vs; + } + } +return NULL ; +} + +const char *vhost_scsi_get_id (VHostSCSI *vs) +{ +return vs->id; +} + +int vhost_scsi_start (VHostSCSI *vs,VirtIODevice *vdev) +{ +int ret, abi_version; +struct vhost_scsi_target backend; + +if (!vhost_dev_query (&vs->dev, vdev)) { +return -ENOTSUP ; + } + + vs->dev.nvqs =VHOST_SCSI_VQ_NUM ; + vs->dev.vqs = vs->vqs; + + ret =vhost_dev_enable_notifiers (&vs->dev, vdev); +if (ret <0 ) { +return ret; + } + + ret =vhost_dev_start (&vs->dev, vdev); +if (ret <0 ) { +return ret; + } + + ret =ioctl (vs->dev.control,VHOST_SCSI_GET_ABI_VERSION , &abi_version); +if (ret <0 ) { + ret = -errno; +vhost_dev_stop (&vs->dev, vdev); +return ret; + } +if (abi_version >VHOST_SCSI_ABI_VERSION ) { +error_report ("vhost-scsi: The running tcm_vhost kernel abi_version:" +" %d is greater than vhost_scsi userspace supports: %d, please" +" upgrade your version of QEMU\n" , abi_version, +VHOST_SCSI_ABI_VERSION ); + ret = -ENOSYS ; +vhost_dev_stop (&vs->dev, vdev); +return ret; + } +fprintf (stdout,"TCM_vHost ABI version: %d\n" , abi_version); + +memset (&backend,0 ,sizeof (backend)); +pstrcpy (backend.vhost_wwpn,sizeof (backend.vhost_wwpn), vs->wwpn); + backend.vhost_tpgt = vs->tpgt; + ret =ioctl (vs->dev.control,VHOST_SCSI_SET_ENDPOINT , &backend); +if (ret <0 ) { + ret = -errno; +vhost_dev_stop (&vs->dev, vdev); +return ret; + } + +return 0 ; +} + +void vhost_scsi_stop (VHostSCSI *vs,VirtIODevice *vdev) +{ +int ret; +struct vhost_scsi_target backend; + +memset (&backend,0 ,sizeof (backend)); +pstrcpy (backend.vhost_wwpn,sizeof (backend.vhost_wwpn), vs->wwpn); + backend.vhost_tpgt = vs->tpgt; + ret =ioctl (vs->dev.control,VHOST_SCSI_CLEAR_ENDPOINT , &backend); +if (ret <0 ) { +error_report ("vhost-scsi: Failed to clear endpoint\n" ); + } + +vhost_dev_stop (&vs->dev, vdev); +} + +static VHostSCSI *vhost_scsi_add (const char *id,const char *wwpn, +uint16_t tpgt,const char *vhostfd_str) +{ +VHostSCSI *vs; +int ret; + + vs =g_malloc0 (sizeof (*vs)); +if (!vs) { +error_report ("vhost-scsi: unable to allocate *vs\n" ); +return NULL ; + } + vs->vhostfd =-1 ; + +if (vhostfd_str) { + vs->vhostfd =monitor_handle_fd_param (cur_mon, vhostfd_str); +if (vs->vhostfd ==-1 ) { +error_report ("vhost-scsi: unable to parse vs->vhostfd\n" ); +return NULL ; + } + } +/* TODO set up vhost-scsi device and bind to tcm_vhost/$wwpm/tpgt_$tpgt */ + ret =vhost_dev_init (&vs->dev, vs->vhostfd,"/dev/vhost-scsi" , false); +if (ret <0 ) { +error_report ("vhost-scsi: vhost initialization failed: %s\n" , +strerror (-ret)); +return NULL ; + } + vs->dev.backend_features =0 ; + vs->dev.acked_features =0 ; + + vs->id =g_strdup (id); + vs->wwpn =g_strdup (wwpn); + vs->tpgt = tpgt; +QLIST_INSERT_HEAD (&vhost_scsi_list, vs, list); + +return vs; +} + +VHostSCSI *vhost_scsi_add_opts (QemuOpts *opts) +{ +const char *id; +const char *wwpn, *vhostfd; +uint64_t tpgt; + + id =qemu_opts_id (opts); +if (!id) { +error_report ("vhost-scsi: no id specified\n" ); +return NULL ; + } +if (find_vhost_scsi (id)) { +error_report ("duplicate vhost-scsi: \"%s\"\n" , id); +return NULL ; + } + + wwpn =qemu_opt_get (opts,"wwpn" ); +if (!wwpn) { +error_report ("vhost-scsi: \"%s\" missing wwpn\n" , id); +return NULL ; + } + + tpgt =qemu_opt_get_number (opts,"tpgt" ,UINT64_MAX ); +if (tpgt >UINT16_MAX ) { +error_report ("vhost-scsi: \"%s\" needs a 16-bit tpgt\n" , id); +return NULL ; + } + vhostfd =qemu_opt_get (opts,"vhostfd" ); + +return vhost_scsi_add (id, wwpn, tpgt, vhostfd); +}hw/vhost-scsi.h new file +62
-0@@ -0,0 +1,62 @@ +/* +* vhost_scsi host device +* +* Copyright IBM, Corp. 2011 +* +* Authors: +* Stefan Hajnoczi <[email protected]> +* +* This work is licensed under the terms of the GNU LGPL, version 2 or later. +* See the COPYING.LIB file in the top-level directory. +* +*/ + +#ifndef VHOST_SCSI_H +#define VHOST_SCSI_H + +#include "qemu-common.h" +#include "qemu-option.h" +#include "qdev.h" + +/* +* Used by QEMU userspace to ensure a consistent vhost-scsi ABI. +* +* ABI Rev 0: July 2012 version starting point for v3.6-rc merge candidate + +* RFC-v2 vhost-scsi userspace. Add GET_ABI_VERSION ioctl usage +*/ + +#define VHOST_SCSI_ABI_VERSION 0 + +/* TODO #include <linux/vhost.h> properly */ +/* For VHOST_SCSI_SET_ENDPOINT/VHOST_SCSI_CLEAR_ENDPOINT ioctl */ +struct vhost_scsi_target { +int abi_version; +char vhost_wwpn[224 ]; +unsigned short vhost_tpgt; +unsigned short reserved; +}; + +enum vhost_scsi_vq_list { +VHOST_SCSI_VQ_CTL =0 , +VHOST_SCSI_VQ_EVT =1 , +VHOST_SCSI_VQ_IO =2 , +VHOST_SCSI_VQ_NUM =3 , +}; + +#define VHOST_VIRTIO 0xAF +#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, int) + +extern PropertyInfo qdev_prop_vhost_scsi; + +#define DEFINE_PROP_VHOST_SCSI (_n, _s, _f) \ + DEFINE_PROP(_n, _s, _f, qdev_prop_vhost_scsi, VHostSCSI*) + +VHostSCSI *find_vhost_scsi (const char *id); +const char *vhost_scsi_get_id (VHostSCSI *vs); +VHostSCSI *vhost_scsi_add_opts (QemuOpts *opts); +int vhost_scsi_start (VHostSCSI *vs,VirtIODevice *vdev); +void vhost_scsi_stop (VHostSCSI *vs,VirtIODevice *vdev); + +#endif qemu-common.h +1
-0@@ -280,6 +280,7 @@ typedef struct EventNotifier EventNotifier;typedef struct VirtIODevice VirtIODevice ;typedef struct QEMUSGList QEMUSGList ;typedef struct SHPCDevice SHPCDevice ; +typedef struct VHostSCSI VHostSCSI ;typedef uint64_t pcibus_t ;qemu-config.c +19
-0@@ -626,6 +626,24 @@ QemuOptsList qemu_boot_opts = { }, }; +QemuOptsList qemu_vhost_scsi_opts = { + .name ="vhost-scsi" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_vhost_scsi_opts.head), + .desc = { + { + .name ="wwpn" , + .type =QEMU_OPT_STRING , + }, { + .name ="tpgt" , + .type =QEMU_OPT_NUMBER , + }, { + .name ="vhostfd" , + .type =QEMU_OPT_STRING , + }, + {/* end of list */ } + }, +}; +static QemuOptsList *vm_config_groups[32 ] = { &qemu_drive_opts, &qemu_chardev_opts,@@ -641,6 +659,7 @@ static QemuOptsList *vm_config_groups[32] = { &qemu_machine_opts, &qemu_boot_opts, &qemu_iscsi_opts, + &qemu_vhost_scsi_opts, NULL, };qemu-options.hx +4
-0@@ -565,6 +565,10 @@ possible drivers and properties, use @code{-device ?} and ETEXI DEFHEADING() +DEF("vhost-scsi", HAS_ARG, QEMU_OPTION_vhost_scsi, + "-vhost-scsi wwpn=string0,tpgt=number0\n" + " add vhost-scsi device\n", + QEMU_ARCH_ALL) DEFHEADING(File system options:)vl.c +18
-0@@ -144,6 +144,7 @@ int main(int argc, char **argv)#include "qemu-options.h" #include "qmp-commands.h" #include "main-loop.h" +#include "hw/vhost-scsi.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" #endif @@ -1858,6 +1859,14 @@ static int fsdev_init_func(QemuOpts *opts, void *opaque) }#endif +static int vhost_scsi_init_func (QemuOpts *opts,void *opaque) +{ +if (!vhost_scsi_add_opts (opts)) { +return -1 ; + } +return 0 ; +} +static int mon_init_func (QemuOpts *opts,void *opaque) {CharDriverState *chr;@@ -2617,6 +2626,11 @@ int main(int argc, char **argv, char **envp) }break ;#endif +case QEMU_OPTION_vhost_scsi: +if (!qemu_opts_parse (qemu_find_opts ("vhost-scsi" ), optarg,0 )) { +exit (1 ); + } +break ;#ifdef CONFIG_SLIRP case QEMU_OPTION_tftp: legacy_tftp_prefix = optarg;@@ -3337,6 +3351,10 @@ int main(int argc, char **argv, char **envp) exit(1); }#endif +if (qemu_opts_foreach (qemu_find_opts ("vhost-scsi" ), + vhost_scsi_init_func,NULL ,1 )) { +exit (1 ); + }os_daemonize ();Signature · 1 line
1.7.2.5
RFC v3 3/5 vhost-scsi: add -vhost-scsi host device for use with tcm-vhost
In reply to Nicholas A. BellingerFrom: Stefan Hajnoczi <[email protected]>
This patch adds a new type of host device that drives the vhost_scsi device. The syntax to add vhost-scsi is:
qemu -vhost-scsi id=vhost-scsi0,wwpn=...,tpgt=123
The virtio-scsi emulated device will make use of vhost-scsi to process virtio-scsi requests inside the kernel and hand them to the in-kernel SCSI target stack using the tcm_vhost fabric driver.
The tcm_vhost driver was merged into the upstream linux kernel for 3.6-rc2, and the commit can be found here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=057cbf49a1f08297
Changelog v2 -> v3:
- Move qdev_prop_vhost_scsi + DEFINE_PROP_VHOST_SCSI defs into vhost-scsi.[c,h] (reported by MST)
- Add enum vhost_scsi_vq_list for VHostSCSI->vqs[] enumeration (reported by MST)
- Add missing braces around single like if statement to following QEMU style (reported by Blue Swirl)
- Change vhost_scsi_target->vhost_wwpn to char *, in order to drop casts to pstrcpy in vhost_scsi_start() + vhost_scsi_stop() (reported by Blue Swirl)
- Change VHOST_SCSI_GET_ABI_VERSION to 'int' type (MST)
- Fix 4 byte alignment of vhost_scsi_target (MST)
- Convert fprintf(stderr, ...) usage to -> error_report() (reported by MST)
- Do explict memset of backend before calling VHOST_SCSI_CLEAR_ENDPOINT in vhost_scsi_stop() (reported by MST)
- Add support for vhostfd passing in vhost_scsi_add() (reported by MST)
- Change vhost_scsi_add() to use monitor_handle_fd_param() (reported by MST)
Changelog v1 -> v2:
- Expose ABI version via VHOST_SCSI_GET_ABI_VERSION + use Rev 0 as starting point for v3.6-rc code (Stefan + ALiguori + nab)
- Fix upstream qemu conflict in hw/qdev-properties.c
- Make GET_ABI_VERSION use int (nab + mst)
- Fix vhost-scsi case lables in configure (reported by paolo)
- Convert qdev_prop_vhost_scsi to use ->get() + ->set() following qdev_prop_netdev (reported by paolo)
- Fix typo in qemu-options.hx definition of vhost-scsi (reported by paolo)
Changelog v0 -> v1:
- Add VHOST_SCSI_SET_ENDPOINT call (stefan)
- Enable vhost notifiers for multiple queues (Zhi)
- clear vhost-scsi endpoint on stopped (Zhi)
- Add CONFIG_VHOST_SCSI for QEMU build configure (nab)
- Rename vhost_vring_target -> vhost_scsi_target (mst + nab)
- Add support for VHOST_SCSI_GET_ABI_VERSION ioctl (aliguori + nab)
--- configure | 10 +++ hw/Makefile.objs | 1 + hw/qdev-properties.c | 41 +++++++++++ hw/vhost-scsi.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/vhost-scsi.h | 62 ++++++++++++++++ qemu-common.h | 1 + qemu-config.c | 19 +++++ qemu-options.hx | 4 + vl.c | 18 +++++ 9 files changed, 346 insertions(+), 0 deletions(-) create mode 100644 hw/vhost-scsi.c create mode 100644 hw/vhost-scsi.h
configure +10 -0
@@ -168,6 +168,7 @@ libattr="" xfs="" vhost_net="no" +vhost_scsi="no" kvm="no" gprof="no" debug_tcg="no"
@@ -513,6 +514,7 @@ Haiku) usb="linux" kvm="yes" vhost_net="yes" + vhost_scsi="yes" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then audio_possible_drivers="$audio_possible_drivers fmod" fi
@@ -818,6 +820,10 @@ for opt do ;; --enable-vhost-net) vhost_net="yes" ;; + --disable-vhost-scsi) vhost_scsi="no" + ;; + --enable-vhost-scsi) vhost_scsi="yes" + ;; --disable-opengl) opengl="no" ;; --enable-opengl) opengl="yes"
@@ -3116,6 +3122,7 @@ echo "posix_madvise $posix_madvise" echo "uuid support $uuid" echo "libcap-ng support $cap_ng" echo "vhost-net support $vhost_net" +echo "vhost-scsi support $vhost_scsi" echo "Trace backend $trace_backend" echo "Trace output file $trace_file-<pid>" echo "spice support $spice"
@@ -3828,6 +3835,9 @@ case "$target_arch2" in if test "$vhost_net" = "yes" ; then echo "CONFIG_VHOST_NET=y" >> $config_target_mak fi + if test "$vhost_scsi" = "yes" ; then + echo "CONFIG_VHOST_SCSI=y" >> $config_target_mak + fi fi esac case "$target_arch2" in
hw/Makefile.objs +1 -0
@@ -169,6 +169,7 @@ obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o obj-$(CONFIG_VIRTIO) += virtio-serial-bus.o virtio-scsi.o obj-$(CONFIG_SOFTMMU) += vhost_net.o obj-$(CONFIG_VHOST_NET) += vhost.o +obj-$(CONFIG_VHOST_SCSI) += vhost-scsi.o obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/ obj-$(CONFIG_NO_PCI) += pci-stub.o obj-$(CONFIG_VGA) += vga.o
hw/qdev-properties.c +41 -0
53 lines not on this page · raw message
hw/vhost-scsi.c new file +190 -0
190 lines not on this page · raw message
hw/vhost-scsi.h new file +62 -0
62 lines not on this page · raw message
qemu-common.h +1 -0
@@ -280,6 +280,7 @@ typedef struct EventNotifier EventNotifier;typedef struct VirtIODevice VirtIODevice ;typedef struct QEMUSGList QEMUSGList ;typedef struct SHPCDevice SHPCDevice ; +typedef struct VHostSCSI VHostSCSI ;typedef uint64_t pcibus_t ;
qemu-config.c +19 -0
@@ -626,6 +626,24 @@ QemuOptsList qemu_boot_opts = { }, }; +QemuOptsList qemu_vhost_scsi_opts = { + .name ="vhost-scsi" , + .head =QTAILQ_HEAD_INITIALIZER (qemu_vhost_scsi_opts.head), + .desc = { + { + .name ="wwpn" , + .type =QEMU_OPT_STRING , + }, { + .name ="tpgt" , + .type =QEMU_OPT_NUMBER , + }, { + .name ="vhostfd" , + .type =QEMU_OPT_STRING , + }, + {/* end of list */ } + }, +}; +static QemuOptsList *vm_config_groups[32 ] = { &qemu_drive_opts, &qemu_chardev_opts,
@@ -641,6 +659,7 @@ static QemuOptsList *vm_config_groups[32] = { &qemu_machine_opts, &qemu_boot_opts, &qemu_iscsi_opts, + &qemu_vhost_scsi_opts, NULL, };
qemu-options.hx +4 -0
@@ -565,6 +565,10 @@ possible drivers and properties, use @code{-device ?} and ETEXI DEFHEADING() +DEF("vhost-scsi", HAS_ARG, QEMU_OPTION_vhost_scsi, + "-vhost-scsi wwpn=string0,tpgt=number0\n" + " add vhost-scsi device\n", + QEMU_ARCH_ALL) DEFHEADING(File system options:)
vl.c +18 -0
@@ -144,6 +144,7 @@ int main(int argc, char **argv)#include "qemu-options.h" #include "qmp-commands.h" #include "main-loop.h" +#include "hw/vhost-scsi.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" #endif
@@ -1858,6 +1859,14 @@ static int fsdev_init_func(QemuOpts *opts, void *opaque) }#endif +static int vhost_scsi_init_func (QemuOpts *opts,void *opaque) +{ +if (!vhost_scsi_add_opts (opts)) { +return -1 ; + } +return 0 ; +} +static int mon_init_func (QemuOpts *opts,void *opaque) {CharDriverState *chr;
@@ -2617,6 +2626,11 @@ int main(int argc, char **argv, char **envp) }break ;#endif +case QEMU_OPTION_vhost_scsi: +if (!qemu_opts_parse (qemu_find_opts ("vhost-scsi" ), optarg,0 )) { +exit (1 ); + } +break ;#ifdef CONFIG_SLIRP case QEMU_OPTION_tftp: legacy_tftp_prefix = optarg;
@@ -3337,6 +3351,10 @@ int main(int argc, char **argv, char **envp) exit(1); }#endif +if (qemu_opts_foreach (qemu_find_opts ("vhost-scsi" ), + vhost_scsi_init_func,NULL ,1 )) { +exit (1 ); + }os_daemonize ();
Signature · 1 line
1.7.2.5
RFC v3 4/5 virtio-scsi: Add start/stop functionality for vhost-scsi
In reply to Nicholas A. BellingerFrom: Stefan Hajnoczi <[email protected]>
This patch starts and stops vhost as the virtio device transitions through its status phases. Vhost can only be started once the guest reports its driver has successfully initialized, which means the virtqueues have been set up by the guest.
v3: - Add vhost-scsi.h include for DEFINE_PROP_VHOST_SCSI (mst + nab)
- Move vhost-scsi related struct members ahead of *cmd_vqs[0] within VirtIOSCSI definition. (paolo + nab)
v2: - Squash virtio-scsi: use the vhost-scsi host device from stefan (nab)
- Fix up virtio_scsi_properties[] conflict w/ upstream qemu (nab)
- Drop usage of to_virtio_scsi() in virtio_scsi_set_status() (reported by paolo)
- Use modern VirtIOSCSIConf define in virtio-scsi.h (reported by paolo)
- Use s->conf->vhost_scsi instead of proxyconf->vhost_scsi in virtio_scsi_init() (reported by paolo)
- Only register QEMU SCSI bus is vhost-scsi is not active (reported by paolo)
--- hw/virtio-pci.c | 2 ++ hw/virtio-scsi.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/virtio-scsi.h | 1 + 3 files changed, 52 insertions(+), 0 deletions(-)
hw/virtio-pci.c +2 -0
@@ -22,6 +22,7 @@#include "virtio-net.h" #include "virtio-serial.h" #include "virtio-scsi.h" +#include "vhost-scsi.h" #include "pci.h" #include "qemu-error.h" #include "msi.h"
@@ -1036,6 +1037,7 @@ static void virtio_scsi_exit_pci(PCIDevice *pci_dev) }static Property virtio_scsi_properties[] = { +DEFINE_PROP_VHOST_SCSI ("vhost-scsi" , VirtIOPCIProxy, scsi.vhost_scsi),DEFINE_PROP_BIT ("ioeventfd" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT , true),DEFINE_PROP_UINT32 ("vectors" , VirtIOPCIProxy, nvectors,DEV_NVECTORS_UNSPECIFIED ),DEFINE_VIRTIO_SCSI_PROPERTIES (VirtIOPCIProxy, host_features, scsi),
hw/virtio-scsi.c +49 -0
87 lines not on this page · raw message
hw/virtio-scsi.h +1 -0
@@ -22,6 +22,7 @@#define VIRTIO_ID_SCSI 8struct VirtIOSCSIConf { +VHostSCSI *vhost_scsi;uint32_t num_queues;uint32_t max_sectors;uint32_t cmd_per_lun;
Signature · 1 line
1.7.2.5
RFC v3 4/5 virtio-scsi: Add start/stop functionality for vhost-scsi
In reply to Nicholas A. BellingerFrom: Stefan Hajnoczi <[email protected]>
This patch starts and stops vhost as the virtio device transitions through its status phases. Vhost can only be started once the guest reports its driver has successfully initialized, which means the virtqueues have been set up by the guest.
v3: - Add vhost-scsi.h include for DEFINE_PROP_VHOST_SCSI (mst + nab)
- Move vhost-scsi related struct members ahead of *cmd_vqs[0] within VirtIOSCSI definition. (paolo + nab)
v2: - Squash virtio-scsi: use the vhost-scsi host device from stefan (nab)
- Fix up virtio_scsi_properties[] conflict w/ upstream qemu (nab)
- Drop usage of to_virtio_scsi() in virtio_scsi_set_status() (reported by paolo)
- Use modern VirtIOSCSIConf define in virtio-scsi.h (reported by paolo)
- Use s->conf->vhost_scsi instead of proxyconf->vhost_scsi in virtio_scsi_init() (reported by paolo)
- Only register QEMU SCSI bus is vhost-scsi is not active (reported by paolo)
--- hw/virtio-pci.c | 2 ++ hw/virtio-scsi.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/virtio-scsi.h | 1 + 3 files changed, 52 insertions(+), 0 deletions(-)
hw/virtio-pci.c +2 -0
@@ -22,6 +22,7 @@#include "virtio-net.h" #include "virtio-serial.h" #include "virtio-scsi.h" +#include "vhost-scsi.h" #include "pci.h" #include "qemu-error.h" #include "msi.h"
@@ -1036,6 +1037,7 @@ static void virtio_scsi_exit_pci(PCIDevice *pci_dev) }static Property virtio_scsi_properties[] = { +DEFINE_PROP_VHOST_SCSI ("vhost-scsi" , VirtIOPCIProxy, scsi.vhost_scsi),DEFINE_PROP_BIT ("ioeventfd" , VirtIOPCIProxy, flags,VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT , true),DEFINE_PROP_UINT32 ("vectors" , VirtIOPCIProxy, nvectors,DEV_NVECTORS_UNSPECIFIED ),DEFINE_VIRTIO_SCSI_PROPERTIES (VirtIOPCIProxy, host_features, scsi),
hw/virtio-scsi.c +49 -0
87 lines not on this page · raw message
hw/virtio-scsi.h +1 -0
@@ -22,6 +22,7 @@#define VIRTIO_ID_SCSI 8struct VirtIOSCSIConf { +VHostSCSI *vhost_scsi;uint32_t num_queues;uint32_t max_sectors;uint32_t cmd_per_lun;
Signature · 1 line
1.7.2.5
RFC v3 5/5 virtio-scsi: Set max_target=0 during vhost-scsi operation
In reply to Nicholas A. BellingerFrom: Nicholas Bellinger <[email protected]>
This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID instance) when connected to individual tcm_vhost endpoints.
This ensures that virtio-scsi LLD only attempts to scan target IDs up to VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw.
--- hw/virtio-scsi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -1
@@ -546,7 +546,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev,stl_raw (&scsiconf->sense_size, s->sense_size);stl_raw (&scsiconf->cdb_size, s->cdb_size);stl_raw (&scsiconf->max_channel,VIRTIO_SCSI_MAX_CHANNEL ); -stl_raw (&scsiconf->max_target,VIRTIO_SCSI_MAX_TARGET ); +if (s->vhost_scsi) { +stl_raw (&scsiconf->max_target,0 ); + }else { +stl_raw (&scsiconf->max_target,VIRTIO_SCSI_MAX_TARGET ); + }stl_raw (&scsiconf->max_lun,VIRTIO_SCSI_MAX_LUN ); }
Signature · 1 line
1.7.2.5
RFC v3 5/5 virtio-scsi: Set max_target=0 during vhost-scsi operation
In reply to Nicholas A. BellingerFrom: Nicholas Bellinger <[email protected]>
This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID instance) when connected to individual tcm_vhost endpoints.
This ensures that virtio-scsi LLD only attempts to scan target IDs up to VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw.
--- hw/virtio-scsi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
hw/virtio-scsi.c +5 -1
@@ -546,7 +546,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev,stl_raw (&scsiconf->sense_size, s->sense_size);stl_raw (&scsiconf->cdb_size, s->cdb_size);stl_raw (&scsiconf->max_channel,VIRTIO_SCSI_MAX_CHANNEL ); -stl_raw (&scsiconf->max_target,VIRTIO_SCSI_MAX_TARGET ); +if (s->vhost_scsi) { +stl_raw (&scsiconf->max_target,0 ); + }else { +stl_raw (&scsiconf->max_target,VIRTIO_SCSI_MAX_TARGET ); + }stl_raw (&scsiconf->max_lun,VIRTIO_SCSI_MAX_LUN ); }
Signature · 1 line
1.7.2.5
Michael S. Tsirkin
maintainerQuoted 9 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1 to support the upstream
tcm_vhosthost virtualized target driver now available in v3.6-rc kernel code. This series is based upon last week's commit346fe0c4c0b, and is aiming for a future QEMU v1.3 merge.
Quoted 7 lines
The patch series is available directly from:
git://git.kernel.org/pub/scm/virt/kvm/nab/qemu-kvm.gitvhost-scsi-merge-v3This -v3 series contains further review changes based upon feedback from MST, Paolo, and Blue. It also contains the changes to function against the changes in target-pending/master -> headed for v3.6-rc3 code.
ACK series. Paolo can you ack virtio-scsi changes please? Nicholas, do you want me to take this through my tree?
Quoted 83 lines
Changes from v3 -> v2:
- Move
qdev_prop_vhost_scsi+DEFINE_PROP_VHOST_SCSIdefs into vhost-scsi.[c,h] (reported by MST)
- Add enumvhost_scsi_vq_listfor VHostSCSI->vqs[] enumeration (reported by MST)
- Add missing braces around single like if statement to following QEMU style (reported by Blue Swirl)
- Changevhost_scsi_target->vhost_wwpnto char *, in order to drop casts to pstrcpy invhost_scsi_start()+vhost_scsi_stop()(reported by Blue Swirl)
- ChangeVHOST_SCSI_GET_ABI_VERSIONto 'int' type (MST)
- Addvhost-scsi.hinclude forDEFINE_PROP_VHOST_SCSI(mst + nab)
- Move vhost-scsi related struct members ahead of *cmd_vqs[0] within VirtIOSCSI definition. (paolo + nab)
- Fix 4 byte alignment ofvhost_scsi_target(MST)
- Convertfprintf(stderr, ...)usage to ->error_report()(reported by MST)
- Do explict memset of backend before callingVHOST_SCSI_CLEAR_ENDPOINTinvhost_scsi_stop()(reported by MST)
- Add support for vhostfd passing invhost_scsi_add()(reported by MST)
- Movenet_handle_fd_param()->monitor_handle_fd_param()for generic usage bynet/+ vhost-scsi (reported by MST)
- Changevhost_scsi_add()to usemonitor_handle_fd_param()(reported by MST)Changes from v1 -> v2:
- Expose ABI version via
VHOST_SCSI_GET_ABI_VERSION+ use Rev 0 as starting point for v3.6-rc code (Stefan + ALiguori + nab)
- Fix upstream qemu conflict inhw/qdev-properties.c
- MakeGET_ABI_VERSIONuse int (nab + mst)
- Drop unnecessary event-notifier changes (nab)
- Fix vhost-scsi case lables in configure (reported by paolo)
- Convertqdev_prop_vhost_scsito use ->get() + ->set() followingqdev_prop_netdev(reported by paolo)
- Fix typo in qemu-options.hx definition of vhost-scsi (reported by paolo)
- Squash virtio-scsi: use the vhost-scsi host device from stefan (nab)
- Fix up virtio_scsi_properties[] conflict w/ upstream qemu (nab)
- Drop usage ofto_virtio_scsi()invirtio_scsi_set_status()(reported by paolo)
- Use modern VirtIOSCSIConf define invirtio-scsi.h(reported by paolo)
- Uses->conf->vhost_scsiinstead ofproxyconf->vhost_scsiinvirtio_scsi_init()(reported by paolo)
- Only register QEMU SCSI bus is vhost-scsi is not active (reported by paolo)
- Fix incorrect VirtIOSCSI->cmd_vqs[0] definition (nab)Thanks again to everyone who has been reviewing this series!
--nab
Nicholas Bellinger (2):
monitor: Rename+movenet_handle_fd_param->monitor_handle_fd_param
virtio-scsi: Set max_target=0 during vhost-scsi operationStefan Hajnoczi (3):
vhost: Pass device path tovhost_dev_init()
vhost-scsi: add -vhost-scsi host device for use with tcm-vhost
virtio-scsi: Add start/stop functionality for vhost-scsiconfigure | 10 +++ hw/Makefile.objs | 1 + hw/qdev-properties.c | 41 +++++++++++ hw/vhost-scsi.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++ hw/vhost-scsi.h | 62 ++++++++++++++++ hw/vhost.c | 5 +- hw/vhost.h | 3 +- hw/vhost_net.c | 2 +- hw/virtio-pci.c | 2 + hw/virtio-scsi.c | 55 ++++++++++++++- hw/virtio-scsi.h | 1 + monitor.c | 18 +++++ monitor.h | 1 + net.c | 18 ----- net.h | 2 - net/socket.c | 2 +- net/tap.c | 4 +- qemu-common.h | 1 + qemu-config.c | 19 +++++ qemu-options.hx | 4 + vl.c | 18 +++++ 21 files changed, 431 insertions(+), 28 deletions(-) create mode 100644 hw/vhost-scsi.c create mode 100644 hw/vhost-scsi.hSignature · 1 line
1.7.2.5
Michael S. Tsirkin
maintainerQuoted 5 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1
I rebased on top of 1.2 and put this in my tree:git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git pci
Please check it out, meanwhile we'll see if anyone complains.
Signature · 1 line
MST
Michael S. Tsirkin
maintainerQuoted 11 lines · Michael S. Tsirkin
Quoted 5 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1
I rebased on top of 1.2 and put this in my tree:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gitpciPlease check it out, meanwhile we'll see if anyone complains.
OK I will be the first :).
Looks like build *without* CONFIG_VHOST_SCSI
is broken now:
LINK sparc64-softmmu/qemu-system-sparc64../hw/qdev-properties.o: In function `parse_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:706: undefined reference to `find_vhost_scsi'../hw/qdev-properties.o: In function `print_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:719: undefined reference to `vhost_scsi_get_id'../libhw64/vl.o: In function `vhost_scsi_init_func':
/scm/qemu/vl.c:1943: undefined reference to vhost_scsi_add_opts' hw/virtio-scsi.o: In function virtio_scsi_set_status':
/scm/qemu/hw/virtio-scsi.c:733: undefined reference to vhost_scsi_stop' /scm/qemu/hw/virtio-scsi.c:724: undefined reference to vhost_scsi_start'
Please add stubs *and test* without CONFIG_VHOST_SCSI.
While at it can we please rename file to vhost_scsi.c, vhost_scsi.h? qemu is inconsistent but vhost files all use _ as separator:
this means function names and file names are in sync.
Reverted for now, waiting for v4.
Thanks!
Quoted 2 lines
Signature · 1 line
MST
Michael S. Tsirkin
maintainerQuoted 30 lines · Michael S. Tsirkin
Quoted 11 lines · Michael S. Tsirkin
Quoted 5 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1
I rebased on top of 1.2 and put this in my tree:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gitpciPlease check it out, meanwhile we'll see if anyone complains.
OK I will be the first :).
Looks like build *without*CONFIG_VHOST_SCSI
is broken now:
LINK sparc64-softmmu/qemu-system-sparc64../hw/qdev-properties.o: In function `parse_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:706: undefined reference to `find_vhost_scsi'../hw/qdev-properties.o: In function `print_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:719: undefined reference to `vhost_scsi_get_id'../libhw64/vl.o: In function `vhost_scsi_init_func':
/scm/qemu/vl.c:1943: undefined reference tovhost_scsi_add_opts' hw/virtio-scsi.o: In functionvirtio_scsi_set_status':
/scm/qemu/hw/virtio-scsi.c:733: undefined reference tovhost_scsi_stop' /scm/qemu/hw/virtio-scsi.c:724: undefined reference tovhost_scsi_start'
Quoted 7 lines
Please add stubs *and test* without
CONFIG_VHOST_SCSI.While at it can we please rename file to
vhost_scsi.c,vhost_scsi.h? qemu is inconsistent but vhost files all use _ as separator:
this means function names and file names are in sync.Reverted for now, waiting for v4.
Please note vhost, net and monitor changes are all merged. That's patches 1/5 and 2/5.
Quoted 4 lines
Thanks!
Quoted 2 lines
Signature · 1 line
MST
Quoted 33 lines · Michael S. Tsirkin
Quoted 32 lines · Michael S. Tsirkin
Quoted 11 lines · Michael S. Tsirkin
Quoted 5 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1
I rebased on top of 1.2 and put this in my tree:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gitpciPlease check it out, meanwhile we'll see if anyone complains.
OK I will be the first :).
Looks like build *without*CONFIG_VHOST_SCSI
is broken now:
LINK sparc64-softmmu/qemu-system-sparc64../hw/qdev-properties.o: In function `parse_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:706: undefined reference to `find_vhost_scsi'../hw/qdev-properties.o: In function `print_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:719: undefined reference to `vhost_scsi_get_id'../libhw64/vl.o: In function `vhost_scsi_init_func':
/scm/qemu/vl.c:1943: undefined reference tovhost_scsi_add_opts' hw/virtio-scsi.o: In functionvirtio_scsi_set_status':
/scm/qemu/hw/virtio-scsi.c:733: undefined reference tovhost_scsi_stop' /scm/qemu/hw/virtio-scsi.c:724: undefined reference tovhost_scsi_start'Please add stubs *and test* without
CONFIG_VHOST_SCSI.
Quoted 8 lines
Quoted 5 lines
While at it can we please rename file to
vhost_scsi.c,vhost_scsi.h? qemu is inconsistent but vhost files all use _ as separator:
this means function names and file names are in sync.Reverted for now, waiting for v4.
Please note vhost, net and monitor changes are all merged. That's patches 1/5 and 2/5.
Hi MST!
Looks like we just cross emails here within 10 mins here..
I'm happy to respin a PATCH and/or GIT PULL request minus 1-2 depending on the vhost-scsi workflow that ALiguori is comfortable with here.
Thank you!
--nab
Quoted 33 lines · Michael S. Tsirkin
Quoted 32 lines · Michael S. Tsirkin
Quoted 11 lines · Michael S. Tsirkin
Quoted 5 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1
I rebased on top of 1.2 and put this in my tree:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gitpciPlease check it out, meanwhile we'll see if anyone complains.
OK I will be the first :).
Looks like build *without*CONFIG_VHOST_SCSI
is broken now:
LINK sparc64-softmmu/qemu-system-sparc64../hw/qdev-properties.o: In function `parse_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:706: undefined reference to `find_vhost_scsi'../hw/qdev-properties.o: In function `print_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:719: undefined reference to `vhost_scsi_get_id'../libhw64/vl.o: In function `vhost_scsi_init_func':
/scm/qemu/vl.c:1943: undefined reference tovhost_scsi_add_opts' hw/virtio-scsi.o: In functionvirtio_scsi_set_status':
/scm/qemu/hw/virtio-scsi.c:733: undefined reference tovhost_scsi_stop' /scm/qemu/hw/virtio-scsi.c:724: undefined reference tovhost_scsi_start'Please add stubs *and test* without
CONFIG_VHOST_SCSI.
Quoted 8 lines
Quoted 5 lines
While at it can we please rename file to
vhost_scsi.c,vhost_scsi.h? qemu is inconsistent but vhost files all use _ as separator:
this means function names and file names are in sync.Reverted for now, waiting for v4.
Please note vhost, net and monitor changes are all merged. That's patches 1/5 and 2/5.
Hi MST!
Looks like we just cross emails here within 10 mins here..
I'm happy to respin a PATCH and/or GIT PULL request minus 1-2 depending on the vhost-scsi workflow that ALiguori is comfortable with here.
Thank you!
--nab
Michael S. Tsirkin
maintainerQuoted 11 lines · Michael S. Tsirkin
Quoted 5 lines · Nicholas A. Bellinger
From: Nicholas Bellinger <[email protected]>
Hi folks,
This is the third RFC for vhost-scsi patches against mainline QEMU v1.1
I rebased on top of 1.2 and put this in my tree:
git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.gitpciPlease check it out, meanwhile we'll see if anyone complains.
OK I will be the first :).
Looks like build *without* CONFIG_VHOST_SCSI
is broken now:
LINK sparc64-softmmu/qemu-system-sparc64../hw/qdev-properties.o: In function `parse_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:706: undefined reference to `find_vhost_scsi'../hw/qdev-properties.o: In function `print_vhost_scsi_dev':
/scm/qemu/hw/qdev-properties.c:719: undefined reference to `vhost_scsi_get_id'../libhw64/vl.o: In function `vhost_scsi_init_func':
/scm/qemu/vl.c:1943: undefined reference to vhost_scsi_add_opts' hw/virtio-scsi.o: In function virtio_scsi_set_status':
/scm/qemu/hw/virtio-scsi.c:733: undefined reference to vhost_scsi_stop' /scm/qemu/hw/virtio-scsi.c:724: undefined reference to vhost_scsi_start'
Please add stubs *and test* without CONFIG_VHOST_SCSI.
While at it can we please rename file to vhost_scsi.c, vhost_scsi.h? qemu is inconsistent but vhost files all use _ as separator:
this means function names and file names are in sync.
Reverted for now, waiting for v4.
Thanks!
Quoted 2 lines
Signature · 1 line
MST