s390: Fix compile, add 0.12 machine type, backward compat
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(-)
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.
--- hw/s390-virtio-bus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/s390-virtio-bus.c +1 -1
@@ -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
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
@@ -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
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
@@ -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
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH 1/3] s390-virtio: Fix compile error for virtio-block init
In reply to Amit ShahQuoted 6 lines · Amit Shah
Commit
428c149b0be790b440e1cbee185b152cdb22feecmodified the argument thatvirtio_blk_inittakes. Update the s390 bus code that calls this function.Signed-off-by Amit Shah <[email protected]>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@@ -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
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