[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 3/4] 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
---
 src/qemu/qemu_conf.c |   10 ++++++++++
 src/qemu/qemu_conf.h |    4 ++++
 tests/qemuhelptest.c |   28 ++++++++++++++++++++++------
 3 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index b1cc834..e9197db 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1159,6 +1159,16 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
     /* 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
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 2d62cc4..39518ca 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -84,6 +84,10 @@ enum qemud_cmd_flags {
     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_VNET_HOST     = (1 << 31), /* vnet-host support is available in qemu */
+    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 */
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index dfdac75..b8c4b91 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -126,7 +126,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 |
@@ -143,7 +144,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 |
@@ -163,7 +166,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 |
@@ -182,7 +189,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 |
@@ -204,7 +215,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 |
@@ -227,7 +242,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;
-- 
1.6.6.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]