mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: use typedefs for enums in "src/util/" directory
In "src/util/" there are many enumeration (enum) declarations. Sometimes, it's better using a typedef for variable types, function types and other usages. Other enumeration will be changed to typedef's in the future. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
e4fe06e017
commit
1b14c449b8
@ -4972,7 +4972,7 @@ virDomainDiskSourceParse(xmlNodePtr node,
|
||||
|
||||
memset(&host, 0, sizeof(host));
|
||||
|
||||
switch ((enum virStorageType)src->type) {
|
||||
switch ((virStorageType)src->type) {
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
src->path = virXMLPropString(node, "file");
|
||||
break;
|
||||
@ -14847,7 +14847,7 @@ virDomainDiskSourceFormat(virBufferPtr buf,
|
||||
startupPolicy = virDomainStartupPolicyTypeToString(policy);
|
||||
|
||||
if (src->path || src->nhosts > 0 || src->srcpool || startupPolicy) {
|
||||
switch ((enum virStorageType)src->type) {
|
||||
switch ((virStorageType)src->type) {
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
virBufferAddLit(buf, "<source");
|
||||
virBufferEscapeString(buf, " file='%s'", src->path);
|
||||
|
@ -163,7 +163,7 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
|
||||
virQEMUDriverPtr driver,
|
||||
virDomainNetDefPtr net,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
enum virNetDevVPortProfileOp vmop)
|
||||
virNetDevVPortProfileOp vmop)
|
||||
{
|
||||
int rc;
|
||||
char *res_ifname = NULL;
|
||||
@ -3553,7 +3553,7 @@ qemuNetworkDriveGetPort(int protocol,
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch ((enum virStorageNetProtocol) protocol) {
|
||||
switch ((virStorageNetProtocol) protocol) {
|
||||
case VIR_STORAGE_NET_PROTOCOL_HTTP:
|
||||
return 80;
|
||||
|
||||
@ -3604,7 +3604,7 @@ qemuBuildNetworkDriveURI(int protocol,
|
||||
virURIPtr uri = NULL;
|
||||
size_t i;
|
||||
|
||||
switch ((enum virStorageNetProtocol) protocol) {
|
||||
switch ((virStorageNetProtocol) protocol) {
|
||||
case VIR_STORAGE_NET_PROTOCOL_NBD:
|
||||
if (nhosts != 1) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
@ -3842,7 +3842,7 @@ qemuGetDriveSourceString(virStorageSourcePtr src,
|
||||
}
|
||||
}
|
||||
|
||||
switch ((enum virStorageType) actualType) {
|
||||
switch ((virStorageType) actualType) {
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
case VIR_STORAGE_TYPE_DIR:
|
||||
@ -7495,7 +7495,7 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
int vlan,
|
||||
int bootindex,
|
||||
enum virNetDevVPortProfileOp vmop,
|
||||
virNetDevVPortProfileOp vmop,
|
||||
bool standalone)
|
||||
{
|
||||
int ret = -1;
|
||||
@ -7690,7 +7690,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
const char *migrateFrom,
|
||||
int migrateFd,
|
||||
virDomainSnapshotObjPtr snapshot,
|
||||
enum virNetDevVPortProfileOp vmop,
|
||||
virNetDevVPortProfileOp vmop,
|
||||
qemuBuildCommandLineCallbacksPtr callbacks,
|
||||
bool standalone)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
|
||||
const char *migrateFrom,
|
||||
int migrateFd,
|
||||
virDomainSnapshotObjPtr current_snapshot,
|
||||
enum virNetDevVPortProfileOp vmop,
|
||||
virNetDevVPortProfileOp vmop,
|
||||
qemuBuildCommandLineCallbacksPtr callbacks,
|
||||
bool forXMLToArgv)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11);
|
||||
@ -195,7 +195,7 @@ int qemuPhysIfaceConnect(virDomainDefPtr def,
|
||||
virQEMUDriverPtr driver,
|
||||
virDomainNetDefPtr net,
|
||||
virQEMUCapsPtr qemuCaps,
|
||||
enum virNetDevVPortProfileOp vmop);
|
||||
virNetDevVPortProfileOp vmop);
|
||||
|
||||
int qemuOpenVhostNet(virDomainDefPtr def,
|
||||
virDomainNetDefPtr net,
|
||||
|
@ -2269,8 +2269,8 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
|
||||
for (i = vm->def->ndisks; i > 0; i--) {
|
||||
disk = vm->def->disks[i - 1];
|
||||
const char *path = virDomainDiskGetSource(disk);
|
||||
enum virStorageFileFormat format = virDomainDiskGetFormat(disk);
|
||||
enum virStorageType type = virStorageSourceGetActualType(&disk->src);
|
||||
virStorageFileFormat format = virDomainDiskGetFormat(disk);
|
||||
virStorageType type = virStorageSourceGetActualType(&disk->src);
|
||||
|
||||
if (!path)
|
||||
continue;
|
||||
|
@ -12310,13 +12310,13 @@ qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk)
|
||||
{
|
||||
int actualType = virStorageSourceGetActualType(&disk->src);
|
||||
|
||||
switch ((enum virStorageType) actualType) {
|
||||
switch ((virStorageType) actualType) {
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
return 0;
|
||||
|
||||
case VIR_STORAGE_TYPE_NETWORK:
|
||||
switch ((enum virStorageNetProtocol) disk->src.protocol) {
|
||||
switch ((virStorageNetProtocol) disk->src.protocol) {
|
||||
case VIR_STORAGE_NET_PROTOCOL_NBD:
|
||||
case VIR_STORAGE_NET_PROTOCOL_RBD:
|
||||
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
|
||||
@ -12372,13 +12372,13 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
|
||||
{
|
||||
int actualType = virStorageSourceGetActualType(&disk->src);
|
||||
|
||||
switch ((enum virStorageType) actualType) {
|
||||
switch ((virStorageType) actualType) {
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
return 0;
|
||||
|
||||
case VIR_STORAGE_TYPE_NETWORK:
|
||||
switch ((enum virStorageNetProtocol) disk->src.protocol) {
|
||||
switch ((virStorageNetProtocol) disk->src.protocol) {
|
||||
case VIR_STORAGE_NET_PROTOCOL_GLUSTER:
|
||||
return 0;
|
||||
|
||||
@ -12420,7 +12420,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr
|
||||
{
|
||||
int actualType = virStorageSourceGetActualType(&disk->src);
|
||||
|
||||
switch ((enum virStorageType) actualType) {
|
||||
switch ((virStorageType) actualType) {
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
return 0;
|
||||
@ -12517,13 +12517,13 @@ qemuDomainSnapshotPrepareDiskInternal(virConnectPtr conn,
|
||||
|
||||
actualType = virStorageSourceGetActualType(&disk->src);
|
||||
|
||||
switch ((enum virStorageType) actualType) {
|
||||
switch ((virStorageType) actualType) {
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
case VIR_STORAGE_TYPE_FILE:
|
||||
return 0;
|
||||
|
||||
case VIR_STORAGE_TYPE_NETWORK:
|
||||
switch ((enum virStorageNetProtocol) disk->src.protocol) {
|
||||
switch ((virStorageNetProtocol) disk->src.protocol) {
|
||||
case VIR_STORAGE_NET_PROTOCOL_NBD:
|
||||
case VIR_STORAGE_NET_PROTOCOL_RBD:
|
||||
case VIR_STORAGE_NET_PROTOCOL_SHEEPDOG:
|
||||
@ -12749,7 +12749,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
|
||||
VIR_STRDUP(persistSource, snap->src.path) < 0)
|
||||
goto cleanup;
|
||||
|
||||
switch ((enum virStorageType)snap->src.type) {
|
||||
switch ((virStorageType)snap->src.type) {
|
||||
case VIR_STORAGE_TYPE_BLOCK:
|
||||
reuse = true;
|
||||
/* fallthrough */
|
||||
|
@ -3606,7 +3606,7 @@ int qemuProcessStart(virConnectPtr conn,
|
||||
int stdin_fd,
|
||||
const char *stdin_path,
|
||||
virDomainSnapshotObjPtr snapshot,
|
||||
enum virNetDevVPortProfileOp vmop,
|
||||
virNetDevVPortProfileOp vmop,
|
||||
unsigned int flags)
|
||||
{
|
||||
int ret;
|
||||
|
@ -57,7 +57,7 @@ int qemuProcessStart(virConnectPtr conn,
|
||||
int stdin_fd,
|
||||
const char *stdin_path,
|
||||
virDomainSnapshotObjPtr snapshot,
|
||||
enum virNetDevVPortProfileOp vmop,
|
||||
virNetDevVPortProfileOp vmop,
|
||||
unsigned int flags);
|
||||
|
||||
typedef enum {
|
||||
|
@ -736,7 +736,7 @@ virStorageBackendCreateQemuImgOpts(char **opts,
|
||||
for (i = 0; i < VIR_STORAGE_FILE_FEATURE_LAST; i++) {
|
||||
ignore_value(virBitmapGetBit(features, i, &b));
|
||||
if (b) {
|
||||
switch ((enum virStorageFileFeature) i) {
|
||||
switch ((virStorageFileFeature) i) {
|
||||
case VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS:
|
||||
if (STREQ_NULLABLE(compat, "0.10")) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
|
@ -82,7 +82,7 @@ void virAuditSend(virLogSourcePtr source,
|
||||
const char *funcname,
|
||||
const char *clienttty ATTRIBUTE_UNUSED,
|
||||
const char *clientaddr ATTRIBUTE_UNUSED,
|
||||
enum virAuditRecordType type ATTRIBUTE_UNUSED, bool success,
|
||||
virAuditRecordType type ATTRIBUTE_UNUSED, bool success,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
char *str = NULL;
|
||||
|
@ -26,11 +26,11 @@
|
||||
# include "internal.h"
|
||||
# include "virlog.h"
|
||||
|
||||
enum virAuditRecordType {
|
||||
typedef enum {
|
||||
VIR_AUDIT_RECORD_MACHINE_CONTROL,
|
||||
VIR_AUDIT_RECORD_MACHINE_ID,
|
||||
VIR_AUDIT_RECORD_RESOURCE,
|
||||
};
|
||||
} virAuditRecordType;
|
||||
|
||||
int virAuditOpen(void);
|
||||
|
||||
@ -39,7 +39,7 @@ void virAuditLog(int enabled);
|
||||
void virAuditSend(virLogSourcePtr source,
|
||||
const char *filename, size_t linenr, const char *funcname,
|
||||
const char *clienttty, const char *clientaddr,
|
||||
enum virAuditRecordType type, bool success,
|
||||
virAuditRecordType type, bool success,
|
||||
const char *fmt, ...)
|
||||
ATTRIBUTE_FMT_PRINTF(9, 10);
|
||||
|
||||
|
@ -810,7 +810,7 @@ virFileNBDDeviceFindUnused(void)
|
||||
|
||||
|
||||
int virFileNBDDeviceAssociate(const char *file,
|
||||
enum virStorageFileFormat fmt,
|
||||
virStorageFileFormat fmt,
|
||||
bool readonly,
|
||||
char **dev)
|
||||
{
|
||||
@ -879,7 +879,7 @@ int virFileLoopDeviceAssociate(const char *file,
|
||||
}
|
||||
|
||||
int virFileNBDDeviceAssociate(const char *file,
|
||||
enum virStorageFileFormat fmt ATTRIBUTE_UNUSED,
|
||||
virStorageFileFormat fmt ATTRIBUTE_UNUSED,
|
||||
bool readonly ATTRIBUTE_UNUSED,
|
||||
char **dev ATTRIBUTE_UNUSED)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@
|
||||
# include "internal.h"
|
||||
# include "virstoragefile.h"
|
||||
|
||||
typedef enum virFileCloseFlags {
|
||||
typedef enum {
|
||||
VIR_FILE_CLOSE_PRESERVE_ERRNO = 1 << 0,
|
||||
VIR_FILE_CLOSE_IGNORE_EBADF = 1 << 1,
|
||||
VIR_FILE_CLOSE_DONT_LOG = 1 << 2,
|
||||
@ -84,10 +84,10 @@ typedef virFileWrapperFd *virFileWrapperFdPtr;
|
||||
|
||||
int virFileDirectFdFlag(void);
|
||||
|
||||
enum virFileWrapperFdFlags {
|
||||
typedef enum {
|
||||
VIR_FILE_WRAPPER_BYPASS_CACHE = (1 << 0),
|
||||
VIR_FILE_WRAPPER_NON_BLOCKING = (1 << 1),
|
||||
};
|
||||
} virFileWrapperFdFlags;
|
||||
|
||||
virFileWrapperFdPtr virFileWrapperFdNew(int *fd,
|
||||
const char *name,
|
||||
@ -117,7 +117,7 @@ int virFileLoopDeviceAssociate(const char *file,
|
||||
char **dev);
|
||||
|
||||
int virFileNBDDeviceAssociate(const char *file,
|
||||
enum virStorageFileFormat fmt,
|
||||
virStorageFileFormat fmt,
|
||||
bool readonly,
|
||||
char **dev);
|
||||
|
||||
|
@ -26,32 +26,32 @@
|
||||
|
||||
# include "internal.h"
|
||||
|
||||
enum virHookDriverType {
|
||||
typedef enum {
|
||||
VIR_HOOK_DRIVER_DAEMON = 0, /* Daemon related events */
|
||||
VIR_HOOK_DRIVER_QEMU, /* QEmu domains related events */
|
||||
VIR_HOOK_DRIVER_LXC, /* LXC domains related events */
|
||||
VIR_HOOK_DRIVER_NETWORK, /* network related events */
|
||||
|
||||
VIR_HOOK_DRIVER_LAST,
|
||||
};
|
||||
} virHookDriverType;
|
||||
|
||||
enum virHookDaemonOpType {
|
||||
typedef enum {
|
||||
VIR_HOOK_DAEMON_OP_START, /* daemon is about to start */
|
||||
VIR_HOOK_DAEMON_OP_SHUTDOWN, /* daemon is about to shutdown */
|
||||
VIR_HOOK_DAEMON_OP_RELOAD, /* driver reload with SIGHUP */
|
||||
|
||||
VIR_HOOK_DAEMON_OP_LAST,
|
||||
};
|
||||
} virHookDaemonOpType;
|
||||
|
||||
enum virHookSubopType {
|
||||
typedef enum {
|
||||
VIR_HOOK_SUBOP_NONE, /* no sub-operation */
|
||||
VIR_HOOK_SUBOP_BEGIN, /* beginning of the operation */
|
||||
VIR_HOOK_SUBOP_END, /* end of the operation */
|
||||
|
||||
VIR_HOOK_SUBOP_LAST,
|
||||
};
|
||||
} virHookSubopType;
|
||||
|
||||
enum virHookQemuOpType {
|
||||
typedef enum {
|
||||
VIR_HOOK_QEMU_OP_START, /* domain is about to start */
|
||||
VIR_HOOK_QEMU_OP_STOPPED, /* domain has stopped */
|
||||
VIR_HOOK_QEMU_OP_PREPARE, /* domain startup initiated */
|
||||
@ -62,9 +62,9 @@ enum virHookQemuOpType {
|
||||
VIR_HOOK_QEMU_OP_ATTACH, /* domain is being attached to be libvirt */
|
||||
|
||||
VIR_HOOK_QEMU_OP_LAST,
|
||||
};
|
||||
} virHookQemuOpType;
|
||||
|
||||
enum virHookLxcOpType {
|
||||
typedef enum {
|
||||
VIR_HOOK_LXC_OP_START, /* domain is about to start */
|
||||
VIR_HOOK_LXC_OP_STOPPED, /* domain has stopped */
|
||||
VIR_HOOK_LXC_OP_PREPARE, /* domain startup initiated */
|
||||
@ -73,9 +73,9 @@ enum virHookLxcOpType {
|
||||
VIR_HOOK_LXC_OP_RECONNECT, /* domain is being reconnected by libvirt */
|
||||
|
||||
VIR_HOOK_LXC_OP_LAST,
|
||||
};
|
||||
} virHookLxcOpType;
|
||||
|
||||
enum virHookNetworkOpType {
|
||||
typedef enum {
|
||||
VIR_HOOK_NETWORK_OP_START, /* network is about to start */
|
||||
VIR_HOOK_NETWORK_OP_STARTED, /* network has start */
|
||||
VIR_HOOK_NETWORK_OP_STOPPED, /* network has stopped */
|
||||
@ -83,7 +83,7 @@ enum virHookNetworkOpType {
|
||||
VIR_HOOK_NETWORK_OP_IFACE_UNPLUGGED, /* an interface was unplugged from the network */
|
||||
|
||||
VIR_HOOK_NETWORK_OP_LAST,
|
||||
};
|
||||
} virHookNetworkOpType;
|
||||
|
||||
int virHookInitialize(void);
|
||||
|
||||
|
@ -24,8 +24,7 @@
|
||||
#ifndef __VIR_INITCTL_H__
|
||||
# define __VIR_INITCTL_H__
|
||||
|
||||
typedef enum virInitctlRunLevel virInitctlRunLevel;
|
||||
enum virInitctlRunLevel {
|
||||
typedef enum {
|
||||
VIR_INITCTL_RUNLEVEL_POWEROFF = 0,
|
||||
VIR_INITCTL_RUNLEVEL_1 = 1,
|
||||
VIR_INITCTL_RUNLEVEL_2 = 2,
|
||||
@ -35,7 +34,7 @@ enum virInitctlRunLevel {
|
||||
VIR_INITCTL_RUNLEVEL_REBOOT = 6,
|
||||
|
||||
VIR_INITCTL_RUNLEVEL_LAST
|
||||
};
|
||||
} virInitctlRunLevel;
|
||||
|
||||
int virInitctlSetRunLevel(virInitctlRunLevel level);
|
||||
|
||||
|
@ -434,7 +434,7 @@ struct virNetlinkCallbackData {
|
||||
char *linkdev;
|
||||
int vf;
|
||||
unsigned char vmuuid[VIR_UUID_BUFLEN];
|
||||
enum virNetDevVPortProfileOp vmOp;
|
||||
virNetDevVPortProfileOp vmOp;
|
||||
unsigned int linkState;
|
||||
};
|
||||
|
||||
@ -748,7 +748,7 @@ virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
|
||||
const char *linkdev,
|
||||
const unsigned char *vmuuid,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
enum virNetDevVPortProfileOp vmOp)
|
||||
virNetDevVPortProfileOp vmOp)
|
||||
{
|
||||
virNetlinkCallbackDataPtr calld = NULL;
|
||||
|
||||
@ -803,13 +803,13 @@ virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
|
||||
int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
|
||||
const virMacAddr *macaddress,
|
||||
const char *linkdev,
|
||||
enum virNetDevMacVLanMode mode,
|
||||
virNetDevMacVLanMode mode,
|
||||
bool withTap,
|
||||
int vnet_hdr,
|
||||
const unsigned char *vmuuid,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
char **res_ifname,
|
||||
enum virNetDevVPortProfileOp vmOp,
|
||||
virNetDevVPortProfileOp vmOp,
|
||||
char *stateDir,
|
||||
virNetDevBandwidthPtr bandwidth)
|
||||
{
|
||||
@ -1022,7 +1022,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
|
||||
const char *linkdev,
|
||||
const unsigned char *vmuuid,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
enum virNetDevVPortProfileOp vmOp)
|
||||
virNetDevVPortProfileOp vmOp)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
@ -30,14 +30,14 @@
|
||||
# include "virnetdevvportprofile.h"
|
||||
|
||||
/* the mode type for macvtap devices */
|
||||
enum virNetDevMacVLanMode {
|
||||
typedef enum {
|
||||
VIR_NETDEV_MACVLAN_MODE_VEPA,
|
||||
VIR_NETDEV_MACVLAN_MODE_PRIVATE,
|
||||
VIR_NETDEV_MACVLAN_MODE_BRIDGE,
|
||||
VIR_NETDEV_MACVLAN_MODE_PASSTHRU,
|
||||
|
||||
VIR_NETDEV_MACVLAN_MODE_LAST,
|
||||
};
|
||||
} virNetDevMacVLanMode;
|
||||
VIR_ENUM_DECL(virNetDevMacVLanMode)
|
||||
|
||||
int virNetDevMacVLanCreate(const char *ifname,
|
||||
@ -55,13 +55,13 @@ int virNetDevMacVLanDelete(const char *ifname)
|
||||
int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
|
||||
const virMacAddr *macaddress,
|
||||
const char *linkdev,
|
||||
enum virNetDevMacVLanMode mode,
|
||||
virNetDevMacVLanMode mode,
|
||||
bool withTap,
|
||||
int vnet_hdr,
|
||||
const unsigned char *vmuuid,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
char **res_ifname,
|
||||
enum virNetDevVPortProfileOp vmop,
|
||||
virNetDevVPortProfileOp vmop,
|
||||
char *stateDir,
|
||||
virNetDevBandwidthPtr bandwidth)
|
||||
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(7)
|
||||
@ -81,7 +81,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
|
||||
const char *linkdev,
|
||||
const unsigned char *vmuuid,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
enum virNetDevVPortProfileOp vmOp)
|
||||
virNetDevVPortProfileOp vmOp)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
@ -90,7 +90,7 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
|
||||
const char *linkdev,
|
||||
const unsigned char *vmuuid,
|
||||
virNetDevVPortProfilePtr virtPortProfile,
|
||||
enum virNetDevVPortProfileOp vmOp)
|
||||
virNetDevVPortProfileOp vmOp)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
|
||||
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
|
||||
#endif /* __UTIL_MACVTAP_H__ */
|
||||
|
@ -1139,7 +1139,7 @@ virNetDevVPortProfileAssociate(const char *macvtap_ifname,
|
||||
const char *linkdev,
|
||||
int vf,
|
||||
const unsigned char *vmuuid,
|
||||
enum virNetDevVPortProfileOp vmOp,
|
||||
virNetDevVPortProfileOp vmOp,
|
||||
bool setlink_only)
|
||||
{
|
||||
int rc = 0;
|
||||
@ -1202,7 +1202,7 @@ virNetDevVPortProfileDisassociate(const char *macvtap_ifname,
|
||||
const virMacAddr *macvtap_macaddr,
|
||||
const char *linkdev,
|
||||
int vf,
|
||||
enum virNetDevVPortProfileOp vmOp)
|
||||
virNetDevVPortProfileOp vmOp)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
|
@ -40,7 +40,7 @@ enum virNetDevVPortProfile {
|
||||
};
|
||||
VIR_ENUM_DECL(virNetDevVPort)
|
||||
|
||||
enum virNetDevVPortProfileOp {
|
||||
typedef enum {
|
||||
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
|
||||
VIR_NETDEV_VPORT_PROFILE_OP_SAVE,
|
||||
VIR_NETDEV_VPORT_PROFILE_OP_RESTORE,
|
||||
@ -51,7 +51,7 @@ enum virNetDevVPortProfileOp {
|
||||
VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
|
||||
|
||||
VIR_NETDEV_VPORT_PROFILE_OP_LAST
|
||||
};
|
||||
} virNetDevVPortProfileOp;
|
||||
VIR_ENUM_DECL(virNetDevVPortProfileOp)
|
||||
|
||||
/* profile data for macvtap (VEPA) and openvswitch */
|
||||
@ -98,7 +98,7 @@ int virNetDevVPortProfileAssociate(const char *ifname,
|
||||
const char *linkdev,
|
||||
int vf,
|
||||
const unsigned char *vmuuid,
|
||||
enum virNetDevVPortProfileOp vmOp,
|
||||
virNetDevVPortProfileOp vmOp,
|
||||
bool setlink_only)
|
||||
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(6)
|
||||
ATTRIBUTE_RETURN_CHECK;
|
||||
@ -108,7 +108,7 @@ int virNetDevVPortProfileDisassociate(const char *ifname,
|
||||
const virMacAddr *macaddr,
|
||||
const char *linkdev,
|
||||
int vf,
|
||||
enum virNetDevVPortProfileOp vmOp)
|
||||
virNetDevVPortProfileOp vmOp)
|
||||
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4)
|
||||
ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
|
@ -26,13 +26,13 @@
|
||||
# include "virbitmap.h"
|
||||
# include "virutil.h"
|
||||
|
||||
enum virNumaTuneMemPlacementMode {
|
||||
typedef enum {
|
||||
VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_DEFAULT = 0,
|
||||
VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_STATIC,
|
||||
VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_AUTO,
|
||||
|
||||
VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_LAST
|
||||
};
|
||||
} virNumaTuneMemPlacementMode;
|
||||
|
||||
VIR_ENUM_DECL(virNumaTuneMemPlacementMode)
|
||||
|
||||
|
@ -22,14 +22,14 @@
|
||||
#ifndef __SECLABEL_H
|
||||
# define __SECLABEL_H
|
||||
|
||||
enum virDomainSeclabelType {
|
||||
typedef enum {
|
||||
VIR_DOMAIN_SECLABEL_DEFAULT,
|
||||
VIR_DOMAIN_SECLABEL_NONE,
|
||||
VIR_DOMAIN_SECLABEL_DYNAMIC,
|
||||
VIR_DOMAIN_SECLABEL_STATIC,
|
||||
|
||||
VIR_DOMAIN_SECLABEL_LAST
|
||||
};
|
||||
} virDomainSeclabelType;
|
||||
|
||||
/* Security configuration for domain */
|
||||
typedef struct _virSecurityLabelDef virSecurityLabelDef;
|
||||
|
@ -29,11 +29,11 @@
|
||||
|
||||
# include <libxml/tree.h>
|
||||
|
||||
enum virStorageEncryptionSecretType {
|
||||
typedef enum {
|
||||
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE = 0,
|
||||
|
||||
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_LAST
|
||||
};
|
||||
} virStorageEncryptionSecretType;
|
||||
VIR_ENUM_DECL(virStorageEncryptionSecretType)
|
||||
|
||||
typedef struct _virStorageEncryptionSecret virStorageEncryptionSecret;
|
||||
|
@ -42,7 +42,7 @@
|
||||
* virStorageVolType, except we have an undetermined state, don't have
|
||||
* a netdir type, and add a volume type for reference through a
|
||||
* storage pool. */
|
||||
enum virStorageType {
|
||||
typedef enum {
|
||||
VIR_STORAGE_TYPE_NONE,
|
||||
VIR_STORAGE_TYPE_FILE,
|
||||
VIR_STORAGE_TYPE_BLOCK,
|
||||
@ -51,12 +51,12 @@ enum virStorageType {
|
||||
VIR_STORAGE_TYPE_VOLUME,
|
||||
|
||||
VIR_STORAGE_TYPE_LAST
|
||||
};
|
||||
} virStorageType;
|
||||
|
||||
VIR_ENUM_DECL(virStorage)
|
||||
|
||||
|
||||
enum virStorageFileFormat {
|
||||
typedef enum {
|
||||
VIR_STORAGE_FILE_AUTO_SAFE = -2,
|
||||
VIR_STORAGE_FILE_AUTO = -1,
|
||||
VIR_STORAGE_FILE_NONE = 0,
|
||||
@ -84,15 +84,15 @@ enum virStorageFileFormat {
|
||||
VIR_STORAGE_FILE_VMDK,
|
||||
|
||||
VIR_STORAGE_FILE_LAST,
|
||||
};
|
||||
} virStorageFileFormat;
|
||||
|
||||
VIR_ENUM_DECL(virStorageFileFormat);
|
||||
|
||||
enum virStorageFileFeature {
|
||||
typedef enum {
|
||||
VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS = 0,
|
||||
|
||||
VIR_STORAGE_FILE_FEATURE_LAST
|
||||
};
|
||||
} virStorageFileFeature;
|
||||
|
||||
VIR_ENUM_DECL(virStorageFileFeature);
|
||||
|
||||
@ -117,7 +117,7 @@ struct _virStorageTimestamps {
|
||||
|
||||
|
||||
/* Information related to network storage */
|
||||
enum virStorageNetProtocol {
|
||||
typedef enum {
|
||||
VIR_STORAGE_NET_PROTOCOL_NBD,
|
||||
VIR_STORAGE_NET_PROTOCOL_RBD,
|
||||
VIR_STORAGE_NET_PROTOCOL_SHEEPDOG,
|
||||
@ -130,18 +130,18 @@ enum virStorageNetProtocol {
|
||||
VIR_STORAGE_NET_PROTOCOL_TFTP,
|
||||
|
||||
VIR_STORAGE_NET_PROTOCOL_LAST
|
||||
};
|
||||
} virStorageNetProtocol;
|
||||
|
||||
VIR_ENUM_DECL(virStorageNetProtocol)
|
||||
|
||||
|
||||
enum virStorageNetHostTransport {
|
||||
typedef enum {
|
||||
VIR_STORAGE_NET_HOST_TRANS_TCP,
|
||||
VIR_STORAGE_NET_HOST_TRANS_UNIX,
|
||||
VIR_STORAGE_NET_HOST_TRANS_RDMA,
|
||||
|
||||
VIR_STORAGE_NET_HOST_TRANS_LAST
|
||||
};
|
||||
} virStorageNetHostTransport;
|
||||
|
||||
VIR_ENUM_DECL(virStorageNetHostTransport)
|
||||
|
||||
@ -160,7 +160,7 @@ struct _virStorageNetHostDef {
|
||||
* Used for volume "type" disk to indicate how to represent
|
||||
* the disk source if the specified "pool" is of iscsi type.
|
||||
*/
|
||||
enum virStorageSourcePoolMode {
|
||||
typedef enum {
|
||||
VIR_STORAGE_SOURCE_POOL_MODE_DEFAULT = 0,
|
||||
|
||||
/* Use the path as it shows up on host, e.g.
|
||||
@ -174,7 +174,7 @@ enum virStorageSourcePoolMode {
|
||||
VIR_STORAGE_SOURCE_POOL_MODE_DIRECT,
|
||||
|
||||
VIR_STORAGE_SOURCE_POOL_MODE_LAST
|
||||
};
|
||||
} virStorageSourcePoolMode;
|
||||
|
||||
VIR_ENUM_DECL(virStorageSourcePoolMode)
|
||||
|
||||
@ -190,13 +190,13 @@ struct _virStorageSourcePoolDef {
|
||||
typedef virStorageSourcePoolDef *virStorageSourcePoolDefPtr;
|
||||
|
||||
|
||||
enum virStorageSecretType {
|
||||
typedef enum {
|
||||
VIR_STORAGE_SECRET_TYPE_NONE,
|
||||
VIR_STORAGE_SECRET_TYPE_UUID,
|
||||
VIR_STORAGE_SECRET_TYPE_USAGE,
|
||||
|
||||
VIR_STORAGE_SECRET_TYPE_LAST
|
||||
};
|
||||
} virStorageSecretType;
|
||||
|
||||
typedef struct _virStorageDriverData virStorageDriverData;
|
||||
typedef virStorageDriverData *virStorageDriverDataPtr;
|
||||
|
@ -28,11 +28,11 @@
|
||||
# include "virutil.h"
|
||||
# include "virbuffer.h"
|
||||
|
||||
enum virSysinfoType {
|
||||
typedef enum {
|
||||
VIR_SYSINFO_SMBIOS,
|
||||
|
||||
VIR_SYSINFO_LAST
|
||||
};
|
||||
} virSysinfoType;
|
||||
|
||||
typedef struct _virSysinfoProcessorDef virSysinfoProcessorDef;
|
||||
typedef virSysinfoProcessorDef *virSysinfoProcessorDefPtr;
|
||||
|
@ -294,7 +294,7 @@ enum {
|
||||
struct testChainData
|
||||
{
|
||||
const char *start;
|
||||
enum virStorageFileFormat format;
|
||||
virStorageFileFormat format;
|
||||
const testFileData *files[4];
|
||||
int nfiles;
|
||||
unsigned int flags;
|
||||
|
Loading…
Reference in New Issue
Block a user