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

[libvirt] [PATCH 2/3] qemu aio: parse aio support from qemu -help



From: Matthias Dahl <mdvirt designassembly de>

Signed-off-by: Eric Blake <eblake redhat com>
---
 src/qemu/qemu_capabilities.c |    2 ++
 src/qemu/qemu_capabilities.h |    3 ++-
 tests/qemuhelptest.c         |   12 ++++++++----
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index f967255..59b4d2c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -803,6 +803,8 @@ qemuCapsComputeCmdFlags(const char *help,
             flags |= QEMUD_CMD_FLAG_DRIVE_FORMAT;
         if (strstr(help, "readonly="))
             flags |= QEMUD_CMD_FLAG_DRIVE_READONLY;
+        if (strstr(help, "aio=threads|native"))
+            flags |= QEMUD_CMD_FLAG_DRIVE_AIO;
     }
     if ((p = strstr(help, "-vga")) && !strstr(help, "-std-vga")) {
         const char *nl = strstr(p, "\n");
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 8057479..40a3e48 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -1,7 +1,7 @@
 /*
  * qemu_capabilities.h: QEMU capabilities generation
  *
- * Copyright (C) 2006-2007, 2009-2010 Red Hat, Inc.
+ * Copyright (C) 2006-2011 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -83,6 +83,7 @@ enum qemuCapsFlags {
     QEMUD_CMD_FLAG_SPICE         = (1LL << 46), /* Is -spice avail */
     QEMUD_CMD_FLAG_VGA_NONE      = (1LL << 47), /* The 'none' arg for '-vga' */
     QEMUD_CMD_FLAG_MIGRATE_QEMU_FD = (1LL << 48), /* -incoming fd:n */
+    QEMUD_CMD_FLAG_DRIVE_AIO     = (1LL << 49), /* -drive aio= supported */
 };

 virCapsPtr qemuCapsInit(virCapsPtr old_caps);
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 5d78e2d..e9579de 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -309,7 +309,8 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_NAME_PROCESS |
             QEMUD_CMD_FLAG_SMBIOS_TYPE |
             QEMUD_CMD_FLAG_VGA_NONE |
-            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
+            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD |
+            QEMUD_CMD_FLAG_DRIVE_AIO,
             12001, 0,  0);
     DO_TEST("qemu-kvm-0.12.1.2-rhel60",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -349,7 +350,8 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_VGA_QXL |
             QEMUD_CMD_FLAG_SPICE |
             QEMUD_CMD_FLAG_VGA_NONE |
-            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
+            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD |
+            QEMUD_CMD_FLAG_DRIVE_AIO,
             12001, 1,  0);
     DO_TEST("qemu-kvm-0.12.3",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -386,7 +388,8 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_NAME_PROCESS |
             QEMUD_CMD_FLAG_SMBIOS_TYPE |
             QEMUD_CMD_FLAG_VGA_NONE |
-            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
+            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD |
+            QEMUD_CMD_FLAG_DRIVE_AIO,
             12003, 1,  0);
     DO_TEST("qemu-kvm-0.13.0",
             QEMUD_CMD_FLAG_VNC_COLON |
@@ -431,7 +434,8 @@ mymain(int argc, char **argv)
             QEMUD_CMD_FLAG_SMBIOS_TYPE |
             QEMUD_CMD_FLAG_SPICE |
             QEMUD_CMD_FLAG_VGA_NONE |
-            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD,
+            QEMUD_CMD_FLAG_MIGRATE_QEMU_FD |
+            QEMUD_CMD_FLAG_DRIVE_AIO,
             13000, 1,  0);

     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
-- 
1.7.3.4


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