Received: from eggs.gnu.org ([2001:4830:134:3::10]:54808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVl7m-0005iv-C8 for qemu-devel@nongnu.org; Thu, 03 Apr 2014 13:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVl7d-0003tb-Bu for qemu-devel@nongnu.org; Thu, 03 Apr 2014 13:08:22 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:43555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVl7c-0003t1-Je for qemu-devel@nongnu.org; Thu, 03 Apr 2014 13:08:13 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Apr 2014 03:08:10 +1000 From: Nikunj A Dadhania In-Reply-To: <533D93EA.7000305@suse.de> References: <1396544174-8904-1-git-send-email-nikunj@linux.vnet.ibm.com> <533D93EA.7000305@suse.de> Date: Thu, 03 Apr 2014 22:37:58 +0530 Message-ID: <87y4zmxrwx.fsf@abhimanyu.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] spapr: skip adding usb keyboard/mouse in case of -nodefaults List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= , qemu-devel@nongnu.org Cc: aik@au1.ibm.com, Mark Wu , qemu-ppc@nongnu.org, Alexander Graf , Paolo Bonzini Andreas F=C3=A4rber writes: > Am 03.04.2014 18:56, schrieb Nikunj A Dadhania: >> The following commit caused the regression in qemu-system-ppc64 >>=20 >> 7effdaa3: spapr: Fix return value of vga initialization >> d44229c5: Fix vga_interface_type for command line argument '-device VGA' >>=20 >> Even when -nodefaults was provided, USB Keyboard and Mouse was added >> to the machine. This breaks libvirt which uses -nodefaults and adds >> the keyboard and mouse separately. The machine got 2 USB Keyboards >> and 2 USB Mouses. >>=20 >> CC: Paolo Bonzini >> CC: Mark Wu >> CC: Andreas F=C3=A4rber >> Signed-off-by: Nikunj A Dadhania >> --- >> hw/ppc/spapr.c | 6 +++++- >> include/sysemu/sysemu.h | 1 + >> vl.c | 10 ++++++++-- >> 3 files changed, 14 insertions(+), 3 deletions(-) >>=20 >> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c >> index a11e121..3095626 100644 >> --- a/hw/ppc/spapr.c >> +++ b/hw/ppc/spapr.c >> @@ -1328,7 +1328,11 @@ static void ppc_spapr_init(QEMUMachineInitArgs *a= rgs) >>=20=20 >> if (usb_enabled(spapr->has_graphics)) { >> pci_create_simple(phb->bus, -1, "pci-ohci"); >> - if (spapr->has_graphics) { >> + /* >> + * For VGA/VNC, by default add usb keyboard/mouse, if -nodefaul= ts >> + * provided skip adding usb keyboard/mouse >> + */ >> + if (spapr->has_graphics && qemu_has_defaults()) { >> usbdevice_create("keyboard"); >> usbdevice_create("mouse"); >> } >> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h >> index ba5c7f8..8e90ad0 100644 >> --- a/include/sysemu/sysemu.h >> +++ b/include/sysemu/sysemu.h >> @@ -200,6 +200,7 @@ DeviceState *get_boot_device(uint32_t position); >> QemuOpts *qemu_get_machine_opts(void); >>=20=20 >> bool usb_enabled(bool default_usb); >> +bool qemu_has_defaults(void); >>=20=20 >> extern QemuOptsList qemu_legacy_drive_opts; >> extern QemuOptsList qemu_common_drive_opts; >> diff --git a/vl.c b/vl.c >> index 9975e5a..6bf37a2 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -977,8 +977,14 @@ static void parse_name(QemuOpts *opts) >>=20=20 >> bool usb_enabled(bool default_usb) >> { >> - return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", >> - has_defaults && default_usb); >> + return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", >> + has_defaults && default_usb); >> +} >> + >> +bool qemu_has_defaults(void) >> +{ >> + fprintf(stderr, "has_d %d\n", has_defaults); > > Debugging leftover surely? Yes, you were too fast, i have sent updated mail just now. Thanks Nikunj