[libvirt] [PATCH 06/17] conf: make hostdev info a separate object

Eric Blake eblake at redhat.com
Sat Mar 3 02:34:52 UTC 2012


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 at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120302/1b2068f6/attachment-0001.sig>


More information about the libvir-list mailing list