From: Markus Armbruster <armbru@redhat.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
afaerber@suse.de, qemu-devel@nongnu.org, stefanha@redhat.com,
agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH v3 4/9] ide: Drop redundant IDEState member bs
Date: Wed, 12 Feb 2014 10:16:00 +0100 [thread overview]
Message-ID: <878utgpu7j.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <8738jpaf0b.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Tue, 11 Feb 2014 15:41:08 +0100")
Markus Armbruster <armbru@redhat.com> writes:
> Stefano Stabellini <stefano.stabellini@eu.citrix.com> writes:
>
>> On Thu, 6 Feb 2014, Markus Armbruster wrote:
>>> Stefano Stabellini <stefano.stabellini@eu.citrix.com> writes:
>>>
>>> > On Wed, 5 Feb 2014, Markus Armbruster wrote:
>>> >> [Note cc: Stefano]
>>> >>
>>> >> Kevin Wolf <kwolf@redhat.com> writes:
>>> >>
>>> >> > Am 30.01.2014 um 13:16 hat Markus Armbruster geschrieben:
>>> >> >> It's a copy of dev->conf.bs. The copy was needed for non-qdevified
>>> >> >> controllers, which lacked dev.
>>> >> >>
>>> >> >> Note how pci_piix3_xen_ide_unplug() cleared the copy. We'll get back
>>> >> >> to that in the next few commits.
>>> >> >>
>>> >> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> >> >
>>> >> > So this pci_piix3_xen_ide_unplug() is what happens here:
>>> >> >
>>> >> >> --- a/hw/ide/piix.c
>>> >> >> +++ b/hw/ide/piix.c
>>> >> >> @@ -169,12 +169,9 @@ static int pci_piix_ide_initfn(PCIDevice *dev)
>>> >> >>
>>> >> >> static int pci_piix3_xen_ide_unplug(DeviceState *dev)
>>> >> >> {
>>> >> >> - PCIIDEState *pci_ide;
>>> >> >> DriveInfo *di;
>>> >> >> int i = 0;
>>> >> >>
>>> >> >> - pci_ide = PCI_IDE(dev);
>>> >> >> -
>>> >> >> for (; i < 3; i++) {
>>> >> >> di = drive_get_by_index(IF_IDE, i);
>>> >> >> if (di != NULL && !di->media_cd) {
>>> >> >> @@ -183,7 +180,6 @@ static int pci_piix3_xen_ide_unplug(DeviceState *dev)
>>> >> >> bdrv_detach_dev(di->bdrv, ds);
>>> >> >> }
>>> >> >> bdrv_close(di->bdrv);
>>> >> >> - pci_ide->bus[di->bus].ifs[di->unit].bs = NULL;
>>> >> >> drive_put_ref(di);
>>> >> >> }
>>> >> >> }
>>> >> >
>>> >> > Probably I'm just missing the obvious, but it seems to me that the
>>> >> > copy was cleared here, while the original was left around. This was
>>> >> > no problem because the original was unused anyway after device
>>> >> > initialisation.
>>> >> >
>>> >> > Now that the copy doesn't exist any more, we can't clear it, obviously,
>>> >> > but why don't we have to clear the original? Won't we still run the
>>> >> > "device is attached" code branches even though the device is really
>>> >> > unplugged?
>>> >>
>>> >> It's been a while since I wrote this. Almost 14 months, in fact.
>>> >>
>>> >> No other IDE controller implements DeviceClass method unplug(). I can't
>>> >> remember why the normal code to detach the backend (release_drive())
>>> >> doesn't do here. Stefano, can you help?
>>> >
>>> > Too long to be able to remember the exact details :-/
>>> > However if you point me to a branch I can give it a try and tell you if
>>> > the unplug still works as it used to.
>>>
>>> Series trivially rebased to current master available at
>>> git://repo.or.cz/qemu/armbru.git branch kill-non-qdev-ide
>>
>> Unfortunately it doesn't work: I can see both sda and xvda being present
>> after the system has booted.
>
> Thank you for testing. I'll try to clear the originals like Kevin
> suggested. Hopefully, that'll pass your test.
Stefano, I updated the branch, please retest it.
next prev parent reply other threads:[~2014-02-12 9:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-30 12:16 [Qemu-devel] [PATCH v3 0/9] Clean up IDE after completion of qdevification Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 1/9] ide: Move IDEDevice pointer from IDEBus to IDEState Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 2/9] ide: Use IDEState member dev for "device connected" test Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 3/9] ide: Don't block-align IDEState member smart_selftest_data Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 4/9] ide: Drop redundant IDEState member bs Markus Armbruster
2014-02-03 14:54 ` Kevin Wolf
2014-02-05 14:07 ` Markus Armbruster
2014-02-05 17:09 ` Stefano Stabellini
2014-02-06 7:02 ` Markus Armbruster
2014-02-07 12:58 ` Stefano Stabellini
2014-02-11 14:41 ` Markus Armbruster
2014-02-12 9:16 ` Markus Armbruster [this message]
2014-02-12 13:48 ` Stefano Stabellini
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 5/9] ide: Drop redundant IDEState geometry members Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 6/9] ide: Drop redundant IDEState member version Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 7/9] ide: Drop redundant IDEState member drive_serial_str Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 8/9] ide: Drop redundant IDEState member model Markus Armbruster
2014-01-30 12:16 ` [Qemu-devel] [PATCH v3 9/9] ide: Drop redundant IDEState member wwn Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878utgpu7j.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=stefano.stabellini@eu.citrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.