Skip to contentSkip to conversation

xen: make xen-platform a default device

PATCH Applied Gerd Hoffmann 7 participants 23 messages May 22, 2014 – May 23, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: make xen-platform a default device

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

---
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c +1 -1
index eaf3e61..f987d03 100644
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h +1 -0
index 85fda3d..b350413 100644
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +3 -0
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;
 static int default_cdrom = 1;
 static int default_sdcard = 1;
 static int default_vga = 1;
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }
 
     if (is_daemonized()) {
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

Quoted 5 lines

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Applied, thanks!

Quoted 61 lines
---
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c +1 -1
index eaf3e61..f987d03 100644
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h +1 -0
index 85fda3d..b350413 100644
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +3 -0
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;
 static int default_cdrom = 1;
 static int default_sdcard = 1;
 static int default_vga = 1;
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }
 
     if (is_daemonized()) {
Signature · 1 line
1.8.3.1
#2 lore raw
Quoted 9 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael S. Tsirkin
Sent: Thursday, May 22, 2014 3:22 PM
To: Gerd Hoffmann
Cc: [email protected]; Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] xen: make xen-platform a default device

Quoted 13 lines
Quoted 12 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Sorry, I'm not sure if this works well as Gerd expect.

I already reply something online, please take a look at that before apply.

Thanks
Tiejun

Quoted 65 lines
Quoted 1 line

Applied, thanks!

hw/i386/pc_piix.c static void pc_xen_hvm_init(QEMUMachineInitArgs

Quoted 11 lines
---
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0 -0

eaf3e61..f987d03 100644

hw/i386/pc_piix.c +0 -0
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs

*args)

Quoted 49 lines
hw/i386/pc_piix.c +1 -1
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h index renamed from include/hw/xen/xen.h +0 -0

85fda3d..b350413 100644

include/hw/xen/xen.h +1 -0
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +0 -0
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;  static int

default_cdrom = 1; static int default_sdcard = 1; static int default_vga = 1;

vl.c +2 -0
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = { @@ -4101,6 +4103,7 @@ int

main(int argc, char **argv, char **envp)

         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }

     if (is_daemonized()) {

--
1.8.3.1

#3 lore raw
Quoted 21 lines · Tiejun
Quoted 21 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael S. Tsirkin
Sent: Thursday, May 22, 2014 3:22 PM
To: Gerd Hoffmann
Cc: [email protected]; Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] xen: make xen-platform a default device

Quoted 11 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

Sorry, I'm not sure if this works well as Gerd expect.

I already reply something online, please take a look at that before apply.

Thanks
Tiejun

No worries, I'll wait.

Quoted 65 lines
Quoted 65 lines
Quoted 1 line

Applied, thanks!

hw/i386/pc_piix.c static void pc_xen_hvm_init(QEMUMachineInitArgs

Quoted 11 lines
---
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c index renamed from hw/i386/pc_piix.c +0 -0

eaf3e61..f987d03 100644

hw/i386/pc_piix.c +0 -0
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs

*args)

Quoted 49 lines
hw/i386/pc_piix.c +1 -1
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h index renamed from include/hw/xen/xen.h +0 -0

85fda3d..b350413 100644

include/hw/xen/xen.h +1 -0
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +0 -0
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;  static int

default_cdrom = 1; static int default_sdcard = 1; static int default_vga = 1;

