Thanks for helping the example code clean-up. I can rebase the vhost-user-blk patch set after your commits. For the issue you mentioned below, I think the vhost-user-scsi example can only support 1 LUN, so LUN0 is exist, LUN1 reported error should be okay.
> -----Original Message----- > From: Marc-André Lureau [mailto:marcandre.lur...@redhat.com] > Sent: Thursday, August 24, 2017 12:20 AM > To: qemu-devel@nongnu.org > Cc: Liu, Changpeng <changpeng....@intel.com>; fel...@nutanix.com; Marc-André > Lureau <marcandre.lur...@redhat.com> > Subject: [PATCH 00/27] vhost-user-scsi: code clean-up > > Hi, > > While reviewing vhost-user-blk, I realized a lot of code was based on > vhost-user-scsi, and I found a number of improvements could be > made. As a result in this series, I tried to move common glib code in > libvhost-user-glib. (I originally made libvhost-user glib-free, so if > external projects want to play with it, they don't have to depend on > glib, for ex vhost-user-bridge doesn't use glib). > > I haven't done extensive testing, I tried to setup a LUN with help > from https://fedoraproject.org/wiki/Scsi-target-utils_Quickstart_Guide, but > the guest says "Unexpected response from lun 1 while scanning, scan > aborted" (before or after the series). Help welcome! > > Thanks > > Marc-André Lureau (27): > glib-compat: move G_SOURCE_CONTINUE/REMOVE there > libvhost-user: drop dependency on glib > libvhost-user: improve vu_queue_pop() doc > vhost-user-scsi: use g_strdup() > vhost-user-scsi: connect unix socket before allocating > vhost-user-scsi: code style fixes > vhost-user-scsi: use glib allocation > vhost-user-scsi: glib calls that allocate don't return NULL > vhost-user-scsi: also free the gtree > vhost-user-scsi: remove vdev_scsi_find_by_vu() > vhost-user-scsi: simplify unix path cleanup > vhost-user-scsi: use NULL pointer > vhost-user-scsi: use glib watch directly > vhost-user-scsi: assert() in iscsi_add_lun() > vhost-user-scsi: remove vdev_scsi_add_iscsi_lun() > vhost-user-scsi: remove VUS_MAX_LUNS > vhost-user-scsi: remove unimplemented functions > vhost-user-scsi: rename VUS types > vhost-user-scsi: avoid use of iscsi_ namespace > vhost-user-scsi: don't copy iscsi/scsi-lowlevel.h > vhost-user-scsi: drop extra callback pointer > vhost-user-scsi: simplify source handling > vhost-user-scsi: use glib logging > libvhost-user: add glib source helper > build-sys: fix libvhost-user.a build > vhost-user-scsi: use libvhost-user glib helper > vhost-user-scsi: remove server_sock from VusDev > > contrib/libvhost-user/libvhost-user-glib.h | 32 ++ > contrib/libvhost-user/libvhost-user.h | 3 +- > include/glib-compat.h | 7 + > contrib/libvhost-user/libvhost-user-glib.c | 145 +++++++ > contrib/libvhost-user/libvhost-user.c | 25 +- > contrib/vhost-user-scsi/vhost-user-scsi.c | 619 > +++++------------------------ > Makefile | 3 +- > Makefile.objs | 3 +- > contrib/libvhost-user/Makefile.objs | 2 +- > tests/Makefile.include | 2 +- > 10 files changed, 320 insertions(+), 521 deletions(-) > create mode 100644 contrib/libvhost-user/libvhost-user-glib.h > create mode 100644 contrib/libvhost-user/libvhost-user-glib.c > > -- > 2.14.1.146.gd35faa819