]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: use virBhyveCapsBuild in bhyvexml2argv test
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 8 Apr 2014 17:18:00 +0000 (21:18 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 9 Apr 2014 06:27:16 +0000 (10:27 +0400)
As we can use virBhyveCapsBuild() now, replace
testBhyveBuildCapabilities() with it.

tests/bhyvexml2argvtest.c

index b37fbb04832f8943b26792566f26f166955c5bf5..aedfb0115fc55c9726ae9065195a71ec7b48885f 100644 (file)
@@ -6,6 +6,7 @@
 
 # include "datatypes.h"
 
+# include "bhyve/bhyve_capabilities.h"
 # include "bhyve/bhyve_utils.h"
 # include "bhyve/bhyve_command.h"
 
 
 static bhyveConn driver;
 
-static virCapsPtr
-testBhyveBuildCapabilities(void)
-{
-    virCapsPtr caps;
-    virCapsGuestPtr guest;
-
-    if ((caps = virCapabilitiesNew(virArchFromHost(),
-                                   0, 0)) == NULL)
-        return NULL;
-
-    if ((guest = virCapabilitiesAddGuest(caps, "hvm",
-                                         VIR_ARCH_X86_64,
-                                         "bhyve",
-                                         NULL, 0, NULL)) == NULL)
-        goto error;
-
-    if (virCapabilitiesAddGuestDomain(guest,
-                                      "bhyve", NULL, NULL, 0, NULL) == NULL)
-        goto error;
-
-    return caps;
-
- error:
-    virObjectUnref(caps);
-    return NULL;
-}
-
 static int testCompareXMLToArgvFiles(const char *xml,
                                      const char *cmdline)
 {
@@ -114,7 +88,7 @@ mymain(void)
 {
     int ret = 0;
 
-    if ((driver.caps = testBhyveBuildCapabilities()) == NULL)
+    if ((driver.caps = virBhyveCapsBuild()) == NULL)
         return EXIT_FAILURE;
 
     if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL)) == NULL)