]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: xenParseXMOS: separate VIR_ALLOC call
authorJán Tomko <jtomko@redhat.com>
Tue, 6 Oct 2020 14:45:20 +0000 (16:45 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 8 Oct 2020 17:19:22 +0000 (19:19 +0200)
To reduce churn in the following patches.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/libxl/xen_xm.c

index 8ade5aec1c6e709048c99a122abb8ba52af19f75..6d00f4754487ffed5c334f47e31ec92db58164bc 100644 (file)
@@ -42,8 +42,10 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def)
     if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
         g_autofree char *boot = NULL;
 
-        if (VIR_ALLOC(def->os.loader) < 0 ||
-            xenConfigCopyString(conf, "kernel", &def->os.loader->path) < 0)
+        if (VIR_ALLOC(def->os.loader) < 0)
+            return -1;
+
+        if (xenConfigCopyString(conf, "kernel", &def->os.loader->path) < 0)
             return -1;
 
         if (xenConfigGetString(conf, "boot", &boot, "c") < 0)