Skip to contentSkip to conversation

Move virtio-ccw devices to separate files

PATCH In review Thomas Huth 4 participants 23 messages Jul 25, 2018 – Aug 23, 2018

lore
Share & tools
lore
#0 lore raw

cover Move virtio-ccw devices to separate files

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

Thomas Huth (10):
hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize() hw/s390x: Move virtio-ccw-serial code to a separate file hw/s390x: Move virtio-ccw-balloon code to a separate file hw/s390x: Move virtio-ccw-scsi code to a separate file hw/s390x: Move virtio-ccw-rng code to a separate file hw/s390x: Move virtio-ccw-9p code to a separate file hw/s390x: Move virtio-ccw-crypto code to a separate file hw/s390x: Move vhost-vsock-ccw code to a separate file hw/s390x: Move virtio-ccw-gpu code to a separate file hw/s390x: Move virtio-ccw-input code to a separate file

 MAINTAINERS                   |   2 +-
 hw/s390x/Makefile.objs        |   9 +
 hw/s390x/vhost-vsock-ccw.c    |  60 +++++
 hw/s390x/virtio-ccw-9p.c      |  65 +++++
 hw/s390x/virtio-ccw-balloon.c |  70 +++++
 hw/s390x/virtio-ccw-crypto.c  |  75 ++++++
 hw/s390x/virtio-ccw-gpu.c     |  67 +++++
 hw/s390x/virtio-ccw-input.c   | 118 +++++++++
 hw/s390x/virtio-ccw-rng.c     |  74 ++++++
 hw/s390x/virtio-ccw-scsi.c    | 125 +++++++++
 hw/s390x/virtio-ccw-serial.c  |  78 ++++++
 hw/s390x/virtio-ccw.c         | 581 +-----------------------------------------
 12 files changed, 749 insertions(+), 575 deletions(-)
 create mode 100644 hw/s390x/vhost-vsock-ccw.c
 create mode 100644 hw/s390x/virtio-ccw-9p.c
 create mode 100644 hw/s390x/virtio-ccw-balloon.c
 create mode 100644 hw/s390x/virtio-ccw-crypto.c
 create mode 100644 hw/s390x/virtio-ccw-gpu.c
 create mode 100644 hw/s390x/virtio-ccw-input.c
 create mode 100644 hw/s390x/virtio-ccw-rng.c
 create mode 100644 hw/s390x/virtio-ccw-scsi.c
 create mode 100644 hw/s390x/virtio-ccw-serial.c
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/10 hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize()

Currently, every virtio-ccw device explicitely sets its unrealize function to virtio_ccw_unrealize() in its class_init function. We can simplify this by using a common unrealize function, just like it is already done for the realize functions.

---
 hw/s390x/virtio-ccw.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
hw/s390x/virtio-ccw.c +7 -15
index 7ddb378..7d35c77 100644
@@ -750,11 +750,16 @@ out_err:
     g_free(sch);
 }
 
-static void virtio_ccw_unrealize(VirtioCcwDevice *dev, Error **errp)
+static void virtio_ccw_device_unrealize(VirtioCcwDevice *dev, Error **errp)
 {
+    VirtIOCCWDeviceClass *dc = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
     CcwDevice *ccw_dev = CCW_DEVICE(dev);
     SubchDev *sch = ccw_dev->sch;
 
+    if (dc->unrealize) {
+        dc->unrealize(dev, errp);
+    }
+
     if (sch) {
         css_subch_assign(sch->cssid, sch->ssid, sch->schid, sch->devno, NULL);
         g_free(sch);
@@ -1349,7 +1354,6 @@ static void virtio_ccw_net_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_net_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_net_properties;
     set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
 }
@@ -1376,7 +1380,6 @@ static void virtio_ccw_blk_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_blk_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_blk_properties;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
@@ -1403,7 +1406,6 @@ static void virtio_ccw_serial_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_serial_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_serial_properties;
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
@@ -1430,7 +1432,6 @@ static void virtio_ccw_balloon_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_balloon_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_balloon_properties;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
@@ -1457,7 +1458,6 @@ static void virtio_ccw_scsi_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_scsi_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_scsi_properties;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
@@ -1483,7 +1483,6 @@ static void vhost_ccw_scsi_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = vhost_ccw_scsi_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = vhost_ccw_scsi_properties;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
@@ -1519,7 +1518,6 @@ static void virtio_ccw_rng_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_rng_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_rng_properties;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
@@ -1556,7 +1554,6 @@ static void virtio_ccw_crypto_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_crypto_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_crypto_properties;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
@@ -1593,7 +1590,6 @@ static void virtio_ccw_gpu_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_gpu_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_gpu_properties;
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories);
@@ -1621,7 +1617,6 @@ static void virtio_ccw_input_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = virtio_ccw_input_realize;
-    k->unrealize = virtio_ccw_unrealize;
     dc->props = virtio_ccw_input_properties;
     set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
