qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/8] virtio-blk-x: fix configuration synchroniza


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 1/8] virtio-blk-x: fix configuration synchronization.
Date: Fri, 05 Apr 2013 14:24:06 -0500
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Peter Maydell <address@hidden> writes:

> On 5 April 2013 17:47, Anthony Liguori <address@hidden> wrote:
>> Kevin Wolf <address@hidden> writes:
>>
>>> From: KONRAD Frederic <address@hidden>
>>>
>>> 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 <address@hidden>
>>> Tested-by: Cornelia Huck <address@hidden>
>>> Signed-off-by: Kevin Wolf <address@hidden>
>>
>> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]