Received: from eggs.gnu.org ([2001:4830:134:3::10]:46083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUcPc-0005tN-P3 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 12:19:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUcPb-0003L4-5j for qemu-devel@nongnu.org; Tue, 02 Aug 2016 12:19:23 -0400 Date: Tue, 2 Aug 2016 18:19:12 +0200 From: Kevin Wolf Message-ID: <20160802161912.GB5421@noname.redhat.com> 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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: <273082a0-2b5f-f0a6-2d66-bb5415ccbd39@redhat.com> 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: Max Reitz Cc: qemu-block@nongnu.org, eblake@redhat.com, berto@igalia.com, qemu-devel@nongnu.org --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 that > > we're operating at a root node. > >=20 > > In case of an invalid device name, the command returns the GenericError > > error class now instead of DeviceNotFound, because this is what > > qmp_get_root_bs() returns. > >=20 > > Signed-off-by: Kevin Wolf > > - 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; > > } >=20 > After this, bs->drv may be used. So I think we should keep a > bdrv_is_inserted() or bs->drv check here. Do BDSes with bs->drv =3D=3D NULL still happen normally, i.e. other than 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. Kevin --mP3DRpeJDSE+ciuQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXoMgAAAoJEH8JsnLIjy/Wi8AP/jOLT7l8vjhZu947cTO29JS1 bAEPOgmPJqezx2TCMCh0KI+K7SCt4fUs5eCUBXBgsFAuIT2ku/Uak2DvUot5QVjM gt+HybsliS3FuCOdWZymWkwa2OiL+wTEmWGVfoIuFKW+KvE9RahTSh7HtWOZ9uy4 pr7l+ath1TvhkMkn7nl7fKMiM0IvTuZa7R87zP8c+wmFU2gZ7n4l2WWkBYRT0LoW dUYu78Hx84bb8zvkq1kbcHu5M9zP3NR8Nqry/9klD6UfmxCGRibcMaHPrT10uywx sSvGCpkUrwlsx/GYThoXZlUJIieV8tOpPd2U0sLKrH3/Z/TpvzXztxu8LOBi/Jwh ucPBI8d4mlXAe5E9ijQaGG94Mf9axjUfbsiOKTTyUWHeSnVkNfGzP6rTY+Q2YY/z Bp/YHuv5fLNpA1q0fCm6/bNr/Cb+OH9aR4B2YoZdC9Fnm/6FKU9pVfKggpWh2KQp OmZDcsMCQTGd9Tzu5oYii2O+b9Ch3puYJ9JQuWuWGwEA/NEcNKJbAz0cBw0EAqpm o8e6RBYLWJSSEDpvyvEkIDUCxIo8ffD7vU5UUYTjvr0nu94xyBmi9B3xWsgbDjNH r/ZIQb7OGiRZ90UTiCtijVvQLXl3unaR9SsJUtWzltQhQT7ZcgPuLMyE8fn5pLlr wFq+Ai/9/vANUpal98UU =D59+ -----END PGP SIGNATURE----- --mP3DRpeJDSE+ciuQ--