vl.c +2 -0
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = { @@ -4101,6 +4103,7 @@ int

main(int argc, char **argv, char **envp)

         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }

     if (is_daemonized()) {

--
1.8.3.1

#4 lore raw
In reply to Gerd Hoffmann
Quoted 8 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

Quoted 5 lines

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Quoted 62 lines
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c +1 -1
index eaf3e61..f987d03 100644
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h +1 -0
index 85fda3d..b350413 100644
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +3 -0
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;
 static int default_cdrom = 1;
 static int default_sdcard = 1;
 static int default_vga = 1;
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }
 
     if (is_daemonized()) {
Signature · 1 line
1.8.3.1
#5 lore raw
Quoted 12 lines · Stefano Stabellini
Quoted 11 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Quoted 9 lines
Quoted 2 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Yes, it's an unfortunate use of the interface.
How about a new machine type for xenfv - that's the only one that's affected, right?
It's time xen started versioning qemu hardware anyway.

Quoted 62 lines
Quoted 62 lines
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c +1 -1
index eaf3e61..f987d03 100644
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h +1 -0
index 85fda3d..b350413 100644
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +3 -0
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;
 static int default_cdrom = 1;
 static int default_sdcard = 1;
 static int default_vga = 1;
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }
 
     if (is_daemonized()) {
Signature · 1 line
1.8.3.1
#6 lore raw
Quoted 23 lines · Michael S. Tsirkin
Quoted 12 lines · Stefano Stabellini
Quoted 11 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Quoted 9 lines
Quoted 2 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Quoted 4 lines

Yes, it's an unfortunate use of the interface.
How about a new machine type for xenfv - that's the only one that's affected, right?
It's time xen started versioning qemu hardware anyway.

That would do the trick for sure. Question is what versioning scheme. Might be useful for xen machine types to version after xen releases, i.e. xenfv-4.4 would would be supposed to be compatible with the xen-4.4 toolstack etc.

cheers,
Gerd

#7 lore raw
Quoted 29 lines · Gerd Hoffmann
Quoted 23 lines · Michael S. Tsirkin
Quoted 12 lines · Stefano Stabellini
Quoted 11 lines · Gerd Hoffmann

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Quoted 9 lines
Quoted 2 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Quoted 4 lines

Yes, it's an unfortunate use of the interface.
How about a new machine type for xenfv - that's the only one that's affected, right?
It's time xen started versioning qemu hardware anyway.

Quoted 8 lines

That would do the trick for sure. Question is what versioning scheme. Might be useful for xen machine types to version after xen releases, i.e. xenfv-4.4 would would be supposed to be compatible with the xen-4.4 toolstack etc.

cheers,
Gerd

It's much easier for us to version it with qemu machine version, like we do for pc, if that can work at all.

#8 lore raw
In reply to Stefano Stabellini

Hi,

Quoted 5 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Indeed.

Quoted 6 lines

vl.c int main(int argc, char **argv, char **envp) · line 4107

Quoted 6 lines
vl.c +1 -0
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }

With that chunk removed -nodefaults will have no effect for the xen platform device, but explicitly moving it somewhere else via -device xen-platform,addr=$slot should still work.

cheers,
Gerd

#9 lore raw
Quoted 10 lines · Gerd Hoffmann

Hi,

Quoted 5 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Indeed.

Quoted 10 lines
Quoted 6 lines

vl.c int main(int argc, char **argv, char **envp) · line 4107

Quoted 6 lines
vl.c +1 -0
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }

With that chunk removed -nodefaults will have no effect for the xen platform device, but explicitly moving it somewhere else via -device xen-platform,addr=$slot should still work.

That could work.

#10 lore raw
In reply to Stefano Stabellini

Il 22/05/2014 14:11, Stefano Stabellini ha scritto:

Quoted 12 lines · Gerd Hoffmann
Quoted 11 lines

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Quoted 8 lines
Quoted 2 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

Paolo

