From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNoIs-0007Ke-1C for qemu-devel@nongnu.org; Thu, 14 Jul 2016 17:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNoIq-0000We-Vf for qemu-devel@nongnu.org; Thu, 14 Jul 2016 17:36:17 -0400 References: <1468502894-18098-1-git-send-email-kwolf@redhat.com> <1468502894-18098-12-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <578805C8.2070904@redhat.com> Date: Thu, 14 Jul 2016 15:36:08 -0600 MIME-Version: 1.0 In-Reply-To: <1468502894-18098-12-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4CQLmXOxd5vLKn3pHWkmhISb3oickve68" Subject: Re: [Qemu-devel] [PATCH v4 11/11] nbd-server: Allow node name for nbd-server-add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, berto@igalia.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4CQLmXOxd5vLKn3pHWkmhISb3oickve68 From: Eric Blake To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, berto@igalia.com, qemu-devel@nongnu.org Message-ID: <578805C8.2070904@redhat.com> Subject: Re: [PATCH v4 11/11] nbd-server: Allow node name for nbd-server-add References: <1468502894-18098-1-git-send-email-kwolf@redhat.com> <1468502894-18098-12-git-send-email-kwolf@redhat.com> In-Reply-To: <1468502894-18098-12-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/14/2016 07:28 AM, Kevin Wolf wrote: > There is no reason why an NBD server couldn't be started for any node, > even if it's not on the top level. This converts nbd-server-add to > accept a node-name. >=20 > Note that there is a semantic difference between using a BlockBackend > name and the node name of its root: In the former case, the NBD server > is closed on eject; in the latter case, the NBD server doesn't drop its= > reference and keeps the image file open this way. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev-nbd.c | 21 +++++++++------------ > qapi/block.json | 4 ++-- > 2 files changed, 11 insertions(+), 14 deletions(-) >=20 > diff --git a/blockdev-nbd.c b/blockdev-nbd.c > index c437d32..ca41cc6 100644 > --- a/blockdev-nbd.c > +++ b/blockdev-nbd.c > @@ -145,7 +145,8 @@ void qmp_nbd_server_start(SocketAddress *addr, > void qmp_nbd_server_add(const char *device, bool has_writable, bool wr= itable, > Error **errp) > { > - BlockBackend *blk; > + BlockDriverState *bs =3D NULL; > + BlockBackend *on_eject_blk; > NBDExport *exp; > =20 > if (!nbd_server) { > @@ -158,26 +159,22 @@ void qmp_nbd_server_add(const char *device, bool = has_writable, bool writable, > return; Do we want to do any sanity checking that writing should only be permitted on a root, and that when using a node name that is not a root that writable must be false so as not to negatively change the BDS out of under the feet of the other root? Do op-blockers already cover that? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4CQLmXOxd5vLKn3pHWkmhISb3oickve68 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXiAXIAAoJEKeha0olJ0NqwHMH/3mOvlTIalQ7DivRozr57B03 zY80wo0FTwoS1RCNkClIwCGaS00TIbfBIprdr6xH7P20+UYiYJviCSMdbslwi4PN 5h5ccqKq2ru0AdI/47SJlisOb+s0BDhKd3pYZdH2xISljtPozHRnqBc7jRdy/oV9 NOXkjXmADFYMVBJ1HjLj1kNsZa+xlrPQLsXpDxXG/HPVWsYLSMCoSw4G42GYOn4n V4+G/a+hEdsfF/L3EkQANi2ds+N8wQ5PlfNzNLSTw46K+wO9ndGhEmRrzR5MwsfO elc3nfw/oQp098zOqssCKxvZwxxEGVhAu3XE00KYleCSVT3vEKlikGglfeA5JgA= =WW5S -----END PGP SIGNATURE----- --4CQLmXOxd5vLKn3pHWkmhISb3oickve68--