]> Git Repo - qemu.git/commit
qdev: fix the order compat and global properties are applied
authorGreg Kurz <[email protected]>
Tue, 11 Jul 2017 00:43:01 +0000 (21:43 -0300)
committerEduardo Habkost <[email protected]>
Mon, 17 Jul 2017 18:41:29 +0000 (15:41 -0300)
commit5eb6a3c50185e101f87382f41fb66eed5784e7ac
tree8a849f126852b940eb9740fd5e73b81184d75165
parent3f0058bbc1f057dee0c6b819b1119f1f58a3a6e8
qdev: fix the order compat and global properties are applied

The current code recursively applies global properties from child up to
parent types. This can cause properties passed with the -global option to
be silently overridden by internal compat properties.

This is exactly what happened with virtio-*-pci drivers since commit:

"9a4c0e220d8a hw/virtio-pci: fix virtio behaviour"

Passing -device virtio-blk-pci.disable-modern=off had no effect on 2.6
machine types because the internal virtio-pci.disable-modern=on compat
property always prevailed.

A workaround for this was included with commit 0bcba41f ("machine:
Convert abstract typename on compat_props to subclass names").

This patch fixes the issue properly by reversing the logic: we now go
through the global property list and, for each property, we check if it
is applicable to the device.

This results in compat properties being applied first, in the order they
appear in the HW_COMPAT_* macros, followed by global properties, in the
order they appear on the command line.

Signed-off-by: Greg Kurz <[email protected]>
Message-Id: <148103887228.22326.478406873609299999[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20170711004303[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Halil Pasic <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
hw/core/qdev-properties.c
This page took 0.028783 seconds and 4 git commands to generate.