@@ -1703,9 +1698,8 @@ static void virtio_ccw_busdev_realize(DeviceState *dev, Error **errp)
 static void virtio_ccw_busdev_unrealize(DeviceState *dev, Error **errp)
 {
     VirtioCcwDevice *_dev = (VirtioCcwDevice *)dev;
-    VirtIOCCWDeviceClass *_info = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
 
-    _info->unrealize(_dev, errp);
+    virtio_ccw_device_unrealize(_dev, errp);
 }
 
 static void virtio_ccw_busdev_unplug(HotplugHandler *hotplug_dev,
@@ -1801,7 +1795,6 @@ static void virtio_ccw_9p_class_init(ObjectClass *klass, void *data)
     DeviceClass *dc = DEVICE_CLASS(klass);
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
-    k->unrealize = virtio_ccw_unrealize;
     k->realize = virtio_ccw_9p_realize;
     dc->props = virtio_ccw_9p_properties;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
@@ -1847,7 +1840,6 @@ static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data)
     VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
 
     k->realize = vhost_vsock_ccw_realize;
-    k->unrealize = virtio_ccw_unrealize;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->props = vhost_vsock_ccw_properties;
 }
Signature · 1 line
1.8.3.1
#2 lore raw

Re: [Qemu-devel] [PATCH for-3.1 01/10] hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize()

Quoted 9 lines · On Wed, 25 Jul 2018 14:20:15 +0200 Thomas Huth <[email protected]> wrote:

Currently, every virtio-ccw device explicitely sets its unrealize function to virtio_ccw_unrealize() in its class_init function. We can simplify this by using a common unrealize function, just like it is already done for the realize functions.

---
 hw/s390x/virtio-ccw.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

LGTM now :)

#3 lore raw

PATCH 2/10 hw/s390x: Move virtio-ccw-serial code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_SERIAL has been set. This can be done best if the code resides in a separate file.

---
 MAINTAINERS                  |  2 +-
 hw/s390x/Makefile.objs       |  1 +
 hw/s390x/virtio-ccw-serial.c | 78 ++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c        | 58 --------------------------------
 4 files changed, 80 insertions(+), 59 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-serial.c
MAINTAINERS +1 -1
index 666e936..04aca42 100644
@@ -1221,7 +1221,7 @@ virtio-ccw
 M: Cornelia Huck <[email protected]>
 M: Christian Borntraeger <[email protected]>
 S: Supported
-F: hw/s390x/virtio-ccw.[hc]
+F: hw/s390x/virtio-ccw*.[hc]
 T: git git://github.com/cohuck/qemu.git s390-next
 T: git git://github.com/borntraeger/qemu.git s390-next
 L: [email protected]
hw/s390x/Makefile.objs +1 -0
index 93282f7..939b045 100644
@@ -8,6 +8,7 @@ obj-y += css.o
 obj-y += s390-virtio-ccw.o
 obj-y += 3270-ccw.o
 obj-y += virtio-ccw.o
+obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
 obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
hw/s390x/virtio-ccw-serial.c new file +78 -0

78 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -58

82 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 3/10 hw/s390x: Move virtio-ccw-balloon code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_BALLOON has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs        |  1 +
 hw/s390x/virtio-ccw-balloon.c | 70 +++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c         | 49 ------------------------------
 3 files changed, 71 insertions(+), 49 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-balloon.c
hw/s390x/Makefile.objs +1 -0
index 939b045..ac98350 100644
@@ -9,6 +9,7 @@ obj-y += s390-virtio-ccw.o
 obj-y += 3270-ccw.o
 obj-y += virtio-ccw.o
 obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o
+obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
 obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
hw/s390x/virtio-ccw-balloon.c new file +70 -0

70 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -49

67 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#5 lore raw

PATCH 4/10 hw/s390x: Move virtio-ccw-scsi code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_SCSI has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs     |   1 +
 hw/s390x/virtio-ccw-scsi.c | 125 +++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c      | 104 -------------------------------------
 3 files changed, 126 insertions(+), 104 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-scsi.c
hw/s390x/Makefile.objs +1 -0
index ac98350..9ca1ab0 100644
@@ -10,6 +10,7 @@ obj-y += 3270-ccw.o
 obj-y += virtio-ccw.o
 obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o
 obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o
+obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
 obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
hw/s390x/virtio-ccw-scsi.c new file +125 -0

125 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -104

122 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#6 lore raw

PATCH 5/10 hw/s390x: Move virtio-ccw-rng code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_RNG has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs    |  1 +
 hw/s390x/virtio-ccw-rng.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c     | 53 ---------------------------------
 3 files changed, 75 insertions(+), 53 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-rng.c
hw/s390x/Makefile.objs +1 -0
index 9ca1ab0..181efd1 100644
@@ -11,6 +11,7 @@ obj-y += virtio-ccw.o
 obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o
 obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o
 obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
+obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
 obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
hw/s390x/virtio-ccw-rng.c new file +74 -0

74 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -53

71 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#7 lore raw

PATCH 6/10 hw/s390x: Move virtio-ccw-9p code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_9P and CONFIG_VIRTFS have been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs   |  1 +
 hw/s390x/virtio-ccw-9p.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c    | 48 -----------------------------------
 3 files changed, 66 insertions(+), 48 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-9p.c
hw/s390x/Makefile.objs +1 -0
index 181efd1..08a8c10 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o
 obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o
 obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
 obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
+obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
 obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
hw/s390x/virtio-ccw-9p.c new file +65 -0

65 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -48

60 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#8 lore raw

PATCH 7/10 hw/s390x: Move virtio-ccw-crypto code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_CRYPTO has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs       |  1 +
 hw/s390x/virtio-ccw-crypto.c | 75 ++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c        | 55 --------------------------------
 3 files changed, 76 insertions(+), 55 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-crypto.c
hw/s390x/Makefile.objs +1 -0
index 08a8c10..1073cfa 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_VIRTIO_SERIAL) += virtio-ccw-serial.o
 obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o
 obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
 obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
+obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o
 obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
hw/s390x/virtio-ccw-crypto.c new file +75 -0

75 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -55

73 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#9 lore raw

PATCH 8/10 hw/s390x: Move vhost-vsock-ccw code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VHOST_VSOCK has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs     |  1 +
 hw/s390x/vhost-vsock-ccw.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c      | 47 ------------------------------------
 3 files changed, 61 insertions(+), 47 deletions(-)
 create mode 100644 hw/s390x/vhost-vsock-ccw.c
hw/s390x/Makefile.objs +1 -0
index 1073cfa..f1c058e 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
 obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
 obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o
 obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
+obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-ccw.o
 obj-y += css-bridge.o
 obj-y += ccw-device.o
 obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o
hw/s390x/vhost-vsock-ccw.c new file +60 -0

60 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -47

