On 02/28/2012 01:14 PM, Laine Stump wrote:
In order to allow for a virDomainHostdevDef that uses the
virDomainDeviceInfo of a "higher level" device (such as a
virDomainNetDef), this patch changes the virDomainDeviceInfo in the
HostdevDef into a virDomainDeviceInfoPtr. Rather than adding checks
all over the code to check for a null info, we just guarantee that it
is always valid. The new function virDomainHostdevDefAlloc() allocates
a virDomainDeviceInfo and plugs it in, and virDomainHostdevDefFree()
makes sure it is freed.
There were 4 places allocating virDomainHostdevDefs, all of them
parsers of one sort or another, and those have all had their
VIR_ALLOC(hostdev) changed to virDomainHostdevDefAlloc(). Other than
that, and the new functions, all the rest of the changes are just
mechanical removals of "&" or changing "." to "->".
---
V2: also add a virDomainDeviceInfoClear() function.
@@ -6653,43 +6653,37 @@ cleanup:
static virDomainHostdevDefPtr
qemuParseCommandLinePCI(const char *val)
{
-
-cleanup:
return def;
+
+ error:
Unusual spacing on the label.
> @@ -6768,9 +6757,11 @@ qemuParseCommandLineUSB(const char *val)
> def->source.subsys.u.usb.vendor = first;
> def->source.subsys.u.usb.product = second;
> }
-
-cleanup:
return def;
+
+ error:
And again.
ACK.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org