From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRrcL-0007gX-QH for qemu-devel@nongnu.org; Tue, 08 May 2012 17:06:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRrcJ-0001q5-Sz for qemu-devel@nongnu.org; Tue, 08 May 2012 17:06:45 -0400 Received: from e24smtp01.br.ibm.com ([32.104.18.85]:38925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRrcJ-0001jB-HT for qemu-devel@nongnu.org; Tue, 08 May 2012 17:06:43 -0400 Received: from /spool/local by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 May 2012 18:06:28 -0300 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.13.184.26]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 092C6352004E for ; Tue, 8 May 2012 18:06:23 -0300 (BRT) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay02.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q48L62XP24445386 for ; Tue, 8 May 2012 18:06:02 -0300 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q48J6EdW015135 for ; Tue, 8 May 2012 16:06:14 -0300 Message-ID: <4FA98AD1.5090806@linux.vnet.ibm.com> Date: Tue, 08 May 2012 18:06:25 -0300 From: =?ISO-8859-1?Q?Cr=EDstian_Viana?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060000040407050305030602" Subject: [Qemu-devel] GlobalProperty in QEMUMachine overwrites explicit command line value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori This is a multi-part message in MIME format. --------------060000040407050305030602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi, I'm trying to change the default value of the parameter "-rtc driftfix=" and something's going wrong. This is a GlobalProperty and, currently, it is equivalent to setting "-rtc driftfix=none" in the command line. I'm appending a new GlobalProperty value to all previous QEMUMachine instances (<=pc-1.0): .driver = "mc146818rtc", .property = "lost_tick_policy", .value = "discard", Now when I select older machines, like "-M pc-1.0", it seems that this value is _always_ set even if I set another value on the command line. So, if I set "-rtc driftfix=slew", it will still use the "none" value internally. The file 0001-Force-driftfix-none-on-previous-machines.patch contains the small change I made to set "none" as the default value for that option. I added this debug statement: printf("Registering driver %s: %s -> %s\n", prop->driver, prop->property, prop->value); to the function "void qdev_prop_register_global(GlobalProperty *prop)" and I got this result: $ i386-softmmu/qemu-system-i386 -drive file=/home/vianac/ISOs/ubuntu-12.04-desktop-i386.iso,media=cdrom -boot d -m 1024 -M pc-1.0 -rtc driftfix=slew Registering driver mc146818rtc: lost_tick_policy -> slew Registering driver pc-sysfw: rom_only -> 1 Registering driver isa-fdc: check_media_rate -> off Registering driver virtio-balloon-pci: class -> 0x0500 Registering driver apic: vapic -> off Registering driver USB: full-path -> no Registering driver mc146818rtc: lost_tick_policy -> discard We can see that the lost_tick_policy property is overwritten at the end. I know QEmu has "discard" as the default value somewhere in the code, but what should we do now? Because there's not only one default value anymore; "discard" is the default for older machines and "slew" is for newer ones. I thought only by modifying the GlobalProperty list in the QEMUMachine struct would be enough. Does that list have the exact values to be set for each machine, or those should be the default ones (overwritable by the command line, for example)? Best regards, Crístian. --------------060000040407050305030602 Content-Type: text/x-patch; name="0001-Force-driftfix-none-on-previous-machines.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-Force-driftfix-none-on-previous-machines.patch" >>From bc6f181dc3d1a6342f0f26ae185fbf101cedbb02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cr=C3=ADstian=20Viana?= Date: Thu, 3 May 2012 17:28:59 -0300 Subject: [PATCH] Force driftfix=none on previous machines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current value for the -rtc driftfix option is 'none'. This patch makes sure that the old machines configuration will work the same way even after that option changes its default value. Signed-off-by: Crístian Viana --- hw/pc_piix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 6a75718..35633f0 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -381,6 +381,10 @@ static QEMUMachine pc_machine_v1_1 = { .driver = "USB",\ .property = "full-path",\ .value = "no",\ + },{\ + .driver = "mc146818rtc",\ + .property = "lost_tick_policy",\ + .value = "discard",\ } static QEMUMachine pc_machine_v1_0 = { -- 1.7.9.5 --------------060000040407050305030602--