diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 9b5d172817..50e68059a6 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -35,7 +35,7 @@ # define CREATE_DEVICE 1 # define EXISTING_DEVICE 0 -enum virNodeDevCapType { +typedef enum { /* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */ VIR_NODE_DEV_CAP_SYSTEM, /* System capability */ VIR_NODE_DEV_CAP_PCI_DEV, /* PCI device */ @@ -51,38 +51,38 @@ enum virNodeDevCapType { VIR_NODE_DEV_CAP_SCSI_GENERIC, /* SCSI generic device */ VIR_NODE_DEV_CAP_LAST -}; +} virNodeDevCapType; -enum virNodeDevNetCapType { +typedef enum { /* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */ VIR_NODE_DEV_CAP_NET_80203, /* 802.03 network device */ VIR_NODE_DEV_CAP_NET_80211, /* 802.11 network device */ VIR_NODE_DEV_CAP_NET_LAST -}; +} virNodeDevNetCapType; VIR_ENUM_DECL(virNodeDevCap) VIR_ENUM_DECL(virNodeDevNetCap) -enum virNodeDevStorageCapFlags { +typedef enum { VIR_NODE_DEV_CAP_STORAGE_REMOVABLE = (1 << 0), VIR_NODE_DEV_CAP_STORAGE_REMOVABLE_MEDIA_AVAILABLE = (1 << 1), VIR_NODE_DEV_CAP_STORAGE_HOTPLUGGABLE = (1 << 2), -}; +} virNodeDevStorageCapFlags; -enum virNodeDevSCSIHostCapFlags { +typedef enum { VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST = (1 << 0), VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS = (1 << 1), -}; +} virNodeDevSCSIHostCapFlags; -enum virNodeDevPCICapFlags { +typedef enum { VIR_NODE_DEV_CAP_FLAG_PCI_PHYSICAL_FUNCTION = (1 << 0), VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION = (1 << 1), -}; +} virNodeDevPCICapFlags; typedef struct _virNodeDevCapsDef virNodeDevCapsDef; typedef virNodeDevCapsDef *virNodeDevCapsDefPtr; struct _virNodeDevCapsDef { - enum virNodeDevCapType type; + virNodeDevCapType type; union _virNodeDevCapData { struct { char *product_name; @@ -135,7 +135,7 @@ struct _virNodeDevCapsDef { char *address; unsigned int address_len; char *ifname; - enum virNodeDevNetCapType subtype; /* LAST -> no subtype */ + virNodeDevNetCapType subtype; /* LAST -> no subtype */ } net; struct { unsigned int host; diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index ac4d4a8afd..a12e645ff4 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -1061,7 +1061,7 @@ virNWFilterVarAccessGetVarName(const virNWFilterVarAccess *vap) return vap->varName; } -enum virNWFilterVarAccessType +virNWFilterVarAccessType virNWFilterVarAccessGetType(const virNWFilterVarAccess *vap) { return vap->accessType; diff --git a/src/conf/nwfilter_params.h b/src/conf/nwfilter_params.h index 08e448f0cd..98610a7f71 100644 --- a/src/conf/nwfilter_params.h +++ b/src/conf/nwfilter_params.h @@ -27,17 +27,17 @@ # include "virbuffer.h" # include "virmacaddr.h" -enum virNWFilterVarValueType { +typedef enum { NWFILTER_VALUE_TYPE_SIMPLE, NWFILTER_VALUE_TYPE_ARRAY, NWFILTER_VALUE_TYPE_LAST -}; +} virNWFilterVarValueType; typedef struct _virNWFilterVarValue virNWFilterVarValue; typedef virNWFilterVarValue *virNWFilterVarValuePtr; struct _virNWFilterVarValue { - enum virNWFilterVarValueType valType; + virNWFilterVarValueType valType; union { struct { char *value; @@ -98,17 +98,17 @@ bool virNWFilterHashTableEqual(virNWFilterHashTablePtr a, # define NWFILTER_VARNAME_CTRL_IP_LEARNING "CTRL_IP_LEARNING" # define NWFILTER_VARNAME_DHCPSERVER "DHCPSERVER" -enum virNWFilterVarAccessType { +typedef enum { VIR_NWFILTER_VAR_ACCESS_ELEMENT = 0, VIR_NWFILTER_VAR_ACCESS_ITERATOR = 1, VIR_NWFILTER_VAR_ACCESS_LAST, -}; +} virNWFilterVarAccessType; typedef struct _virNWFilterVarAccess virNWFilterVarAccess; typedef virNWFilterVarAccess *virNWFilterVarAccessPtr; struct _virNWFilterVarAccess { - enum virNWFilterVarAccessType accessType; + virNWFilterVarAccessType accessType; union { struct { unsigned int index; @@ -128,7 +128,7 @@ virNWFilterVarAccessPtr virNWFilterVarAccessParse(const char *varAccess); void virNWFilterVarAccessPrint(virNWFilterVarAccessPtr vap, virBufferPtr buf); const char *virNWFilterVarAccessGetVarName(const virNWFilterVarAccess *vap); -enum virNWFilterVarAccessType virNWFilterVarAccessGetType( +virNWFilterVarAccessType virNWFilterVarAccessGetType( const virNWFilterVarAccess *vap); unsigned int virNWFilterVarAccessGetIterId(const virNWFilterVarAccess *vap); unsigned int virNWFilterVarAccessGetIndex(const virNWFilterVarAccess *vap); diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 5dbc3ebe4b..8656b5db38 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -1,7 +1,7 @@ /* * node_device_hal.c: node device enumeration - HAL-based implementation * - * Copyright (C) 2011, 2013 Red Hat, Inc. + * Copyright (C) 2011-2014 Red Hat, Inc. * Copyright (C) 2008 Virtual Iron Software, Inc. * Copyright (C) 2008 David F. Lively * @@ -343,7 +343,7 @@ gather_system_cap(LibHalContext *ctx, const char *udi, struct _caps_tbl_entry { const char *cap_name; - enum virNodeDevCapType type; + virNodeDevCapType type; int (*gather_fn)(LibHalContext *ctx, const char *udi, union _virNodeDevCapData *data); diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index d24f2dc794..9a951d9bd0 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1176,7 +1176,7 @@ udevHasDeviceProperty(struct udev_device *dev, static int udevGetDeviceType(struct udev_device *device, - enum virNodeDevCapType *type) + virNodeDevCapType *type) { const char *devtype = NULL; char *subsystem = NULL;