Patchwork [2/3] pc: Add backward compatibility options for virtio-serial

login
register
mail settings
Submitter Amit Shah
Date Feb. 15, 2010, 1:31 p.m.
Message ID <1266240696-17880-2-git-send-email-amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/45367/
State New
Headers show

Comments

Amit Shah - Feb. 15, 2010, 1:31 p.m.
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>
---
 hw/pc.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
Gerd Hoffmann - Feb. 15, 2010, 2:36 p.m.
> @@ -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
Amit Shah - Feb. 15, 2010, 3:17 p.m.
On (Mon) Feb 15 2010 [15:36:34], Gerd Hoffmann wrote:
>> @@ -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

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 7c9a24e..49a95ba 100644
--- 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 = {
@@ -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);