commit 0fdf649672b504a5b3458c7d316a4557ecbd1953
Author: Laine Stump <laine@laine.org>
Date:   Tue Mar 30 13:51:01 2010 +0200

    Add flags to indicate presence of timekeeping-related qemu options
    
    * src/qemu/qemu_conf.h: define 4 new flags
    * src/qemu/qemu_conf.c: check the help text of qemu for presence of
                            features indicated by each flag.
    * tests/qemuhelptest.c: add appropriate flags into the masks for each test

Index: libvirt-0.7.6/src/qemu/qemu_conf.c
===================================================================
--- libvirt-0.7.6.orig/src/qemu/qemu_conf.c
+++ libvirt-0.7.6/src/qemu/qemu_conf.c
@@ -1162,6 +1162,16 @@ static unsigned long long qemudComputeCm
     /* The trailing ' ' is important to avoid a bogus match */
     if (strstr(help, "-rtc "))
         flags |= QEMUD_CMD_FLAG_RTC;
+    /* to wit */
+    if (strstr(help, "-rtc-td-hack"))
+        flags |= QEMUD_CMD_FLAG_RTC_TD_HACK;
+    if (strstr(help, "-no-hpet"))
+        flags |= QEMUD_CMD_FLAG_NO_HPET;
+    if (strstr(help, "-no-kvm-pit-reinjection"))
+        flags |= QEMUD_CMD_FLAG_NO_KVM_PIT;
+    if (strstr(help, "-tdf"))
+        flags |= QEMUD_CMD_FLAG_TDF;
+
     /* Keep disabled till we're actually ready to turn on netdev mode
      * The plan is todo it in 0.13.0 QEMU, but lets wait & see... */
 #if 0
Index: libvirt-0.7.6/src/qemu/qemu_conf.h
===================================================================
--- libvirt-0.7.6.orig/src/qemu/qemu_conf.h
+++ libvirt-0.7.6/src/qemu/qemu_conf.h
@@ -84,6 +84,10 @@ enum qemud_cmd_flags {
     QEMUD_CMD_FLAG_SMP_TOPOLOGY  = (1 << 28), /* Is sockets=s,cores=c,threads=t available for -smp? */
     QEMUD_CMD_FLAG_NETDEV        = (1 << 29), /* The -netdev flag & netdev_add/remove monitor commands */
     QEMUD_CMD_FLAG_RTC           = (1 << 30), /* The -rtc flag for clock options */
+    QEMUD_CMD_FLAG_RTC_TD_HACK   = (1LL << 32), /* -rtd-td-hack available */
+    QEMUD_CMD_FLAG_NO_HPET       = (1LL << 33), /* -no-hpet flag is supported */
+    QEMUD_CMD_FLAG_NO_KVM_PIT    = (1LL << 34), /* -no-kvm-pit-reinjection supported */
+    QEMUD_CMD_FLAG_TDF           = (1LL << 35), /* -tdf flag (user-mode pit catchup) */
 };
 
 /* Main driver state */
Index: libvirt-0.7.6/tests/qemuhelptest.c
===================================================================
--- libvirt-0.7.6.orig/tests/qemuhelptest.c
+++ libvirt-0.7.6/tests/qemuhelptest.c
@@ -125,7 +125,8 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_MIGRATE_KVM_STDIO |
             QEMUD_CMD_FLAG_KVM |
             QEMUD_CMD_FLAG_DRIVE_FORMAT |
-            QEMUD_CMD_FLAG_MEM_PATH,
+            QEMUD_CMD_FLAG_MEM_PATH |
+            QEMUD_CMD_FLAG_TDF,
             9001,  1, 74);
     DO_TEST("qemu-0.10.5",
             QEMUD_CMD_FLAG_KQEMU |
@@ -142,7 +143,9 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_VGA |
             QEMUD_CMD_FLAG_0_10 |
             QEMUD_CMD_FLAG_ENABLE_KVM |
-            QEMUD_CMD_FLAG_SDL,
+            QEMUD_CMD_FLAG_SDL |
+            QEMUD_CMD_FLAG_RTC_TD_HACK |
+            QEMUD_CMD_FLAG_NO_HPET,
             10005, 0,  0);
     DO_TEST("qemu-kvm-0.10.5",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -162,7 +165,11 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_0_10 |
             QEMUD_CMD_FLAG_PCIDEVICE |
             QEMUD_CMD_FLAG_MEM_PATH |
-            QEMUD_CMD_FLAG_SDL,
+            QEMUD_CMD_FLAG_SDL |
+            QEMUD_CMD_FLAG_RTC_TD_HACK |
+            QEMUD_CMD_FLAG_NO_HPET |
+            QEMUD_CMD_FLAG_NO_KVM_PIT |
+            QEMUD_CMD_FLAG_TDF,
             10005, 1,  0);
     DO_TEST("kvm-86",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -181,7 +188,11 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_VGA |
             QEMUD_CMD_FLAG_0_10 |
             QEMUD_CMD_FLAG_PCIDEVICE |
-            QEMUD_CMD_FLAG_SDL,
+            QEMUD_CMD_FLAG_SDL |
+            QEMUD_CMD_FLAG_RTC_TD_HACK |
+            QEMUD_CMD_FLAG_NO_HPET |
+            QEMUD_CMD_FLAG_NO_KVM_PIT |
+            QEMUD_CMD_FLAG_TDF,
             10050, 1,  0);
     DO_TEST("qemu-kvm-0.11.0-rc2",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -203,7 +214,11 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_MEM_PATH |
             QEMUD_CMD_FLAG_ENABLE_KVM |
             QEMUD_CMD_FLAG_BALLOON |
-            QEMUD_CMD_FLAG_SDL,
+            QEMUD_CMD_FLAG_SDL |
+            QEMUD_CMD_FLAG_RTC_TD_HACK |
+            QEMUD_CMD_FLAG_NO_HPET |
+            QEMUD_CMD_FLAG_NO_KVM_PIT |
+            QEMUD_CMD_FLAG_TDF,
             10092, 1,  0);
     DO_TEST("qemu-0.12.1",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -226,7 +241,8 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_BALLOON |
             QEMUD_CMD_FLAG_DEVICE |
             QEMUD_CMD_FLAG_SMP_TOPOLOGY |
-            QEMUD_CMD_FLAG_RTC,
+            QEMUD_CMD_FLAG_RTC |
+            QEMUD_CMD_FLAG_NO_HPET,
             12001, 0,  0);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
