[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 2/3] block-backend: Remember if attached device
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH 2/3] block-backend: Remember if attached device is non-qdev |
Date: |
Thu, 6 Oct 2016 13:29:00 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 05.10.2016 um 20:01 hat Max Reitz geschrieben:
> On 05.10.2016 11:26, Kevin Wolf wrote:
> > Almost all block devices are qdevified by now. This allows us to go back
> > from the BlockBackend to the DeviceState. xen_disk is the last device
> > that is missing. We'll remember in the BlockBackend if a xen_disk is
> > attached and can then disable any features that require going from a BB
> > to the DeviceState.
> >
> > While at it, clearly mark the function used by xen_disk as legacy even
> > in its name, not just in TODO comments.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > +/*
> > + * Attach device model @dev to @blk.
> > * @blk must not have a device model attached already.
> > * TODO qdevified devices don't use this, remove when devices are qdevified
> > */
> > -void blk_attach_dev_nofail(BlockBackend *blk, void *dev)
> > +void blk_attach_dev_legacy(BlockBackend *blk, void *dev)
> > {
> > if (blk_attach_dev(blk, dev) < 0) {
>
> I'd make this a blk_do_attach_dev(), but it's not syntactically wrong,
> so the choice is up to you.
Thanks for catching this, what you suggest is what I intended. Maybe we
should just enable the gcc --do-what-i-mean option.
Kevin
pgpmpQ1GHqb1b.pgp
Description: PGP signature