[libvirt] [PATCH 16/n] conf: manage disk source by struct instead of pieces
Eric Blake
eblake at redhat.com
Mon Mar 31 18:46:17 UTC 2014
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140331/2467334d/attachment-0001.sig>
More information about the libvir-list
mailing list