Skip to contentSkip to conversation

pc: Bump up pc version to 0.13 and add a 0.12 compat version

PATCH Superseded Amit Shah 2 participants 5 messages Feb 15, 2010

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Amit Shah

author
#0 lore raw

PATCH 1/3 pc: Bump up pc version to 0.13 and add a 0.12 compat version

The version 0.13 will be the new default and compatibility options will be added to the 0.12 version.

---
 hw/pc.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
hw/pc.c +8 -1
index 6fbe98b..7c9a24e 100644
@@ -1052,7 +1052,7 @@ void cmos_set_s3_resume(void)
 }
 
 static QEMUMachine pc_machine = {
-    .name = "pc-0.12",
+    .name = "pc-0.13",
     .alias = "pc",
     .desc = "Standard PC",
     .init = pc_init_pci,
@@ -1060,6 +1060,13 @@ static QEMUMachine pc_machine = {
     .is_default = 1,
 };
 
+static QEMUMachine pc_machine_v0_12 = {
+    .name = "pc-0.12",
+    .desc = "Standard PC",
+    .init = pc_init_pci,
+    .max_cpus = 255,
+};
+
 static QEMUMachine pc_machine_v0_11 = {
     .name = "pc-0.11",
     .desc = "Standard PC, qemu 0.11",
Signature · 1 line
1.6.2.5
author
#1 lore raw

PATCH 2/3 pc: Add backward compatibility options for virtio-serial

virtio-serial-pci can support multiple ports in the current development version that will become 0.13. Add compatibility options for the 0.12 and 0.11 pc machine types.

---
 hw/pc.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
hw/pc.c +29 -0
index 7c9a24e..49a95ba 100644
@@ -1065,6 +1065,18 @@ static QEMUMachine pc_machine_v0_12 = {
     .desc = "Standard PC",
     .init = pc_init_pci,
     .max_cpus = 255,
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "virtio-serial-pci",
+            .property = "max_nr_ports",
+            .value    = stringify(1),
+        },{
+            .driver   = "virtio-serial-pci",
+            .property = "vectors",
+            .value    = stringify(0),
+        },
+        { /* end of list */ }
+    }
 };
 
 static QEMUMachine pc_machine_v0_11 = {
@@ -1078,6 +1090,14 @@ static QEMUMachine pc_machine_v0_11 = {
             .property = "vectors",
             .value    = stringify(0),
         },{
+            .driver   = "virtio-serial-pci",
+            .property = "max_nr_ports",
+            .value    = stringify(1),
+        },{
+            .driver   = "virtio-serial-pci",
+            .property = "vectors",
+            .value    = stringify(0),
+        },{
             .driver   = "ide-drive",
             .property = "ver",
             .value    = "0.11",
@@ -1109,6 +1129,14 @@ static QEMUMachine pc_machine_v0_10 = {
             .property = "class",
             .value    = stringify(PCI_CLASS_DISPLAY_OTHER),
         },{
+            .driver   = "virtio-serial-pci",
+            .property = "max_nr_ports",
+            .value    = stringify(1),
+        },{
+            .driver   = "virtio-serial-pci",
+            .property = "vectors",
+            .value    = stringify(0),
+        },{
             .driver   = "virtio-net-pci",
             .property = "vectors",
             .value    = stringify(0),
@@ -1143,6 +1171,7 @@ static QEMUMachine isapc_machine = {
 static void pc_machine_init(void)
 {
     qemu_register_machine(&pc_machine);
+    qemu_register_machine(&pc_machine_v0_12);
     qemu_register_machine(&pc_machine_v0_11);
     qemu_register_machine(&pc_machine_v0_10);
     qemu_register_machine(&isapc_machine);
Signature · 1 line
1.6.2.5
author
#2 lore raw

PATCH 3/3 virtio-serial: don't set MULTIPORT for 1 port dev

From: Michael S. Tsirkin <[email protected]>

Since commit 98b19252cf1bd97c54bc4613f3537c5ec0aae263, all serial devices declare MULTIPORT feature.
To allow 0.12 compatibility, we should clear this when max_nr_ports is 1.

---
 hw/virtio-serial-bus.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
hw/virtio-serial-bus.c +4 -2
index ab456ea..d0e0219 100644
@@ -335,8 +335,10 @@ static void handle_input(VirtIODevice *vdev, VirtQueue *vq)
 
 static uint32_t get_features(VirtIODevice *vdev, uint32_t features)
 {
-    features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT);
-
+    VirtIOSerial *vser = DO_UPCAST(VirtIOSerial, vdev, vdev);
+    if (vser->bus->max_nr_ports > 1) {
+        features |= (1 << VIRTIO_CONSOLE_F_MULTIPORT);
+    }
     return features;
 }
 
Signature · 1 line
1.6.2.5
#3 lore raw

[Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial

In reply to Amit Shah

hw/pc.c static QEMUMachine isapc_machine = { · line 1177

Quoted 8 lines
hw/pc.c +1 -0
@@ -1143,6 +1171,7 @@ static QEMUMachine isapc_machine = {
  static void pc_machine_init(void)
  {
      qemu_register_machine(&pc_machine);
+    qemu_register_machine(&pc_machine_v0_12);
      qemu_register_machine(&pc_machine_v0_11);
      qemu_register_machine(&pc_machine_v0_10);
      qemu_register_machine(&isapc_machine);

This chunk should have been in patch 1/3.
Otherwise the whole series looks fine to me.

cheers,
Gerd

author
#4 lore raw

[Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial

Quoted 11 lines · Gerd Hoffmann

hw/pc.c static QEMUMachine isapc_machine = { · line 1177

Quoted 8 lines
hw/pc.c +1 -0
@@ -1143,6 +1171,7 @@ static QEMUMachine isapc_machine = {
  static void pc_machine_init(void)
  {
      qemu_register_machine(&pc_machine);
+    qemu_register_machine(&pc_machine_v0_12);
      qemu_register_machine(&pc_machine_v0_11);
      qemu_register_machine(&pc_machine_v0_10);
      qemu_register_machine(&isapc_machine);

This chunk should have been in patch 1/3.
Otherwise the whole series looks fine to me.

Yep, missed that. Fixed in v2.

Amit