[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v4 09/11] block: Accept node-name for drive-mirr
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v4 09/11] block: Accept node-name for drive-mirror |
Date: |
Tue, 2 Aug 2016 18:19:12 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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.
> >
> > 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.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > - aio_context = blk_get_aio_context(blk);
> > + aio_context = bdrv_get_aio_context(bs);
> > aio_context_acquire(aio_context);
> >
> > - if (!blk_is_available(blk)) {
> > - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, device);
> > - goto out;
> > - }
> > - bs = blk_bs(blk);
> > if (!has_mode) {
> > mode = 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.
Do BDSes with bs->drv == 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
pgpiGCFA2v5jk.pgp
Description: PGP signature
- Re: [Qemu-block] [PATCH v4 09/11] block: Accept node-name for drive-mirror,
Kevin Wolf <=