pc: Add backward compatibility options for virtio-serial
authorAmit Shah <amit.shah@redhat.com>
Mon, 15 Feb 2010 15:13:55 +0000 (20:43 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 19 Feb 2010 21:32:16 +0000 (15:32 -0600)
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.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pc.c

diff --git a/hw/pc.c b/hw/pc.c
index c27ad0f2cfc0d1a499656ef5a34f69c0ae63d945..49a95baf2b69e9f03adfa73044b382c5ee3a71c7 100644 (file)
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -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 = {
@@ -1077,6 +1089,14 @@ static QEMUMachine pc_machine_v0_11 = {
             .driver   = "virtio-blk-pci",
             .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",
@@ -1108,6 +1128,14 @@ static QEMUMachine pc_machine_v0_10 = {
             .driver   = "virtio-serial-pci",
             .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",