Skip to contentSkip to conversation

s390: Fix compile, add 0.12 machine type, backward compat

PATCH Applied Amit Shah 3 participants 6 messages Feb 25, 2010 – Mar 6, 2010

lore
Share & tools
lore

Amit Shah

author
#0 lore raw

cover s390: Fix compile, add 0.12 machine type, backward compat

Hello,

This series fixes a compile error and adds 0.12 and 0.13 machine types, disabling newer virtio-serial features for 0.12.

Note: The name for the machine type changes from s390-virtio to s390-virtio-vXX, this may not be compatible for 0.12.

Amit Shah (3):
s390-virtio: Fix compile error for virtio-block init
s390: Add a 0.12 machine type for compatibility
s390-virtio: Disable new virtio-serial features for 0.12 machine type

 hw/s390-virtio-bus.c |    2 +-
 hw/s390-virtio.c     |   26 +++++++++++++++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)
author
#1 lore raw

PATCH 1/3 s390-virtio: Fix compile error for virtio-block init

Commit 428c149b0be790b440e1cbee185b152cdb22feec modified the argument that virtio_blk_init takes. Update the s390 bus code that calls this function.

CC Christoph Hellwig <[email protected]>
---
 hw/s390-virtio-bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/s390-virtio-bus.c +1 -1
index fa0a74f..9fc01e9 100644
@@ -123,7 +123,7 @@ static int s390_virtio_blk_init(VirtIOS390Device *dev)
 {
     VirtIODevice *vdev;
 
-    vdev = virtio_blk_init((DeviceState *)dev, dev->block.dinfo);
+    vdev = virtio_blk_init((DeviceState *)dev, &dev->block);
     if (!vdev) {
         return -1;
     }
Signature · 1 line
1.6.2.5
author
#2 lore raw

PATCH 2/3 s390: Add a 0.12 machine type for compatibility

Add a 0.12 s390-virtio machine type for compatibility with older versions.

---
 hw/s390-virtio.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
hw/s390-virtio.c +13 -1
index 3582728..a3cbfb6 100644
@@ -242,7 +242,7 @@ static void s390_init(ram_addr_t ram_size,
 }
 
 static QEMUMachine s390_machine = {
-    .name = "s390-virtio",
+    .name = "s390-virtio-0.13",
     .alias = "s390",
     .desc = "VirtIO based S390 machine",
     .init = s390_init,
@@ -254,9 +254,21 @@ static QEMUMachine s390_machine = {
     .is_default = 1,
 };
 
+static QEMUMachine s390_machine_v0_12 = {
+    .name = "s390-virtio-0.12",
+    .desc = "VirtIO based S390 machine for v0.12 compatibility",
+    .init = s390_init,
+    .no_serial = 1,
+    .no_parallel = 1,
+    .use_virtcon = 1,
+    .no_vga = 1,
+    .max_cpus = 255,
+};
+
 static void s390_machine_init(void)
 {
     qemu_register_machine(&s390_machine);
+    qemu_register_machine(&s390_machine_v0_12);
 }
 
 machine_init(s390_machine_init);
Signature · 1 line
1.6.2.5
author
#3 lore raw

PATCH 3/3 s390-virtio: Disable new virtio-serial features for 0.12 machine type

Disable the MULTIPORT feature and MSI vectors for the 0.12 machine types; those features are added only for 0.13 onwards.

---
 hw/s390-virtio.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
hw/s390-virtio.c +12 -0
index a3cbfb6..f027521 100644
@@ -263,6 +263,18 @@ static QEMUMachine s390_machine_v0_12 = {
     .use_virtcon = 1,
     .no_vga = 1,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "virtio-serial-s390",
+            .property = "max_nr_ports",
+            .value    = stringify(1),
+        },{
+            .driver   = "virtio-serial-s390",
+            .property = "vectors",
+            .value    = stringify(0),
+        },
+        { /* end of list */ }
+  },
 };
 
 static void s390_machine_init(void)
Signature · 1 line
1.6.2.5
#4 lore raw

Re: [Qemu-devel] [PATCH 1/3] s390-virtio: Fix compile error for virtio-block init

In reply to Amit Shah
Quoted 6 lines · Amit Shah

Commit 428c149b0be790b440e1cbee185b152cdb22feec modified the argument that virtio_blk_init takes. Update the s390 bus code that calls this function.

CC Christoph Hellwig <[email protected]>

Thanks, applied.

Quoted 23 lines
---
 hw/s390-virtio-bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/s390-virtio-bus.c +1 -1
index fa0a74f..9fc01e9 100644
@@ -123,7 +123,7 @@ static int s390_virtio_blk_init(VirtIOS390Device *dev)
 {
     VirtIODevice *vdev;
 
-    vdev = virtio_blk_init((DeviceState *)dev, dev->block.dinfo);
+    vdev = virtio_blk_init((DeviceState *)dev, &dev->block);
     if (!vdev) {
         return -1;
     }
Signature · 1 line
1.6.2.5
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#5 lore raw
In reply to Amit Shah

Hi Amit,

Quoted 7 lines · Amit Shah

Hello,

This series fixes a compile error and adds 0.12 and 0.13 machine types, disabling newer virtio-serial features for 0.12.

Note: The name for the machine type changes from s390-virtio to s390-virtio-vXX, this may not be compatible for 0.12.

Cool, thanks for doing this!

I'm fairly sure that we don't need a 0.12 compatibility machine though. There's no save/restore on S390 yet and your extensions work just fine with older kernels. So for the sake of simplicity I'd say leave it as is :-).

The compile fix would be good to apply nevertheless.

Alex