Force timedrift=none on previous machines
PATCH 1/2 Force timedrift=none on previous machines
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.
--- hw/pc_piix.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-)
hw/pc_piix.c +39 -0
@@ -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
Signature · 1 line
1.7.8.5
PATCH 2/2 Change timedrift default value to slew
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.
--- vl.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
vl.c +12 -1
@@ -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); } }
Signature · 1 line
1.7.8.5
Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
Quoted 22 lines · 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<[email protected]>--- vl.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)vl.c +1
-1@@ -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 );
vl.c static void configure_rtc(QemuOpts *opts) · line 566
Quoted 10 lines
vl.c +9
-0} + }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
Quoted 4 lines
vl.c +1
-0+qdev_prop_register_global_list (slew_lost_ticks); } }
Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
Quoted 8 lines · Anthony Liguori
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).
Signature · 2 lines
Best regards, Crístian.
Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
Quoted 7 lines · Crístian Viana
Quoted 6 lines · Anthony Liguori
I think we just want to change:
hw/mc146818rtc.h:
DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
lost_tick_policy,LOST_TICK_DISCARD),
Quoted 5 lines
Quoted 2 lines
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).
Regards,
Anthony Liguori
Quoted 1 line
Re: [Qemu-devel] [PATCH 2/2] Change timedrift default value to slew
Quoted 8 lines · Anthony Liguori
Quoted 7 lines · Crístian Viana
Quoted 6 lines · Anthony Liguori
I think we just want to change:
hw/mc146818rtc.h:
DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
lost_tick_policy,LOST_TICK_DISCARD),
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
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).
So that's on hw/mc146818rtc.c, not .h :-) Thanks for the suggestion, I'll send a new patch now.
Signature · 2 lines
Best regards, Crístian.