59 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#10 lore raw

Re: [Qemu-devel] [PATCH for-3.1 08/10] hw/s390x: Move vhost-vsock-ccw code to a separate file

Quoted 7 lines · On Wed, 25 Jul 2018 14:20:22 +0200 Thomas Huth <[email protected]> wrote:

The code should only be enabled if CONFIG_VHOST_VSOCK has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs     |  1 +
 hw/s390x/vhost-vsock-ccw.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++

Small nit: The existing MAINTAINERS entry for virtio-ccw doesn't catch this (although the virtio-ccw machine one does). I'll squash in the following:

MAINTAINERS +1 -0
index f823fdec91..6d01cd00af 100644
@@ -1228,6 +1228,7 @@ M: Cornelia Huck <[email protected]>
 M: Christian Borntraeger <[email protected]>
 S: Supported
 F: hw/s390x/virtio-ccw*.[hc]
+F: hw/s390x/vhost-vsock-ccw.c
 T: git git://github.com/cohuck/qemu.git s390-next
 T: git git://github.com/borntraeger/qemu.git s390-next
 L: [email protected]
Quoted 3 lines
 hw/s390x/virtio-ccw.c      | 47 ------------------------------------
 3 files changed, 61 insertions(+), 47 deletions(-)
 create mode 100644 hw/s390x/vhost-vsock-ccw.c
#11 lore raw

PATCH 9/10 hw/s390x: Move virtio-ccw-gpu code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_GPU has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs    |  1 +
 hw/s390x/virtio-ccw-gpu.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c     | 47 ---------------------------------
 3 files changed, 68 insertions(+), 47 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-gpu.c
hw/s390x/Makefile.objs +1 -0
index f1c058e..9c858c1 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_VIRTIO_BALLOON) += virtio-ccw-balloon.o
 obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
 obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
 obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o
+obj-$(CONFIG_VIRTIO_GPU) += virtio-ccw-gpu.o
 obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
 obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-ccw.o
 obj-y += css-bridge.o
hw/s390x/virtio-ccw-gpu.c new file +67 -0

67 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -47

65 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#12 lore raw

PATCH 10/10 hw/s390x: Move virtio-ccw-input code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_INPUT has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs      |   1 +
 hw/s390x/virtio-ccw-input.c | 118 ++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c       |  98 ------------------------------------
 3 files changed, 119 insertions(+), 98 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-input.c
hw/s390x/Makefile.objs +1 -0
index 9c858c1..0d7e162 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_VIRTIO_SCSI) += virtio-ccw-scsi.o
 obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
 obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o
 obj-$(CONFIG_VIRTIO_GPU) += virtio-ccw-gpu.o
+obj-$(CONFIG_VIRTIO_INPUT) += virtio-ccw-input.o
 obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
 obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-ccw.o
 obj-y += css-bridge.o
hw/s390x/virtio-ccw-input.c new file +118 -0

118 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -98

116 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#13 lore raw
In reply to Thomas Huth
Quoted 10 lines · On Wed, 25 Jul 2018 14:20:14 +0200 Thomas Huth <[email protected]> wrote:

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

I understand virtio-net-ccw (autogenerated network devices), but why virtio-blk-ccw?

Regardless, it might make sense to split them out so that we get a slimmed-down virtio-ccw.c.

Quoted 36 lines

