From: Anthony Liguori <anthony@codemonkey.ws>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
qemu-devel@nongnu.org,
"KONRAD Frédéric" <fred.konrad@greensocs.com>
Subject: Re: [Qemu-devel] [PATCH 1/8] virtio-blk-x: fix configuration synchronization.
Date: Fri, 05 Apr 2013 14:24:06 -0500 [thread overview]
Message-ID: <878v4wdbmx.fsf@codemonkey.ws> (raw)
In-Reply-To: <CAFEAcA8TmdXS34hKvo-xrC23if2QCjBUMdXnn-kg5H2iA4WrSQ@mail.gmail.com>
Peter Maydell <peter.maydell@linaro.org> writes:
> On 5 April 2013 17:47, Anthony Liguori <anthony@codemonkey.ws> wrote:
>> Kevin Wolf <kwolf@redhat.com> writes:
>>
>>> From: KONRAD Frederic <fred.konrad@greensocs.com>
>>>
>>> The virtio-blk-x configuration is not in sync with virtio-blk configuration.
>>> So this patch remove the virtio-blk-x configuration field, and use virtio-blk
>>> one for setting the properties.
>>>
>>> This also remove a useless configuration copy in virtio_blk_device_init.
>>>
>>> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
>>> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>>
>> This breaks -M pc-1.0 as it breaks global properties.
>
> The first level analysis of why this happens:
>
> (1) global values are set as part of DeviceState's instance_init function
> [and we set the config_wce field to 0 here]
> (2) virtio_blk_pci_instance_init is a subclass instance_init so runs second
> (3) it calls object_initialize on its embedded virtio-blk object
> (4) the DeviceState instance_init for that child object sets the
> properties to their init values [thus resetting config_wce to 1]
>
> The effect is that at the moment you can't have a property on
> a parent object whose value is stored in the child object
> (unless you do something hacky like read the default before
> calling object_initialize and restore it afterwards].
>
> It seems to me that the underlying problem here is that we
> set global values too early -- they should be set after a
> device is completely instance_init'd, not halfway through init.
Here is an in-progress series that forwards properties from the
virtio-blk-pci to virtio-blk.
I think it's the best solution. The approach needs some polishing but I
wanted to share early.
https://github.com/aliguori/qemu/commits/qom-forward.1
Regards,
Anthony Liguori
>
> -- PMM
next prev parent reply other threads:[~2013-04-05 19:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 13:28 [Qemu-devel] [PULL 0/8] Block patches Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 1/8] virtio-blk-x: fix configuration synchronization Kevin Wolf
2013-04-05 16:47 ` Anthony Liguori
2013-04-05 17:56 ` Peter Maydell
2013-04-05 19:24 ` Anthony Liguori [this message]
2013-04-06 19:31 ` KONRAD Frédéric
2013-04-05 13:28 ` [Qemu-devel] [PATCH 2/8] usb-storage: Forward serial number to scsi-disk Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 3/8] block: fix I/O throttling accounting blind spot Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 4/8] block: keep I/O throttling slice time constant Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 5/8] block: drop duplicated slice extension code Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 6/8] block: clean up I/O throttling wait_time code Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 7/8] qcow2: Return real error in qcow2_update_snapshot_refcount Kevin Wolf
2013-04-05 13:28 ` [Qemu-devel] [PATCH 8/8] qcow2: Fix L1 write error handling " Kevin Wolf
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=878v4wdbmx.fsf@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=fred.konrad@greensocs.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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.