mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
tests: use virBhyveCapsBuild in bhyvexml2argv test
As we can use virBhyveCapsBuild() now, replace testBhyveBuildCapabilities() with it.
This commit is contained in:
parent
d1e55de343
commit
548f21d087
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
# include "datatypes.h"
|
# include "datatypes.h"
|
||||||
|
|
||||||
|
# include "bhyve/bhyve_capabilities.h"
|
||||||
# include "bhyve/bhyve_utils.h"
|
# include "bhyve/bhyve_utils.h"
|
||||||
# include "bhyve/bhyve_command.h"
|
# include "bhyve/bhyve_command.h"
|
||||||
|
|
||||||
@ -13,33 +14,6 @@
|
|||||||
|
|
||||||
static bhyveConn driver;
|
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,
|
static int testCompareXMLToArgvFiles(const char *xml,
|
||||||
const char *cmdline)
|
const char *cmdline)
|
||||||
{
|
{
|
||||||
@ -114,7 +88,7 @@ mymain(void)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if ((driver.caps = testBhyveBuildCapabilities()) == NULL)
|
if ((driver.caps = virBhyveCapsBuild()) == NULL)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL)) == NULL)
|
if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL)) == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user