]> xenbits.xensource.com Git - libvirt.git/commitdiff
hyperv: Allocate 'def' via virDomainDefNew
authorPeter Krempa <pkrempa@redhat.com>
Mon, 19 Oct 2015 17:06:55 +0000 (19:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 24 Nov 2015 12:16:55 +0000 (13:16 +0100)
Use the helper that is necessary to fill out some values rather than
allocating it directly.

src/hyperv/hyperv_driver.c

index 1958bbe769aa6951e3ffb39f1a5e43851e563c82..72261dfa3257b2357f2eb49b1cb94ce533656963 100644 (file)
@@ -774,7 +774,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
 
     /* Flags checked by virDomainDefFormat */
 
-    if (VIR_ALLOC(def) < 0)
+    if (!(def = virDomainDefNew()))
         goto cleanup;
 
     virUUIDFormat(domain->uuid, uuid_string);