Skip to contentSkip to conversation

s390-virtio property aligning.

PATCH New Cornelia Huck 1 participant 2 messages Mar 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390-virtio property aligning.

Hi Alex,

one more instance where a virtio driver on s390 missed properties present on other transports. Please consider applying.

Cornelia Huck (1):
s390-virtio: Add virtio-rng properties.

 hw/s390x/s390-virtio-bus.c | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
1.7.12.4
#1 lore raw

PATCH 1/1 s390-virtio: Add virtio-rng properties.

Add the same 'max-bytes' and 'period' properties that are supported for virtio-pci and virtio-ccw to make things consistent.

---
 hw/s390x/s390-virtio-bus.c | 9 +++++++++
 1 file changed, 9 insertions(+)
hw/s390x/s390-virtio-bus.c +9 -0
index d9b7f83..ca2b590 100644
@@ -483,11 +483,20 @@ static void s390_virtio_rng_initfn(Object *obj)
                              (Object **)&dev->rng.rng, NULL);
 }
 
+static Property s390_virtio_rng_properties[] = {
+    DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
+    DEFINE_PROP_UINT64("max-bytes", VirtIOS390Device, rng.max_bytes, INT64_MAX),
+    DEFINE_PROP_UINT32("period", VirtIOS390Device, rng.period_ms, 1 << 16),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
 static void s390_virtio_rng_class_init(ObjectClass *klass, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(klass);
     VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
 
     k->init = s390_virtio_rng_init;
+    dc->props = s390_virtio_rng_properties;
 }
 
 static const TypeInfo s390_virtio_rng = {
Signature · 1 line
1.7.12.4