From patchwork Tue Sep 19 16:51:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 815704 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xxV3K3k59z9ryr for ; Wed, 20 Sep 2017 03:19:09 +1000 (AEST) Received: from localhost ([::1]:44236 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duMAt-0002qI-Je for incoming@patchwork.ozlabs.org; Tue, 19 Sep 2017 13:19:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLlF-00051v-D4 for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:52:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLlA-0001Cx-US for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:52:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLlA-0001CN-Ls for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:52:32 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9500481DF1; Tue, 19 Sep 2017 16:52:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9500481DF1 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com Received: from localhost (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2236B5C542; Tue, 19 Sep 2017 16:52:27 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 18:51:59 +0200 Message-Id: <20170919165226.23022-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 19 Sep 2017 16:52:31 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 00/27] vhost-user-scsi: code clean-up X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, felipe@nutanix.com, changpeng.liu@intel.com, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , f4bug@amsat.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 v2: - patch 3, 25, 26 missing review - drop giochannel patch, use libvhost-user-glib helper instead - misc style changes - comments improvements - fix vus dependency on libvhost-user.a Marc-André Lureau (27): glib-compat: move G_SOURCE_CONTINUE/REMOVE there build-sys: fix libvhost-user.a build build-sys: make vhost-user-scsi depend on libvhost-user.a 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: 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 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 | 154 +++++++ contrib/libvhost-user/libvhost-user.c | 29 +- contrib/vhost-user-scsi/vhost-user-scsi.c | 629 +++++------------------------ Makefile | 5 +- Makefile.objs | 1 - contrib/libvhost-user/Makefile.objs | 2 +- tests/Makefile.include | 2 +- 10 files changed, 316 insertions(+), 548 deletions(-) create mode 100644 contrib/libvhost-user/libvhost-user-glib.h create mode 100644 contrib/libvhost-user/libvhost-user-glib.c