Re: [libvirt] [PATCH 09/17] conf: put subsys part of virDomainHostdevDef into its own struct

2012-03-02 Thread Eric Blake
On 02/28/2012 01:14 PM, Laine Stump wrote:
> To shorten some new code that accesses the many fields within the
> subsys struct of a hostdev, create a separate toplevel, typedefed
> virDomainHostdevSubsys struct so that we can define temporary pointers
> to the subsys part.
> ---
> New patch for V2.
> 
>  src/conf/domain_conf.h |   31 ++-
>  1 files changed, 18 insertions(+), 13 deletions(-)

ACK.

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



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 09/17] conf: put subsys part of virDomainHostdevDef into its own struct

2012-02-28 Thread Laine Stump
To shorten some new code that accesses the many fields within the
subsys struct of a hostdev, create a separate toplevel, typedefed
virDomainHostdevSubsys struct so that we can define temporary pointers
to the subsys part.
---
New patch for V2.

 src/conf/domain_conf.h |   31 ++-
 1 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index efb86bc..1a29fdb 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -354,25 +354,30 @@ enum virDomainHostdevSubsysType {
 VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
 };
 
+
+typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
+typedef virDomainHostdevSubsys *virDomainHostdevSubsysPtr;
+struct _virDomainHostdevSubsys {
+int type; /* enum virDomainHostdevBusType */
+union {
+struct {
+unsigned bus;
+unsigned device;
+
+unsigned vendor;
+unsigned product;
+} usb;
+virDomainDevicePCIAddress pci; /* host address */
+} u;
+};
+
 /* basic device for direct passthrough */
 struct _virDomainHostdevDef {
 virDomainDeviceDef parent; /* higher level Def containing this */
 int mode; /* enum virDomainHostdevMode */
 unsigned int managed : 1;
 union {
-struct {
-int type; /* enum virDomainHostdevBusType */
-union {
-struct {
-unsigned bus;
-unsigned device;
-
-unsigned vendor;
-unsigned product;
-} usb;
-virDomainDevicePCIAddress pci; /* host address */
-} u;
-} subsys;
+virDomainHostdevSubsys subsys;
 struct {
 /* TBD: struct capabilities see:
  * 
https://www.redhat.com/archives/libvir-list/2008-July/msg00429.html
-- 
1.7.7.6

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