[PATCH] tests: use virBhyveCapsBuild in bhyvexml2argv test

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

 



As we can use virBhyveCapsBuild() now, replace
testBhyveBuildCapabilities() with it.
---
 tests/bhyvexml2argvtest.c | 30 ++----------------------------
 1 file changed, 2 insertions(+), 28 deletions(-)

diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index b37fbb0..aedfb01 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -6,6 +6,7 @@
 
 # include "datatypes.h"
 
+# include "bhyve/bhyve_capabilities.h"
 # include "bhyve/bhyve_utils.h"
 # include "bhyve/bhyve_command.h"
 
@@ -13,33 +14,6 @@
 
 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)
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]