Thomas Huth (10):
hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize() hw/s390x: Move virtio-ccw-serial code to a separate file hw/s390x: Move virtio-ccw-balloon code to a separate file hw/s390x: Move virtio-ccw-scsi code to a separate file hw/s390x: Move virtio-ccw-rng code to a separate file hw/s390x: Move virtio-ccw-9p code to a separate file hw/s390x: Move virtio-ccw-crypto code to a separate file hw/s390x: Move vhost-vsock-ccw code to a separate file hw/s390x: Move virtio-ccw-gpu code to a separate file hw/s390x: Move virtio-ccw-input code to a separate file

 MAINTAINERS                   |   2 +-
 hw/s390x/Makefile.objs        |   9 +
 hw/s390x/vhost-vsock-ccw.c    |  60 +++++
 hw/s390x/virtio-ccw-9p.c      |  65 +++++
 hw/s390x/virtio-ccw-balloon.c |  70 +++++
 hw/s390x/virtio-ccw-crypto.c  |  75 ++++++
 hw/s390x/virtio-ccw-gpu.c     |  67 +++++
 hw/s390x/virtio-ccw-input.c   | 118 +++++++++
 hw/s390x/virtio-ccw-rng.c     |  74 ++++++
 hw/s390x/virtio-ccw-scsi.c    | 125 +++++++++
 hw/s390x/virtio-ccw-serial.c  |  78 ++++++
 hw/s390x/virtio-ccw.c         | 581 +-----------------------------------------
 12 files changed, 749 insertions(+), 575 deletions(-)
 create mode 100644 hw/s390x/vhost-vsock-ccw.c
 create mode 100644 hw/s390x/virtio-ccw-9p.c
 create mode 100644 hw/s390x/virtio-ccw-balloon.c
 create mode 100644 hw/s390x/virtio-ccw-crypto.c
 create mode 100644 hw/s390x/virtio-ccw-gpu.c
 create mode 100644 hw/s390x/virtio-ccw-input.c
 create mode 100644 hw/s390x/virtio-ccw-rng.c
 create mode 100644 hw/s390x/virtio-ccw-scsi.c
 create mode 100644 hw/s390x/virtio-ccw-serial.c
#14 lore raw
Quoted 9 lines · Cornelia Huck
Quoted 6 lines · On Wed, 25 Jul 2018 14:20:14 +0200 Thomas Huth <[email protected]> wrote:

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

Quoted 7 lines
Quoted 4 lines

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

I understand virtio-net-ccw (autogenerated network devices), but why virtio-blk-ccw?

Because we set mc->block_default_type = IF_VIRTIO ==> if you disable virtio-blk, the CLI options like -hda and -cdrom would not work anymore.

Quoted 2 lines

Regardless, it might make sense to split them out so that we get a slimmed-down virtio-ccw.c.

OK.

Thomas

#15 lore raw
Quoted 15 lines · On Wed, 25 Jul 2018 19:20:59 +0200 Thomas Huth <[email protected]> wrote:
Quoted 14 lines · Cornelia Huck
Quoted 10 lines · On Wed, 25 Jul 2018 14:20:14 +0200 Thomas Huth <[email protected]> wrote:

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

Quoted 5 lines
Quoted 2 lines

I understand virtio-net-ccw (autogenerated network devices), but why virtio-blk-ccw?

Because we set mc->block_default_type = IF_VIRTIO ==> if you disable virtio-blk, the CLI options like -hda and -cdrom would not work anymore.

I see. Maybe we need some strategic #ifdefs to deal with this.

#16 lore raw
In reply to Thomas Huth

Are you planning to do a similar thing for virtio-pci? I think it would be good to keep virtio-ccw similar to virtio-pci when it makes sense.

Quoted 46 lines · Thomas Huth

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