Quoted 65 lines
Quoted 63 lines
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c +1 -1
index eaf3e61..f987d03 100644
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h +1 -0
index 85fda3d..b350413 100644
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +3 -1
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;
 static int default_cdrom = 1;
 static int default_sdcard = 1;
 static int default_vga = 1;
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }
 
     if (is_daemonized()) {
--

1.8.3.1

#11 lore raw
Quoted 11 lines
Quoted 6 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and pc machine types are guarded by if (xen_enabled()) these days, except for adding the platform device.

So using the pc machine type should just work on xen, and give you a machine without the platform device. So it can be added via -device, at any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on the xen_platform_pci switch in the config file.

cheers,
Gerd

#12 lore raw
Quoted 15 lines · Gerd Hoffmann
Quoted 10 lines
Quoted 5 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and pc machine types are guarded by if (xen_enabled()) these days, except for adding the platform device.

Quoted 5 lines

So using the pc machine type should just work on xen, and give you a machine without the platform device. So it can be added via -device, at any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on the xen_platform_pci switch in the config file.

I agree. Changing libxl to always use -M pc and using -device to add xen-platform when needed sounds like the best option.

#13 lore raw
Quoted 26 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 22 May 2014 14:57
To: Gerd Hoffmann
Cc: Paolo Bonzini; Stefano Stabellini; Paul Durrant; [email protected]; Anthony Liguori; [email protected]
Subject: Re: [PATCH] xen: make xen-platform a default device

Quoted 3 lines · Gerd Hoffmann
Quoted 3 lines
Quoted 3 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to

enable

Quoted 1 line
Quoted 1 line
Quoted 1 line

xen_platform_pci except for passing some magic command line runes

via

Quoted 11 lines
Quoted 6 lines
Quoted 1 line

device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and pc machine types are guarded by if (xen_enabled()) these days, except for adding the platform device.

Quoted 8 lines
Quoted 5 lines

So using the pc machine type should just work on xen, and give you a machine without the platform device. So it can be added via -device, at any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on the xen_platform_pci switch in the config file.

I agree. Changing libxl to always use -M pc and using -device to add xen-platform when needed sounds like the best option.

Really? You opposed this before:

http://lists.xen.org/archives/html/xen-devel/2013-06/msg01946.html

stating that you wanted a mechanism to query the running version of QEMU before choosing the machine type.

Paul

#14 lore raw
Quoted 32 lines · Paul Durrant
Quoted 32 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 22 May 2014 14:57
To: Gerd Hoffmann
Cc: Paolo Bonzini; Stefano Stabellini; Paul Durrant; [email protected]; Anthony Liguori; [email protected]
Subject: Re: [PATCH] xen: make xen-platform a default device

Quoted 3 lines · Gerd Hoffmann
Quoted 3 lines
Quoted 3 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to

enable

Quoted 1 line
Quoted 1 line
Quoted 1 line

xen_platform_pci except for passing some magic command line runes

via

Quoted 16 lines
Quoted 6 lines
Quoted 1 line

device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and pc machine types are guarded by if (xen_enabled()) these days, except for adding the platform device.

So using the pc machine type should just work on xen, and give you a machine without the platform device. So it can be added via -device, at any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on the xen_platform_pci switch in the config file.

Quoted 8 lines
Quoted 2 lines

I agree. Changing libxl to always use -M pc and using -device to add xen-platform when needed sounds like the best option.

Really? You opposed this before:

http://lists.xen.org/archives/html/xen-devel/2013-06/msg01946.html

stating that you wanted a mechanism to query the running version of QEMU before choosing the machine type.

Many QEMU releases have been made since then. I feel more comfortable with using -M pc, especially given the alternatives that have been proposed. Of course having a mechanism to query the running version of QEMU would still be the safest solution.

#15 lore raw
Quoted 53 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 23 May 2014 11:11
To: Paul Durrant
Cc: Stefano Stabellini; Gerd Hoffmann; Paolo Bonzini; qemu- [email protected]; Anthony Liguori; [email protected]
Subject: RE: [PATCH] xen: make xen-platform a default device

Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 22 May 2014 14:57
To: Gerd Hoffmann
Cc: Paolo Bonzini; Stefano Stabellini; Paul Durrant; qemu-

[email protected];

Quoted 5 lines
Quoted 5 lines

Anthony Liguori; [email protected]
Subject: Re: [PATCH] xen: make xen-platform a default device

Quoted 1 line · Gerd Hoffmann
Quoted 1 line
Quoted 1 line

Given that libxl always passes -nodefaults to QEMU, this patch is

going

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to

enable

Quoted 1 line
Quoted 1 line
Quoted 1 line

xen_platform_pci except for passing some magic command line

runes

Quoted 6 lines
Quoted 6 lines

via

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-

M

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and pc machine types are guarded by if (xen_enabled()) these days, except

for

Quoted 15 lines
Quoted 10 lines
Quoted 7 lines

adding the platform device.

So using the pc machine type should just work on xen, and give you a machine without the platform device. So it can be added via -device, at any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on the xen_platform_pci switch in the config file.

I agree. Changing libxl to always use -M pc and using -device to add xen-platform when needed sounds like the best option.

Really? You opposed this before:

http://lists.xen.org/archives/html/xen-devel/2013-06/msg01946.html

Quoted 7 lines
Quoted 1 line

stating that you wanted a mechanism to query the running version of

QEMU before choosing the machine type.

Many QEMU releases have been made since then. I feel more comfortable with using -M pc, especially given the alternatives that have been proposed. Of course having a mechanism to query the running version of QEMU would still be the safest solution.

But I thought the problem was that, should someone change what 'pc' means, then libxl would invoke the 'wrong' machine type on a domain restore. I know that xenfv is essentially 'pc' at the moment but would could fix on a particular version if compatibility becomes an issue. So, rather than choosing 'pc' now, should we not choose 'pc-i440fx-1.6' which is the current default?

Paul

#16 lore raw
Quoted 54 lines · Paul Durrant
Quoted 54 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 23 May 2014 11:11
To: Paul Durrant
Cc: Stefano Stabellini; Gerd Hoffmann; Paolo Bonzini; qemu- [email protected]; Anthony Liguori; [email protected]
Subject: RE: [PATCH] xen: make xen-platform a default device

Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 22 May 2014 14:57
To: Gerd Hoffmann
Cc: Paolo Bonzini; Stefano Stabellini; Paul Durrant; qemu-

[email protected];

Quoted 5 lines
Quoted 5 lines

Anthony Liguori; [email protected]
Subject: Re: [PATCH] xen: make xen-platform a default device

Quoted 1 line · Gerd Hoffmann
Quoted 1 line
Quoted 1 line

Given that libxl always passes -nodefaults to QEMU, this patch is

going

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to

enable

Quoted 1 line
Quoted 1 line
Quoted 1 line

xen_platform_pci except for passing some magic command line

runes

Quoted 6 lines
Quoted 6 lines

via

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-

M

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and pc machine types are guarded by if (xen_enabled()) these days, except

for

Quoted 16 lines
Quoted 10 lines
Quoted 7 lines

adding the platform device.

So using the pc machine type should just work on xen, and give you a machine without the platform device. So it can be added via -device, at any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on the xen_platform_pci switch in the config file.

I agree. Changing libxl to always use -M pc and using -device to add xen-platform when needed sounds like the best option.

Really? You opposed this before:

http://lists.xen.org/archives/html/xen-devel/2013-06/msg01946.html

stating that you wanted a mechanism to query the running version of

Quoted 8 lines
Quoted 6 lines

QEMU before choosing the machine type.

Many QEMU releases have been made since then. I feel more comfortable with using -M pc, especially given the alternatives that have been proposed. Of course having a mechanism to query the running version of QEMU would still be the safest solution.

But I thought the problem was that, should someone change what 'pc' means, then libxl would invoke the 'wrong' machine type on a domain restore. I know that xenfv is essentially 'pc' at the moment but would could fix on a particular version if compatibility becomes an issue. So, rather than choosing 'pc' now, should we not choose 'pc-i440fx-1.6' which is the current default?

One issue is that -M pc didn't always work with Xen. Now it does and we are already relying on it in libxl since 2bc047635b51abd41c917aa2b813211ee0de2c38. It is safe because all QEMU releases from 1.6 onward work well with Xen and -M pc. Older QEMU releases are considered ancient and unmaintained. This is what I was referring to in my last reply. I really meant "we should move away from xenfv and use a pc.* machine that does not create xen-platform by default".

As you say the other issue is the version of the pc machine, especially in relation to save/restore. However since:

commit 2bc047635b51abd41c917aa2b813211ee0de2c38

Author: Anthony PERARD <[email protected]>
Date:   Wed Nov 27 18:21:34 2013 +0000

libxl: Handle xen_platform_pci=0 case with qemu-xen.

we are simply calling QEMU with -M pc if xen_platform_pci=0. I think we should change that too and backport the patch to 4.4. pc-i440fx-1.6 seems like a good choice to me.

#17 lore raw
Quoted 100 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 23 May 2014 12:37
To: Paul Durrant
Cc: Stefano Stabellini; Gerd Hoffmann; Paolo Bonzini; qemu- [email protected]; Anthony Liguori; [email protected]; Anthony Perard
Subject: RE: [PATCH] xen: make xen-platform a default device

Quoted 14 lines · Paul Durrant
Quoted 14 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 23 May 2014 11:11
To: Paul Durrant
Cc: Stefano Stabellini; Gerd Hoffmann; Paolo Bonzini; qemu- [email protected]; Anthony Liguori; [email protected]
Subject: RE: [PATCH] xen: make xen-platform a default device

Quoted 5 lines · Paul Durrant
Quoted 5 lines

-----Original Message-----
From: Stefano Stabellini [mailto:[email protected]]
Sent: 22 May 2014 14:57
To: Gerd Hoffmann
Cc: Paolo Bonzini; Stefano Stabellini; Paul Durrant; qemu-

Quoted 8 lines
Quoted 8 lines

[email protected];

Quoted 5 lines
Quoted 5 lines

Anthony Liguori; [email protected]
Subject: Re: [PATCH] xen: make xen-platform a default device

Quoted 1 line · Gerd Hoffmann
Quoted 1 line
Quoted 1 line

Given that libxl always passes -nodefaults to QEMU, this patch is

going

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

to effectively disable xen_platform_pci for all Xen users. It is not

a

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

good idea. With the patch applied a Xen user would have no way

to

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

enable

Quoted 1 line
Quoted 1 line
Quoted 1 line

xen_platform_pci except for passing some magic command line

runes

Quoted 5 lines
Quoted 5 lines

via

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

device_model_args_hvm.

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would

be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

worthwhile to do the opposite, i.e. add the xen-platform device

to "-

Quoted 4 lines
Quoted 4 lines

M

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

pc" if not using -nodefaults.

/me looks at the code. Yes, all the differences between xenfv and

pc

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

machine types are guarded by if (xen_enabled()) these days,

except

Quoted 4 lines
Quoted 4 lines

for

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

adding the platform device.

So using the pc machine type should just work on xen, and give you

a

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

machine without the platform device. So it can be added via -

device, at

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

any slot, if needed. No need to patch qemu at all. Adding or not adding xen-platform can easily handled by libxl then, depending on

the

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 1 line

xen_platform_pci switch in the config file.

I agree. Changing libxl to always use -M pc and using -device to add xen-platform when needed sounds like the best option.

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Really? You opposed this before:

http://lists.xen.org/archives/html/xen-devel/2013-06/msg01946.html

stating that you wanted a mechanism to query the running version of

QEMU before choosing the machine type.

Many QEMU releases have been made since then. I feel more

comfortable

Quoted 5 lines
Quoted 3 lines

with using -M pc, especially given the alternatives that have been proposed. Of course having a mechanism to query the running version of QEMU would still be the safest solution.

But I thought the problem was that, should someone change what 'pc'

means, then libxl would invoke the 'wrong' machine type on a domain restore. I know that xenfv is essentially 'pc' at the moment but would could fix on a particular version if compatibility becomes an issue. So, rather than choosing 'pc' now, should we not choose 'pc-i440fx-1.6' which is the current default?

One issue is that -M pc didn't always work with Xen. Now it does and we are already relying on it in libxl since 2bc047635b51abd41c917aa2b813211ee0de2c38. It is safe because all QEMU releases from 1.6 onward work well with Xen and -M pc. Older QEMU releases are considered ancient and unmaintained. This is what I was referring to in my last reply. I really meant "we should move away from xenfv and use a pc.* machine that does not create xen-platform by default".

As you say the other issue is the version of the pc machine, especially in relation to save/restore. However since:

commit 2bc047635b51abd41c917aa2b813211ee0de2c38

Quoted 8 lines
Author: Anthony PERARD <[email protected]>
Date:   Wed Nov 27 18:21:34 2013 +0000

libxl: Handle xen_platform_pci=0 case with qemu-xen.

we are simply calling QEMU with -M pc if xen_platform_pci=0. I think we should change that too and backport the patch to 4.4. pc-i440fx-1.6 seems like a good choice to me.

Yep - that sounds good.

Paul

#18 lore raw
In reply to Stefano Stabellini
Quoted 13 lines

One issue is that -M pc didn't always work with Xen. Now it does and we are already relying on it in libxl since 2bc047635b51abd41c917aa2b813211ee0de2c38. It is safe because all QEMU releases from 1.6 onward work well with Xen and -M pc. Older QEMU releases are considered ancient and unmaintained. This is what I was referring to in my last reply. I really meant "we should move away from xenfv and use a pc.* machine that does not create xen-platform by default".

As you say the other issue is the version of the pc machine, especially in relation to save/restore. However since:

commit 2bc047635b51abd41c917aa2b813211ee0de2c38

Quoted 8 lines
Author: Anthony PERARD <address@hidden>
Date:   Wed Nov 27 18:21:34 2013 +0000

libxl: Handle xen_platform_pci=0 case with qemu-xen.

we are simply calling QEMU with -M pc if xen_platform_pci=0. I think we should change that too and backport the patch to 4.4. pc-i440fx-1.6 seems like a good choice to me.

Use "-M pc" as default seems a good idea.
Use specific version maybe too.
This way the base hardware should stay the same even if updating qemu, is right? If yes, this should also solve possible problem like windows reactivation request for different hardware, right? How about create also xl parameter to select the "pc" model?

Thanks for any reply and sorry for my bad english.

#19 lore raw
Quoted 18 lines · Fabio Fantoni
Quoted 18 lines

One issue is that -M pc didn't always work with Xen. Now it does and we are already relying on it in libxl since 2bc047635b51abd41c917aa2b813211ee0de2c38. It is safe because all QEMU releases from 1.6 onward work well with Xen and -M pc. Older QEMU releases are considered ancient and unmaintained. This is what I was referring to in my last reply. I really meant "we should move away from xenfv and use a pc.* machine that does not create xen-platform by default".

As you say the other issue is the version of the pc machine, especially in relation to save/restore. However since:

commit 2bc047635b51abd41c917aa2b813211ee0de2c38

Author: Anthony PERARD <address@hidden>
Date:   Wed Nov 27 18:21:34 2013 +0000

libxl: Handle xen_platform_pci=0 case with qemu-xen.

Quoted 8 lines
Quoted 3 lines

we are simply calling QEMU with -M pc if xen_platform_pci=0. I think we should change that too and backport the patch to 4.4. pc-i440fx-1.6 seems like a good choice to me.

Use "-M pc" as default seems a good idea.
Use specific version maybe too.
This way the base hardware should stay the same even if updating qemu, is right?

Yep

Quoted 2 lines

If yes, this should also solve possible problem like windows reactivation request for different hardware, right?

Right

Quoted 1 line

How about create also xl parameter to select the "pc" model?

Having a VM config parameter for it is OK. In the past I argued against relying on such a parameter to solve all compatibility issues with QEMU because I would like libxl to be able to select the right QEMU machine automatically, without user intervention. But the option could still be useful for debugging.

#20 lore raw

Il 23/05/2014 16:30, Stefano Stabellini ha scritto:

Quoted 34 lines · Fabio Fantoni
Quoted 18 lines
Quoted 18 lines

One issue is that -M pc didn't always work with Xen. Now it does and we are already relying on it in libxl since 2bc047635b51abd41c917aa2b813211ee0de2c38. It is safe because all QEMU releases from 1.6 onward work well with Xen and -M pc. Older QEMU releases are considered ancient and unmaintained. This is what I was referring to in my last reply. I really meant "we should move away from xenfv and use a pc.* machine that does not create xen-platform by default".

As you say the other issue is the version of the pc machine, especially in relation to save/restore. However since:

commit 2bc047635b51abd41c917aa2b813211ee0de2c38

Author: Anthony PERARD <address@hidden>
Date:   Wed Nov 27 18:21:34 2013 +0000

libxl: Handle xen_platform_pci=0 case with qemu-xen.

Quoted 7 lines
Quoted 3 lines

we are simply calling QEMU with -M pc if xen_platform_pci=0. I think we should change that too and backport the patch to 4.4. pc-i440fx-1.6 seems like a good choice to me.

Use "-M pc" as default seems a good idea.
Use specific version maybe too.
This way the base hardware should stay the same even if updating qemu, is right?

Yep

Quoted 2 lines

If yes, this should also solve possible problem like windows reactivation request for different hardware, right?

Right

Quoted 7 lines
Quoted 1 line

How about create also xl parameter to select the "pc" model?

Having a VM config parameter for it is OK. In the past I argued against relying on such a parameter to solve all compatibility issues with QEMU because I would like libxl to be able to select the right QEMU machine automatically, without user intervention. But the option could still be useful for debugging.

Excellent

#21 lore raw
In reply to Paolo Bonzini
Quoted 22 lines · Paolo Bonzini

Il 22/05/2014 14:11, Stefano Stabellini ha scritto:

Quoted 12 lines · Gerd Hoffmann
Quoted 11 lines

Patch hooks up the xen platform device to the default device code we have in qemu. Two effects:

(1) The device will not be created in case -nodefaults is specified on the command line.
(2) Autocreating the device is also turned off in case xen-platform is added manually via -device.

With the patch applied you can move the xen-platform device to some other place with a simple 'qemu -device xen-platform,addr=$slot'.

Quoted 8 lines
Quoted 2 lines

Given that libxl always passes -nodefaults to QEMU, this patch is going to effectively disable xen_platform_pci for all Xen users. It is not a good idea. With the patch applied a Xen user would have no way to enable xen_platform_pci except for passing some magic command line runes via device_model_args_hvm.

Quoted 4 lines

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

Unfortunately that would not work too. libxl exploits the fact that -M pc does not have a xen-platform device by default:

    case LIBXL_DOMAIN_TYPE_HVM:
        if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
            /* Switching here to the machine "pc" which does not add
             * the xen-platform device instead of the default "xenfv" machine.
             */
            flexarray_append(dm_args, "pc,accel=xen");
        } else {
            flexarray_append(dm_args, "xenfv");
        }

