From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSRu-0003SL-UK for qemu-devel@nongnu.org; Thu, 22 May 2014 08:50:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnSRo-0005WA-Uu for qemu-devel@nongnu.org; Thu, 22 May 2014 08:50:18 -0400 Received: from mail-ee0-x233.google.com ([2a00:1450:4013:c00::233]:54688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSRo-0005Vq-JS for qemu-devel@nongnu.org; Thu, 22 May 2014 08:50:12 -0400 Received: by mail-ee0-f51.google.com with SMTP id e51so2528603eek.24 for ; Thu, 22 May 2014 05:50:11 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <537DF280.3090703@redhat.com> Date: Thu, 22 May 2014 14:50:08 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1400743250-2315-1-git-send-email-kraxel@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] xen: make xen-platform a default device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini , Gerd Hoffmann Cc: Paul Durrant , qemu-devel@nongnu.org, Anthony Liguori , mst@redhat.com Il 22/05/2014 14:11, Stefano Stabellini ha scritto: > On Thu, 22 May 2014, Gerd Hoffmann wrote: >> 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 >> Signed-off-by: Gerd Hoffmann > > 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 > >> 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 >> >> > >