Thomas Huth (10):
hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize() hw/s390x: Move virtio-ccw-serial code to a separate file hw/s390x: Move virtio-ccw-balloon code to a separate file hw/s390x: Move virtio-ccw-scsi code to a separate file hw/s390x: Move virtio-ccw-rng code to a separate file hw/s390x: Move virtio-ccw-9p code to a separate file hw/s390x: Move virtio-ccw-crypto code to a separate file hw/s390x: Move vhost-vsock-ccw code to a separate file hw/s390x: Move virtio-ccw-gpu code to a separate file hw/s390x: Move virtio-ccw-input code to a separate file

 MAINTAINERS                   |   2 +-
 hw/s390x/Makefile.objs        |   9 +
 hw/s390x/vhost-vsock-ccw.c    |  60 +++++
 hw/s390x/virtio-ccw-9p.c      |  65 +++++
 hw/s390x/virtio-ccw-balloon.c |  70 +++++
 hw/s390x/virtio-ccw-crypto.c  |  75 ++++++
 hw/s390x/virtio-ccw-gpu.c     |  67 +++++
 hw/s390x/virtio-ccw-input.c   | 118 +++++++++
 hw/s390x/virtio-ccw-rng.c     |  74 ++++++
 hw/s390x/virtio-ccw-scsi.c    | 125 +++++++++
 hw/s390x/virtio-ccw-serial.c  |  78 ++++++
 hw/s390x/virtio-ccw.c         | 581 +-----------------------------------------
 12 files changed, 749 insertions(+), 575 deletions(-)
 create mode 100644 hw/s390x/vhost-vsock-ccw.c
 create mode 100644 hw/s390x/virtio-ccw-9p.c
 create mode 100644 hw/s390x/virtio-ccw-balloon.c
 create mode 100644 hw/s390x/virtio-ccw-crypto.c
 create mode 100644 hw/s390x/virtio-ccw-gpu.c
 create mode 100644 hw/s390x/virtio-ccw-input.c
 create mode 100644 hw/s390x/virtio-ccw-rng.c
 create mode 100644 hw/s390x/virtio-ccw-scsi.c
 create mode 100644 hw/s390x/virtio-ccw-serial.c
#17 lore raw
Quoted 2 lines · Christian Borntraeger

Are you planning to do a similar thing for virtio-pci? I think it would be good to keep virtio-ccw similar to virtio-pci when it makes sense.

+1 to that.

Later, Juan.

#18 lore raw
Quoted 3 lines · Juan Quintela
Quoted 2 lines · Christian Borntraeger

Are you planning to do a similar thing for virtio-pci? I think it would be good to keep virtio-ccw similar to virtio-pci when it makes sense.

Somebody™ should do it, yes. For the context, see:
https://lists.gnu.org/archive/html/qemu-devel/2018-07/msg03935.html

Quoted 1 line

+1 to that.

I was hoping that you would take care of the pci while I'm handling the ccw part, Juan ;-) But if you don't have spare time for this at all, I can also put it on my todo list.

Thomas

#19 lore raw

[Qemu-devel] [PATCH for-3.1 11/10] hw/s390x: Move virtio-ccw-net code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_NET has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs    |  1 +
 hw/s390x/virtio-ccw-net.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c     | 49 ---------------------------------
 3 files changed, 71 insertions(+), 49 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-net.c
hw/s390x/Makefile.objs +1 -0
index 0d7e162..172ba55 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_VIRTIO_RNG) += virtio-ccw-rng.o
 obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o
 obj-$(CONFIG_VIRTIO_GPU) += virtio-ccw-gpu.o
 obj-$(CONFIG_VIRTIO_INPUT) += virtio-ccw-input.o
+obj-$(CONFIG_VIRTIO_NET) += virtio-ccw-net.o
 obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
 obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-ccw.o
 obj-y += css-bridge.o
hw/s390x/virtio-ccw-net.c new file +70 -0

70 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -49

67 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#20 lore raw

[Qemu-devel] [PATCH for-3.1 12/10] hw/s390x: Move virtio-ccw-blk code to a separate file

In reply to Thomas Huth

The code should only be enabled if CONFIG_VIRTIO_BLK has been set. This can be done best if the code resides in a separate file.

---
 hw/s390x/Makefile.objs    |  1 +
 hw/s390x/virtio-ccw-blk.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/s390x/virtio-ccw.c     | 46 --------------------------------
 3 files changed, 68 insertions(+), 46 deletions(-)
 create mode 100644 hw/s390x/virtio-ccw-blk.c
