qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] xen: make xen-platform a default device
@ 2014-05-22  7:20 Gerd Hoffmann
  2014-05-22  7:21 ` Michael S. Tsirkin
  2014-05-22 12:11 ` Stefano Stabellini
  0 siblings, 2 replies; 23+ messages in thread
From: Gerd Hoffmann @ 2014-05-22  7:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori, mst

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'.

Tested-by: Tiejun Chen <tiejun.chen@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/i386/pc_piix.c    | 2 +-
 include/hw/xen/xen.h | 1 +
 vl.c                 | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index eaf3e61..f987d03 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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");
     }
 }
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index 85fda3d..b350413 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -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;
 
diff --git a/vl.c b/vl.c
index 709d8cd..673148e 100644
--- a/vl.c
+++ b/vl.c
@@ -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

^ permalink raw reply related	[flat|nested] 23+ messages in thread
* Re: [Qemu-devel] [PATCH] xen: make xen-platform a default device
@ 2014-05-23 13:03 Fabio Fantoni
  2014-05-23 14:30 ` Stefano Stabellini
  0 siblings, 1 reply; 23+ messages in thread
From: Fabio Fantoni @ 2014-05-23 13:03 UTC (permalink / raw)
  To: stefano.stabellini; +Cc: Anthony PERARD, xen-devel, qemu-devel@nongnu.org

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

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

end of thread, other threads:[~2014-05-23 15:02 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22  7:20 [Qemu-devel] [PATCH] xen: make xen-platform a default device Gerd Hoffmann
2014-05-22  7:21 ` Michael S. Tsirkin
2014-05-22 10:57   ` Chen, Tiejun
2014-05-22 10:59     ` Michael S. Tsirkin
2014-05-22 12:11 ` Stefano Stabellini
2014-05-22 12:35   ` Michael S. Tsirkin
2014-05-22 12:53     ` Gerd Hoffmann
2014-05-22 14:00       ` Michael S. Tsirkin
2014-05-22 12:45   ` Gerd Hoffmann
2014-05-22 13:49     ` Stefano Stabellini
2014-05-22 12:50   ` Paolo Bonzini
2014-05-22 13:22     ` Gerd Hoffmann
2014-05-22 13:56       ` Stefano Stabellini
2014-05-23 10:08         ` Paul Durrant
2014-05-23 10:11           ` Stefano Stabellini
2014-05-23 10:18             ` Paul Durrant
2014-05-23 11:36               ` Stefano Stabellini
2014-05-23 11:51                 ` Paul Durrant
2014-05-22 13:55     ` Stefano Stabellini
2014-05-22 14:03       ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2014-05-23 13:03 Fabio Fantoni
2014-05-23 14:30 ` Stefano Stabellini
2014-05-23 15:02   ` Fabio Fantoni

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