[libvirt] [PATCH v2 5/6] conf: Clean up the _virNodeDevCapData

Pavel Hrdina phrdina at redhat.com
Fri Mar 3 09:20:50 UTC 2017


On Thu, Mar 02, 2017 at 11:14:26AM -0500, John Ferlan wrote:
> Rather than a bunch of embedded union structs, let's create structs
> for each of the structs within the union and make the struct easier
> to read.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/conf/node_device_conf.h | 224 ++++++++++++++++++++++++--------------------
>  1 file changed, 125 insertions(+), 99 deletions(-)
> 
> diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
> index f05e61b..1107a88 100644
> --- a/src/conf/node_device_conf.h
> +++ b/src/conf/node_device_conf.h
> @@ -103,108 +103,134 @@ typedef enum {
>  
>  VIR_ENUM_DECL(virNodeDevDRM)
>  
> +typedef struct _virNodeDevCapSystemHardware {
> +    char *vendor_name;
> +    char *version;
> +    char *serial;
> +    unsigned char uuid[VIR_UUID_BUFLEN];
> +} virNodeDevSystemHardware, *virNodeDevSystemHardwarePtr;

In Libvirt we usually place each typedef on separate line, so this would be:

typedef struct _virNodeDevCapSystemHardware virNodeDevSystemHardware;
typedef virNodeDevSystemHardware *virNodeDevSystemHardwarePtr;
struct _virNodeDevCapSystemHardware {
    ...
};

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170303/827dee7a/attachment-0001.sig>


More information about the libvir-list mailing list