Re: [PATCH 16/n] conf: manage disk source by struct instead of pieces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/31/2014 12:13 PM, Eric Blake wrote:
> On 03/31/2014 12:09 PM, Eric Blake wrote:
>> Now that we have a dedicated type for representing a disk source,
>> we might as well parse and format directly into that type instead
>> of piecemeal into pointers to members of the type.
> 
> Aargh; hit send too soon.  I'm still tracking down why this patch breaks
> 'make check'.
> 

Squash this in:

diff --git i/src/conf/domain_conf.c w/src/conf/domain_conf.c
index fba13e2..6e71885 100644
--- i/src/conf/domain_conf.c
+++ w/src/conf/domain_conf.c
@@ -5102,7 +5102,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
     char *sgio = NULL;
     char *driverName = NULL;
     char *driverType = NULL;
-    char *source = NULL;
+    const char *source = NULL;
     char *target = NULL;
     char *trans = NULL;
     char *bus = NULL;
@@ -5173,6 +5173,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,

                 if (virDomainDiskSourceParse(cur, &def->src) < 0)
                     goto error;
+                source = def->src.path;

                 if (def->src.type == VIR_STORAGE_TYPE_NETWORK) {
                     if (def->src.protocol ==
VIR_STORAGE_NET_PROTOCOL_ISCSI)
@@ -5789,8 +5790,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
         def->startupPolicy = val;
     }

-    def->src.path = source;
-    source = NULL;
     def->dst = target;
     target = NULL;
     def->src.auth.username = authUsername;
@@ -5842,7 +5841,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
     VIR_FREE(rawio);
     VIR_FREE(sgio);
     VIR_FREE(target);
-    VIR_FREE(source);
     VIR_FREE(tray);
     VIR_FREE(removable);
     VIR_FREE(trans);

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]