hw/s390x/Makefile.objs +1 -0
index 172ba55..5dbc00c 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_VIRTIO_CRYPTO) += virtio-ccw-crypto.o
 obj-$(CONFIG_VIRTIO_GPU) += virtio-ccw-gpu.o
 obj-$(CONFIG_VIRTIO_INPUT) += virtio-ccw-input.o
 obj-$(CONFIG_VIRTIO_NET) += virtio-ccw-net.o
+obj-$(CONFIG_VIRTIO_BLK) += virtio-ccw-blk.o
 obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += virtio-ccw-9p.o
 obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock-ccw.o
 obj-y += css-bridge.o
hw/s390x/virtio-ccw-blk.c new file +67 -0

67 lines not on this page · raw message

hw/s390x/virtio-ccw.c +0 -46

64 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#21 lore raw
In reply to Thomas Huth
Quoted 37 lines · On Wed, 25 Jul 2018 14:20:14 +0200 Thomas Huth <[email protected]> wrote:

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

Thomas Huth (10):
hw/s390x/virtio-ccw: Consolidate calls to virtio_ccw_unrealize() hw/s390x: Move virtio-ccw-serial code to a separate file hw/s390x: Move virtio-ccw-balloon code to a separate file hw/s390x: Move virtio-ccw-scsi code to a separate file hw/s390x: Move virtio-ccw-rng code to a separate file hw/s390x: Move virtio-ccw-9p code to a separate file hw/s390x: Move virtio-ccw-crypto code to a separate file hw/s390x: Move vhost-vsock-ccw code to a separate file hw/s390x: Move virtio-ccw-gpu code to a separate file hw/s390x: Move virtio-ccw-input code to a separate file

 MAINTAINERS                   |   2 +-
 hw/s390x/Makefile.objs        |   9 +
 hw/s390x/vhost-vsock-ccw.c    |  60 +++++
 hw/s390x/virtio-ccw-9p.c      |  65 +++++
 hw/s390x/virtio-ccw-balloon.c |  70 +++++
 hw/s390x/virtio-ccw-crypto.c  |  75 ++++++
 hw/s390x/virtio-ccw-gpu.c     |  67 +++++
 hw/s390x/virtio-ccw-input.c   | 118 +++++++++
 hw/s390x/virtio-ccw-rng.c     |  74 ++++++
 hw/s390x/virtio-ccw-scsi.c    | 125 +++++++++
 hw/s390x/virtio-ccw-serial.c  |  78 ++++++
 hw/s390x/virtio-ccw.c         | 581 +-----------------------------------------
 12 files changed, 749 insertions(+), 575 deletions(-)
 create mode 100644 hw/s390x/vhost-vsock-ccw.c
Quoted 9 lines
 create mode 100644 hw/s390x/virtio-ccw-9p.c
 create mode 100644 hw/s390x/virtio-ccw-balloon.c
 create mode 100644 hw/s390x/virtio-ccw-crypto.c
 create mode 100644 hw/s390x/virtio-ccw-gpu.c
 create mode 100644 hw/s390x/virtio-ccw-input.c
 create mode 100644 hw/s390x/virtio-ccw-rng.c
 create mode 100644 hw/s390x/virtio-ccw-scsi.c
 create mode 100644 hw/s390x/virtio-ccw-serial.c

Trawling through my backlog... I don't think there were any issues with this? I think I'll just go ahead and queue this (would not mind reviews, though).

#22 lore raw
In reply to Thomas Huth
Quoted 10 lines · On Wed, 25 Jul 2018 14:20:14 +0200 Thomas Huth <[email protected]> wrote:

For more fine-grained control over the build process, it would be good to have the possibility to disable single virtio devices, too. We already have CONFIG_VIRTIO_* switches in the Makefiles, but currently all virtio-ccw devices are compiled in anyway. Move them to separate files so we can disable them in the Makefile more easily.

NB: I did not move virtio-blk-ccw and virtio-net-ccw to a separate file yet since they are essential for the s390x-virtio machine and thus it does IMHO not make much sense to disable net and blk. But if somebody needs that possibility, too, I can add two more patches on top...

Thanks, applied (including the two patches on top.)