]> xenbits.xensource.com Git - libvirt.git/commitdiff
adds xen and hvm guest types to test driver capabilities
authorDaniel Veillard <veillard@redhat.com>
Tue, 8 Apr 2008 09:26:24 +0000 (09:26 +0000)
committerDaniel Veillard <veillard@redhat.com>
Tue, 8 Apr 2008 09:26:24 +0000 (09:26 +0000)
* src/test.c: patch from Cole Robinson adding xen and hvm guest types
  to the test driver's capabilities.
Daniel

ChangeLog
src/test.c

index f032e83356747cc47c1feda08f4e5a225504bd70..5de27e112494ad2d493e514dc71e970d39e6e2bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr  8 11:24:28 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+       * src/test.c: patch from Cole Robinson adding xen and hvm guest types
+         to the test driver's capabilities.
+
 Tue Apr  8 10:19:01 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
        * python/generator.py: fix an infinite loop bug
index 135d96fdbe1d52245bce23a812fffdf1fa71b0c0..0a3779a12becdb8931e063df5b91b3818a8cca82 100644 (file)
@@ -1006,6 +1006,7 @@ static char *testGetCapabilities (virConnectPtr conn)
     virCapsPtr caps;
     virCapsGuestPtr guest;
     char *xml;
+    const char *guest_types[] = { "hvm", "xen" };
     int i;
 
     GET_CONNECTION(conn, -1);
@@ -1024,29 +1025,31 @@ static char *testGetCapabilities (virConnectPtr conn)
             goto no_memory;
     }
 
-    if ((guest = virCapabilitiesAddGuest(caps,
-                                         "linux",
-                                         TEST_MODEL,
-                                         TEST_MODEL_WORDSIZE,
-                                         NULL,
-                                         NULL,
-                                         0,
-                                         NULL)) == NULL)
-        goto no_memory;
+    for (i = 0; i < (sizeof(guest_types)/sizeof(guest_types[0])); ++i) {
 
-    if (virCapabilitiesAddGuestDomain(guest,
-                                      "test",
-                                      NULL,
-                                      NULL,
-                                      0,
-                                      NULL) == NULL)
-        goto no_memory;
+        if ((guest = virCapabilitiesAddGuest(caps,
+                                             guest_types[i],
+                                             TEST_MODEL,
+                                             TEST_MODEL_WORDSIZE,
+                                             NULL,
+                                             NULL,
+                                             0,
+                                             NULL)) == NULL)
+            goto no_memory;
 
+        if (virCapabilitiesAddGuestDomain(guest,
+                                          "test",
+                                          NULL,
+                                          NULL,
+                                          0,
+                                          NULL) == NULL)
+            goto no_memory;
 
-    if (virCapabilitiesAddGuestFeature(guest, "pae", 1, 1) == NULL)
-        goto no_memory;
-    if (virCapabilitiesAddGuestFeature(guest ,"nonpae", 1, 1) == NULL)
-        goto no_memory;
+        if (virCapabilitiesAddGuestFeature(guest, "pae", 1, 1) == NULL)
+            goto no_memory;
+        if (virCapabilitiesAddGuestFeature(guest ,"nonpae", 1, 1) == NULL)
+            goto no_memory;
+    }
 
     if ((xml = virCapabilitiesFormatXML(caps)) == NULL)
         goto no_memory;