mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
testLXCCapsInit: Cleanup
Remove unnecessary label and goto. Cleanup line breaks. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
086f44a0fe
commit
1fc3f05293
@ -11,11 +11,10 @@
|
||||
virCaps *
|
||||
testLXCCapsInit(void)
|
||||
{
|
||||
virCaps *caps;
|
||||
g_autoptr(virCaps) caps = NULL;
|
||||
virCapsGuest *guest;
|
||||
|
||||
if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64,
|
||||
false, false)) == NULL)
|
||||
if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false)) == NULL)
|
||||
return NULL;
|
||||
|
||||
guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||
@ -33,20 +32,14 @@ testLXCCapsInit(void)
|
||||
virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL);
|
||||
|
||||
if (virTestGetDebug()) {
|
||||
g_autofree char *caps_str = NULL;
|
||||
|
||||
caps_str = virCapabilitiesFormatXML(caps);
|
||||
g_autofree char *caps_str = virCapabilitiesFormatXML(caps);
|
||||
if (!caps_str)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
VIR_TEST_DEBUG("LXC driver capabilities:\n%s", caps_str);
|
||||
}
|
||||
|
||||
return caps;
|
||||
|
||||
error:
|
||||
virObjectUnref(caps);
|
||||
return NULL;
|
||||
return g_steal_pointer(&caps);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user