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:
Tim Wiederhake 2021-11-08 12:44:11 +01:00
parent 086f44a0fe
commit 1fc3f05293

View File

@ -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);
}