We could/should change libxl to always use -M pc but I would still rather avoid changing the existing interface between libxl and QEMU. Versioning xenfv or using a new pc machine is OK though.

Quoted 65 lines
Quoted 64 lines
Quoted 62 lines
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)
hw/i386/pc_piix.c +1 -1
index eaf3e61..f987d03 100644
@@ -385,7 +385,7 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args)
     pc_init_pci(args);
 
     bus = pci_find_primary_bus();
-    if (bus != NULL) {
+    if (bus != NULL && default_xenplatform) {
         pci_create_simple(bus, -1, "xen-platform");
     }
 }
include/hw/xen/xen.h +1 -0
index 85fda3d..b350413 100644
@@ -20,6 +20,7 @@ enum xen_mode {
 
 extern uint32_t xen_domid;
 extern enum xen_mode xen_mode;
+extern int default_xenplatform;
 
 extern bool xen_allowed;
 
vl.c +3 -1
index 709d8cd..673148e 100644
@@ -226,6 +226,7 @@ static int default_floppy = 1;
 static int default_cdrom = 1;
 static int default_sdcard = 1;
 static int default_vga = 1;
+int default_xenplatform = 1;
 
 static struct {
     const char *driver;
@@ -247,6 +248,7 @@ static struct {
     { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
     { .driver = "vmware-svga",          .flag = &default_vga       },
     { .driver = "qxl-vga",              .flag = &default_vga       },
+    { .driver = "xen-platform",         .flag = &default_xenplatform },
 };
 
 static QemuOptsList qemu_rtc_opts = {
@@ -4101,6 +4103,7 @@ int main(int argc, char **argv, char **envp)
         default_monitor = 0;
         default_net = 0;
         default_vga = 0;
+        default_xenplatform = 0;
     }
 
     if (is_daemonized()) {
--

1.8.3.1

#22 lore raw

Il 22/05/2014 15:55, Stefano Stabellini ha scritto:

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

In fact this code only runs for "-M xenfv". If you use "-M pc", the xen-platform device has to be added manually. Perhaps it would be worthwhile to do the opposite, i.e. add the xen-platform device to "-M pc" if not using -nodefaults.

Unfortunately that would not work too. libxl exploits the fact that -M pc does not have a xen-platform device by default:

It wouldn't affect libxl, since it uses -nodefaults too (thus the xen-platform device would not be auto-added for -M pc).

Paolo