qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/3] pc: Bump up pc version to 0.13 and add a 0.12 compat version
@ 2010-02-15 13:31 Amit Shah
  2010-02-15 13:31 ` [Qemu-devel] [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Amit Shah
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Shah @ 2010-02-15 13:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Amit Shah, kraxel

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

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/pc.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 6fbe98b..7c9a24e 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -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",
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/3] pc: Add backward compatibility options for virtio-serial
  2010-02-15 13:31 [Qemu-devel] [PATCH 1/3] pc: Bump up pc version to 0.13 and add a 0.12 compat version Amit Shah
@ 2010-02-15 13:31 ` Amit Shah
  2010-02-15 13:31   ` [Qemu-devel] [PATCH 3/3] virtio-serial: don't set MULTIPORT for 1 port dev Amit Shah
  2010-02-15 14:36   ` [Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Gerd Hoffmann
  0 siblings, 2 replies; 5+ messages in thread
From: Amit Shah @ 2010-02-15 13:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Amit Shah, kraxel

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(-)

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);
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 3/3] virtio-serial: don't set MULTIPORT for 1 port dev
  2010-02-15 13:31 ` [Qemu-devel] [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Amit Shah
@ 2010-02-15 13:31   ` Amit Shah
  2010-02-15 14:36   ` [Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Gerd Hoffmann
  1 sibling, 0 replies; 5+ messages in thread
From: Amit Shah @ 2010-02-15 13:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Amit Shah, kraxel, Michael S. Tsirkin

From: Michael S. Tsirkin <mst@redhat.com>

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

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-serial-bus.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index ab456ea..d0e0219 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -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;
 }
 
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial
  2010-02-15 13:31 ` [Qemu-devel] [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Amit Shah
  2010-02-15 13:31   ` [Qemu-devel] [PATCH 3/3] virtio-serial: don't set MULTIPORT for 1 port dev Amit Shah
@ 2010-02-15 14:36   ` Gerd Hoffmann
  2010-02-15 15:17     ` Amit Shah
  1 sibling, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2010-02-15 14:36 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu-devel

> @@ -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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial
  2010-02-15 14:36   ` [Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Gerd Hoffmann
@ 2010-02-15 15:17     ` Amit Shah
  0 siblings, 0 replies; 5+ messages in thread
From: Amit Shah @ 2010-02-15 15:17 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-15 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 13:31 [Qemu-devel] [PATCH 1/3] pc: Bump up pc version to 0.13 and add a 0.12 compat version Amit Shah
2010-02-15 13:31 ` [Qemu-devel] [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Amit Shah
2010-02-15 13:31   ` [Qemu-devel] [PATCH 3/3] virtio-serial: don't set MULTIPORT for 1 port dev Amit Shah
2010-02-15 14:36   ` [Qemu-devel] Re: [PATCH 2/3] pc: Add backward compatibility options for virtio-serial Gerd Hoffmann
2010-02-15 15:17     ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).