Include also other properties than features.  This adds the common virtio
features to s390.

Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
 hw/s390-virtio-bus.c |    3 +--
 hw/virtio-pci.c      |    4 +---
 hw/virtio-serial.h   |    5 +++++
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 80b11e5..282688a 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -359,8 +359,7 @@ static VirtIOS390DeviceInfo s390_virtio_serial = {
     .qdev.alias = "virtio-serial",
     .qdev.size = sizeof(VirtIOS390Device),
     .qdev.props = (Property[]) {
-        DEFINE_PROP_UINT32("max_ports", VirtIOS390Device,
-                           serial.max_virtserial_ports, 31),
+        DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOS390Device, host_features, 
serial),
         DEFINE_PROP_END_OF_LIST(),
     },
 };
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index b93477b..d5cdc04 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -836,9 +836,7 @@ static PCIDeviceInfo virtio_info[] = {
             DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
                                DEV_NVECTORS_UNSPECIFIED),
             DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
-            DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
-            DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy,
-                               serial.max_virtserial_ports, 31),
+            DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOPCIProxy, host_features, 
serial),
             DEFINE_PROP_END_OF_LIST(),
         },
         .qdev.reset = virtio_pci_reset,
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h
index ab13803..2e1a428 100644
--- a/hw/virtio-serial.h
+++ b/hw/virtio-serial.h
@@ -204,4 +204,9 @@ size_t virtio_serial_guest_ready(VirtIOSerialPort *port);
  */
 void virtio_serial_throttle_port(VirtIOSerialPort *port, bool throttle);
 
+#define DEFINE_VIRTIO_SERIAL_PROPERTIES(_state, _feature_field, _conf_field) \
+        DEFINE_VIRTIO_COMMON_FEATURES(_state, _feature_field), \
+        DEFINE_PROP_UINT32("max_ports", _state, \
+                           _conf_field.max_virtserial_ports, 31)
+
 #endif
-- 
1.7.7.1



Reply via email to