qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] Force timedrift=none on previous machines
@ 2012-03-20 19:48 Crístian Viana
  2012-03-20 19:48 ` [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew Crístian Viana
  0 siblings, 1 reply; 6+ messages in thread
From: Crístian Viana @ 2012-03-20 19:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, Crístian Viana

The current value for the -rtc timedrift 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>
---
 hw/pc_piix.c |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 3f99f9a..08255b5 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -386,6 +386,10 @@ static QEMUMachine pc_machine_v1_0 = {
             .driver   = "isa-fdc",
             .property = "check_media_rate",
             .value    = "off",
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     },
@@ -405,6 +409,10 @@ static QEMUMachine pc_machine_v0_15 = {
             .driver   = "isa-fdc",
             .property = "check_media_rate",
             .value    = "off",
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     },
@@ -449,6 +457,10 @@ static QEMUMachine pc_machine_v0_14 = {
             .driver   = "pc-sysfw",
             .property = "rom_only",
             .value    = stringify(1),
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     },
@@ -505,6 +517,10 @@ static QEMUMachine pc_machine_v0_13 = {
             .driver   = "pc-sysfw",
             .property = "rom_only",
             .value    = stringify(1),
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     },
@@ -565,6 +581,10 @@ static QEMUMachine pc_machine_v0_12 = {
             .driver   = "pc-sysfw",
             .property = "rom_only",
             .value    = stringify(1),
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     }
@@ -633,6 +653,10 @@ static QEMUMachine pc_machine_v0_11 = {
             .driver   = "pc-sysfw",
             .property = "rom_only",
             .value    = stringify(1),
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     }
@@ -713,6 +737,10 @@ static QEMUMachine pc_machine_v0_10 = {
             .driver   = "pc-sysfw",
             .property = "rom_only",
             .value    = stringify(1),
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     },
@@ -728,6 +756,10 @@ static QEMUMachine isapc_machine = {
             .driver   = "pc-sysfw",
             .property = "rom_only",
             .value    = stringify(1),
+        }, {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
         },
         { /* end of list */ }
     },
@@ -740,6 +772,13 @@ static QEMUMachine xenfv_machine = {
     .init = pc_xen_hvm_init,
     .max_cpus = HVM_MAX_VCPUS,
     .default_machine_opts = "accel=xen",
+    .compat_props = (GlobalProperty[]) {
+        {
+            .driver   = "mc146818rtc",
+            .property = "lost_tick_policy",
+            .value    = "none",
+        },
+        { /* end of list */ }
 };
 #endif
 
-- 
1.7.8.5

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

* [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
  2012-03-20 19:48 [Qemu-devel] [PATCH 1/2] Force timedrift=none on previous machines Crístian Viana
@ 2012-03-20 19:48 ` Crístian Viana
  2012-03-20 20:05   ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Crístian Viana @ 2012-03-20 19:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori, Crístian Viana

Windows 2008+ is very sensitive to missed ticks.  The RTC is used by default as
the time source.  If time drift is not enabled, Windows is prone to
blue screening.

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
---
 vl.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index 112b0e0..2c7cbf0 100644
--- a/vl.c
+++ b/vl.c
@@ -550,11 +550,22 @@ static void configure_rtc(QemuOpts *opts)
 
             qdev_prop_register_global_list(slew_lost_ticks);
         } else if (!strcmp(value, "none")) {
-            /* discard is default */
+            /* do nothing */
         } else {
             fprintf(stderr, "qemu: invalid option value '%s'\n", value);
             exit(1);
         }
+    } else {
+        static GlobalProperty slew_lost_ticks[] = {
+            {
+                .driver   = "mc146818rtc",
+                .property = "lost_tick_policy",
+                .value    = "slew",
+            },
+            { /* end of list */ }
+        };
+
+        qdev_prop_register_global_list(slew_lost_ticks);
     }
 }
 
-- 
1.7.8.5

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

* Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
  2012-03-20 19:48 ` [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew Crístian Viana
@ 2012-03-20 20:05   ` Anthony Liguori
  2012-03-20 20:16     ` Crístian Viana
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2012-03-20 20:05 UTC (permalink / raw)
  To: Crístian Viana; +Cc: qemu-devel

On 03/20/2012 02:48 PM, Crístian Viana wrote:
> Windows 2008+ is very sensitive to missed ticks.  The RTC is used by default as
> the time source.  If time drift is not enabled, Windows is prone to
> blue screening.
>
> Signed-off-by: Crístian Viana<vianac@linux.vnet.ibm.com>
> ---
>   vl.c |   13 ++++++++++++-
>   1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 112b0e0..2c7cbf0 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -550,11 +550,22 @@ static void configure_rtc(QemuOpts *opts)
>
>               qdev_prop_register_global_list(slew_lost_ticks);
>           } else if (!strcmp(value, "none")) {
> -            /* discard is default */
> +            /* do nothing */
>           } else {
>               fprintf(stderr, "qemu: invalid option value '%s'\n", value);
>               exit(1);
>           }
> +    } else {
> +        static GlobalProperty slew_lost_ticks[] = {
> +            {
> +                .driver   = "mc146818rtc",
> +                .property = "lost_tick_policy",
> +                .value    = "slew",
> +            },
> +            { /* end of list */ }
> +        };

I think we just want to change:

hw/mc146818rtc.h:
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
                                lost_tick_policy, LOST_TICK_DISCARD),

I think we just need to change this to LOST_TICK_SLEW.  This would effectively 
change the default.

Regards,

Anthony Liguori

> +        qdev_prop_register_global_list(slew_lost_ticks);
>       }
>   }
>

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

* Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
  2012-03-20 20:05   ` Anthony Liguori
@ 2012-03-20 20:16     ` Crístian Viana
  2012-03-20 20:31       ` Anthony Liguori
  0 siblings, 1 reply; 6+ messages in thread
From: Crístian Viana @ 2012-03-20 20:16 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

On 20-03-2012 17:05, Anthony Liguori wrote:
> I think we just want to change:
> 
> hw/mc146818rtc.h:
>     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
>                                lost_tick_policy, LOST_TICK_DISCARD),
> 
> I think we just need to change this to LOST_TICK_SLEW.  This would
> effectively change the default.

I can't see this code snippet here, I guess we are in a different
branch. I'm using the current master branch (33cf629).

-- 
Best regards,
Crístian.

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

* Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
  2012-03-20 20:16     ` Crístian Viana
@ 2012-03-20 20:31       ` Anthony Liguori
  2012-03-20 20:46         ` Crístian Viana
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2012-03-20 20:31 UTC (permalink / raw)
  To: Crístian Viana; +Cc: qemu-devel

On 03/20/2012 03:16 PM, Crístian Viana wrote:
> On 20-03-2012 17:05, Anthony Liguori wrote:
>> I think we just want to change:
>>
>> hw/mc146818rtc.h:
>>      DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
>>                                 lost_tick_policy, LOST_TICK_DISCARD),
>>
>> I think we just need to change this to LOST_TICK_SLEW.  This would
>> effectively change the default.
>
> I can't see this code snippet here, I guess we are in a different
> branch. I'm using the current master branch (33cf629).

http://git.qemu.org/?p=qemu.git;a=blob;f=hw/mc146818rtc.c;h=2b59c36ee66149f238ea415059c44d7d619925a6;hb=HEAD#l726

Regards,

Anthony Liguori

>

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

* Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
  2012-03-20 20:31       ` Anthony Liguori
@ 2012-03-20 20:46         ` Crístian Viana
  0 siblings, 0 replies; 6+ messages in thread
From: Crístian Viana @ 2012-03-20 20:46 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

On 20-03-2012 17:31, Anthony Liguori wrote:
> On 03/20/2012 03:16 PM, Crístian Viana wrote:
>> On 20-03-2012 17:05, Anthony Liguori wrote:
>>> I think we just want to change:
>>>
>>> hw/mc146818rtc.h:
>>>      DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
>>>                                 lost_tick_policy, LOST_TICK_DISCARD),
>>>
>>> I think we just need to change this to LOST_TICK_SLEW.  This would
>>> effectively change the default.
>>
>> I can't see this code snippet here, I guess we are in a different
>> branch. I'm using the current master branch (33cf629).
> 
> http://git.qemu.org/?p=qemu.git;a=blob;f=hw/mc146818rtc.c;h=2b59c36ee66149f238ea415059c44d7d619925a6;hb=HEAD#l726

So that's on hw/mc146818rtc.c, not .h :-) Thanks for the suggestion,
I'll send a new patch now.

-- 
Best regards,
Crístian.

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

end of thread, other threads:[~2012-03-20 20:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20 19:48 [Qemu-devel] [PATCH 1/2] Force timedrift=none on previous machines Crístian Viana
2012-03-20 19:48 ` [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew Crístian Viana
2012-03-20 20:05   ` Anthony Liguori
2012-03-20 20:16     ` Crístian Viana
2012-03-20 20:31       ` Anthony Liguori
2012-03-20 20:46         ` Crístian Viana

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