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: KONRAD Frédéric
Subject: Re: [Qemu-devel] [PATCH 1/8] virtio-blk-x: fix configuration synchronization.
Date: Sat, 06 Apr 2013 21:31:43 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 05/04/2013 21:24, Anthony Liguori wrote:
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
Seems, it's what we need here.

I think it is the same think for all other backends?

Fred



reply via email to

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