All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering
@ 2012-07-18 18:02 Crístian Viana
  2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 2/3] Force driftfix=none on previous machines Crístian Viana
  2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 3/3] Change driftfix default value to slew Crístian Viana
  0 siblings, 2 replies; 3+ messages in thread
From: Crístian Viana @ 2012-07-18 18:02 UTC (permalink / raw)
  To: QEMU Development ML; +Cc: Crístian Viana, Anthony Liguori

If a GlobalProperty has already been registered, it won't have its value
overwritten. This is done to enforce that the properties specified in the command
line will "win" over the ones specified by the machine properties, if set with
the parameter "-M".

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
---
Changes since v5:
- Updated commit message of PATCH 1/3
- Rebased on master

 hw/qdev-properties.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 3571cf3..8356879 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -1212,6 +1212,14 @@ static QTAILQ_HEAD(, GlobalProperty) global_props = QTAILQ_HEAD_INITIALIZER(glob
 
 static void qdev_prop_register_global(GlobalProperty *prop)
 {
+    GlobalProperty *p;
+
+    QTAILQ_FOREACH(p, &global_props, next) {
+        if (strcmp(prop->driver, p->driver) == 0) {
+            return;
+        }
+    }
+
     QTAILQ_INSERT_TAIL(&global_props, prop, next);
 }
 
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH v6 2/3] Force driftfix=none on previous machines
  2012-07-18 18:02 [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering Crístian Viana
@ 2012-07-18 18:02 ` Crístian Viana
  2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 3/3] Change driftfix default value to slew Crístian Viana
  1 sibling, 0 replies; 3+ messages in thread
From: Crístian Viana @ 2012-07-18 18:02 UTC (permalink / raw)
  To: QEMU Development ML; +Cc: Crístian Viana, Anthony Liguori

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>
---
 hw/pc_piix.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 0c0096f..cac7b36 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -410,6 +410,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 = {
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH v6 3/3] Change driftfix default value to slew
  2012-07-18 18:02 [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering Crístian Viana
  2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 2/3] Force driftfix=none on previous machines Crístian Viana
@ 2012-07-18 18:02 ` Crístian Viana
  1 sibling, 0 replies; 3+ messages in thread
From: Crístian Viana @ 2012-07-18 18:02 UTC (permalink / raw)
  To: QEMU Development ML; +Cc: Crístian Viana, Anthony Liguori

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

Signed-off-by: Crístian Viana <vianac@linux.vnet.ibm.com>
---
 hw/mc146818rtc.c |    2 +-
 vl.c             |   11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 3777f85..dfd7ee6 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -686,7 +686,7 @@ ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq)
 static Property mc146818rtc_properties[] = {
     DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),
     DEFINE_PROP_LOSTTICKPOLICY("lost_tick_policy", RTCState,
-                               lost_tick_policy, LOST_TICK_DISCARD),
+                               lost_tick_policy, LOST_TICK_SLEW),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/vl.c b/vl.c
index 46248b9..c09ed5e 100644
--- a/vl.c
+++ b/vl.c
@@ -559,7 +559,16 @@ static void configure_rtc(QemuOpts *opts)
 
             qdev_prop_register_global_list(slew_lost_ticks);
         } else if (!strcmp(value, "none")) {
-            /* discard is default */
+            static GlobalProperty discard_lost_ticks[] = {
+                {
+                    .driver   = "mc146818rtc",
+                    .property = "lost_tick_policy",
+                    .value    = "discard",
+                },
+                { /* end of list */ }
+            };
+
+            qdev_prop_register_global_list(discard_lost_ticks);
         } else {
             fprintf(stderr, "qemu: invalid option value '%s'\n", value);
             exit(1);
-- 
1.7.9.5

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18 18:02 [Qemu-devel] [PATCH v6 1/3] Check if GlobalProperty exists before registering Crístian Viana
2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 2/3] Force driftfix=none on previous machines Crístian Viana
2012-07-18 18:02 ` [Qemu-devel] [PATCH v6 3/3] Change driftfix default value to slew Crístian Viana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.