Patchwork [v4,1/2] Force driftfix=none on previous machines

login
register
mail settings
Submitter Crístian Viana
Date June 19, 2012, 7:38 p.m.
Message ID <1340134725-28764-1-git-send-email-vianac@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/165826/
State New
Headers show

Comments

Crístian Viana - June 19, 2012, 7:38 p.m.
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 <vianac@linux.vnet.ibm.com>
---

There's a scenario when things don't work the way I expected: when I set a
previous machine with -M, the driftfix flag value on the command line is not
used, the machine's default value overwrites it. I'm not sure if that's the
expected behavior of QEMU in those cases (if I set a machine, I can't change its
properties) or if there's a bug somewhere. This is the question I asked in a
previous e-mail (http://article.gmane.org/gmane.comp.emulators.qemu/149902).

For example,

$ x86_64-softmmu/qemu-x86_64 -M pc-1.0 --rtc driftfix=slew

will use "driftfix=none", which is the default for the machine pc-1.0, not
"driftfix=slew" as I set on the command line. That only happens if I choose
a different machine than the default one (pc-1.1 as of now); otherwise it
works fine.

Changes since v3:
- Rebase the code

 hw/pc_piix.c |    4 ++++
 1 file changed, 4 insertions(+)
Daniel P. Berrange - June 20, 2012, 8:34 a.m.
On Tue, Jun 19, 2012 at 04:38:44PM -0300, Crístian Viana wrote:
> 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 <vianac@linux.vnet.ibm.com>
> ---
> 
> There's a scenario when things don't work the way I expected: when I set a
> previous machine with -M, the driftfix flag value on the command line is not
> used, the machine's default value overwrites it. I'm not sure if that's the
> expected behavior of QEMU in those cases (if I set a machine, I can't change its
> properties) or if there's a bug somewhere. This is the question I asked in a
> previous e-mail (http://article.gmane.org/gmane.comp.emulators.qemu/149902).
> 
> For example,
> 
> $ x86_64-softmmu/qemu-x86_64 -M pc-1.0 --rtc driftfix=slew
> 
> will use "driftfix=none", which is the default for the machine pc-1.0, not
> "driftfix=slew" as I set on the command line. That only happens if I choose
> a different machine than the default one (pc-1.1 as of now); otherwise it
> works fine.

I can't answer your question as to why this happens, but this is a
critical problem we must fix before merging this change. We need to
be able to set driftfix=slew for old machine types manually.


Daniel

Patch

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index d68f77a..ed463da 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -378,6 +378,10 @@  static QEMUMachine pc_machine_v1_1 = {
             .driver   = TYPE_USB_DEVICE,\
             .property = "full-path",\
             .value    = "no",\
+        },{\
+            .driver   = "mc146818rtc",\
+            .property = "lost_tick_policy",\
+            .value    = "discard",\
         }
 
 static QEMUMachine pc_machine_v1_0 = {