Received: from eggs.gnu.org ([2001:4830:134:3::10]:42382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUu9z-0005aJ-Vl for qemu-devel@nongnu.org; Wed, 03 Aug 2016 07:16:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUu9y-00052O-U5 for qemu-devel@nongnu.org; Wed, 03 Aug 2016 07:16:27 -0400 References: <1468502894-18098-1-git-send-email-kwolf@redhat.com> <1468502894-18098-10-git-send-email-kwolf@redhat.com> <273082a0-2b5f-f0a6-2d66-bb5415ccbd39@redhat.com> <20160802161912.GB5421@noname.redhat.com> From: Max Reitz Message-ID: <5b731569-44fb-824c-fb9a-24103604334a@redhat.com> Date: Wed, 3 Aug 2016 13:16:14 +0200 MIME-Version: 1.0 In-Reply-To: <20160802161912.GB5421@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pbkVHkdIDt1PaxQApcUKhQhDOQinbWU8v" Subject: Re: [Qemu-devel] [PATCH v4 09/11] block: Accept node-name for drive-mirror List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, eblake@redhat.com, berto@igalia.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pbkVHkdIDt1PaxQApcUKhQhDOQinbWU8v From: Max Reitz To: Kevin Wolf Cc: qemu-block@nongnu.org, eblake@redhat.com, berto@igalia.com, qemu-devel@nongnu.org Message-ID: <5b731569-44fb-824c-fb9a-24103604334a@redhat.com> Subject: Re: [PATCH v4 09/11] block: Accept node-name for drive-mirror References: <1468502894-18098-1-git-send-email-kwolf@redhat.com> <1468502894-18098-10-git-send-email-kwolf@redhat.com> <273082a0-2b5f-f0a6-2d66-bb5415ccbd39@redhat.com> <20160802161912.GB5421@noname.redhat.com> In-Reply-To: <20160802161912.GB5421@noname.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 02.08.2016 18:19, Kevin Wolf wrote: > Am 18.07.2016 um 16:30 hat Max Reitz geschrieben: >> On 14.07.2016 15:28, Kevin Wolf wrote: >>> In order to remove the necessity to use BlockBackend names in the >>> external API, we want to allow node-names everywhere. This converts >>> drive-mirror to accept a node-name without lifting the restriction th= at >>> we're operating at a root node. >>> >>> In case of an invalid device name, the command returns the GenericErr= or >>> error class now instead of DeviceNotFound, because this is what >>> qmp_get_root_bs() returns. >>> >>> Signed-off-by: Kevin Wolf >=20 >>> - aio_context =3D blk_get_aio_context(blk); >>> + aio_context =3D bdrv_get_aio_context(bs); >>> aio_context_acquire(aio_context); >>> =20 >>> - if (!blk_is_available(blk)) { >>> - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, device); >>> - goto out; >>> - } >>> - bs =3D blk_bs(blk); >>> if (!has_mode) { >>> mode =3D NEW_IMAGE_MODE_ABSOLUTE_PATHS; >>> } >> >> After this, bs->drv may be used. So I think we should keep a >> bdrv_is_inserted() or bs->drv check here. >=20 > Do BDSes with bs->drv =3D=3D NULL still happen normally, i.e. other tha= n in > cases where a driver gives up on a broken image? If not, maybe doing > that check in qmp_get_root_bs() would be best. Well, while corrupt qcow2 images aren't strictly normal, it can happen and I don't think qemu should crash if one is encountered. Max --pbkVHkdIDt1PaxQApcUKhQhDOQinbWU8v 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 iQEvBAEBCAAZBQJXodJ+EhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6Disrflx B/0S6aqslVhE2v6eya6SoKbZmrzQsnurmEt4bcoF7XLF7UvF3JBI+EpWoq/rxv4e EMHL2aQLkNu7dfP+fID4LZHkQ1NDCmwDKiCSDUXIaTd8h5oIXNJ7oQEuddvX2bRn ixtcMk3KN+ftr9p1yreRLYwK0kpQjo/5kwptY8+DlBMPXhyuQzzNpIaxyU6zvld8 E57Ju67TrkltWEalv3099GBlzT0vlYirHXslcl7TENwXKhZyiaWgPGOl+UIimCOq i4CECUYAANivk/RQebW6ACbpZfz78LmDdsHNZnIj2KQzpXzCUU9pNAlkMewZDvoX VqRzbL90a9c67VRGu/yK5mGU =XzFo -----END PGP SIGNATURE----- --pbkVHkdIDt1PaxQApcUKhQhDOQinbWU8v--