On Thu, Nov 05, 2026 at 07:20:27PM +0800, Yonggang Luo wrote: > On Thu, Nov 5, 2026 at 7:03 PM Daniel P. Berrangé <[email protected]> wrote: > > > > On Sun, Nov 01, 2026 at 12:40:04AM +0800, Yonggang Luo wrote: > > > virtio-blk-pci and virtio-net-pci added the s390x loadparm property > > > from class_init when target_s390x() was true. Register each > > > VirtioPCIDeviceTypeInfo twice. The s390x variant calls > > > pci_qdev_property_add_specifics(), which now always adds loadparm, > > > and the other variant does not. target_s390x() and target_not_s390x() > > > select > > > the two. > > > > > > Signed-off-by: Yonggang Luo <[email protected]> > > > --- > > > hw/pci/pci.c | 13 +++++-------- > > > hw/virtio/virtio-blk-pci.c | 27 ++++++++++++++++++++++++++- > > > hw/virtio/virtio-net-pci.c | 27 ++++++++++++++++++++++++++- > > > 3 files changed, 57 insertions(+), 10 deletions(-) > > > > > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > > > index 2d2fe02c68e..b5ea0b049aa 100644 > > > --- a/hw/pci/pci.c > > > +++ b/hw/pci/pci.c > > > @@ -2901,14 +2901,11 @@ void pci_qdev_property_add_specifics(DeviceClass > > > *dc) > > > { > > > ObjectClass *oc = OBJECT_CLASS(dc); > > > > > > - /* The loadparm property is only supported on s390x */ > > > - if (target_s390x()) { > > > - object_class_property_add_str(oc, "loadparm", > > > - pci_qdev_property_get_loadparm, > > > - pci_qdev_property_set_loadparm); > > > - object_class_property_set_description(oc, "loadparm", > > > - "load parameter (s390x > > > only)"); > > > - } > > > + object_class_property_add_str(oc, "loadparm", > > > + pci_qdev_property_get_loadparm, > > > + pci_qdev_property_set_loadparm); > > > + object_class_property_set_description(oc, "loadparm", > > > + "load parameter (s390x only)"); > > > } > > > > > > MemoryRegion *pci_address_space(PCIDevice *dev) > > > > Again this is the only bit that we need IMHO, as it is harmless to > > register these properties unconditionally. > > Hi that's the first choice of mine, I have did it a long ago > > https://patchew.org/QEMU/[email protected]/
Oh, I missed that series. That is exactly how I think it ought to be done. With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
