On 11.12.2017 18:17, Cornelia Huck wrote: > On Mon, 11 Dec 2017 14:47:29 +0100 > David Hildenbrand <da...@redhat.com> wrote: > >> This makes it clearer, which device is used for which accelerator. >> >> Signed-off-by: David Hildenbrand <da...@redhat.com> >> --- >> hw/intc/s390_flic.c | 9 +++++++-- >> hw/intc/s390_flic_kvm.c | 12 ------------ >> include/hw/s390x/s390_flic.h | 9 --------- >> 3 files changed, 7 insertions(+), 23 deletions(-) >> >> diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c >> index 6eaf178d79..a78bdf1d90 100644 >> --- a/hw/intc/s390_flic.c >> +++ b/hw/intc/s390_flic.c >> @@ -40,11 +40,16 @@ void s390_flic_init(void) >> { >> DeviceState *dev; >> >> - dev = s390_flic_kvm_create(); >> - if (!dev) { >> + if (kvm_enabled()) { >> + dev = qdev_create(NULL, TYPE_KVM_S390_FLIC); >> + object_property_add_child(qdev_get_machine(), TYPE_KVM_S390_FLIC, >> + OBJECT(dev), NULL); >> + } else if (tcg_enabled()) { >> dev = qdev_create(NULL, TYPE_QEMU_S390_FLIC); >> object_property_add_child(qdev_get_machine(), TYPE_QEMU_S390_FLIC, >> OBJECT(dev), NULL); > > Can you use TYPE_S390_FLIC_COMMON for attaching the flic to the machine?
I suggest doing that in a separate patch. (I remember that changing the name should not harm migration). > >> + } else { >> + g_assert_not_reached(); > > Checking for tcg_enabled() explicitly does not seem the common pattern, > although it is fine with me (I doubt we'll support other accelerators > for s390x in the foreseeable future). Indeed, I can drop that. > >> } >> qdev_init_nofail(dev); >> } > > Do we want to switch to the same pattern for the storage attribute > device as well? Yes, can have a look, thanks! > > Change looks fine to me. > -- Thanks, David / dhildenb