From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOYqD-0000Rr-4m for qemu-devel@nongnu.org; Sat, 06 Apr 2013 15:32:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOYqA-0004U0-5y for qemu-devel@nongnu.org; Sat, 06 Apr 2013 15:31:57 -0400 Received: from greensocs.com ([87.106.252.221]:47442 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOYqA-0004OE-07 for qemu-devel@nongnu.org; Sat, 06 Apr 2013 15:31:54 -0400 Message-ID: <5160781F.7020006@greensocs.com> Date: Sat, 06 Apr 2013 21:31:43 +0200 From: =?ISO-8859-1?Q?KONRAD_Fr=E9d=E9ric?= MIME-Version: 1.0 References: <1365168490-29616-1-git-send-email-kwolf@redhat.com> <1365168490-29616-2-git-send-email-kwolf@redhat.com> <878v4wj55c.fsf@codemonkey.ws> <878v4wdbmx.fsf@codemonkey.ws> In-Reply-To: <878v4wdbmx.fsf@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/8] virtio-blk-x: fix configuration synchronization. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org On 05/04/2013 21:24, Anthony Liguori wrote: > Peter Maydell writes: > >> On 5 April 2013 17:47, Anthony Liguori wrote: >>> Kevin Wolf writes: >>> >>>> From: KONRAD Frederic >>>> >>>> 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 >>>> Tested-by: Cornelia Huck >>>> Signed-off-by: Kevin Wolf >>> 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