diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f1df0929ad68dc8029acc0e5cc858bbfbb41b457..56df5bcf31194904543abea97fc3bc259284b032 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4099,7 +4099,7 @@ virDomainHostdevSubsysSCSIDefParseXML(xmlNodePtr node, */ static bool virDomainDriveAddressIsUsedByDisk(const virDomainDef *def, - enum virDomainDiskBus type, + virDomainDiskBus type, unsigned int controller, unsigned int unit) { @@ -4128,7 +4128,7 @@ virDomainDriveAddressIsUsedByDisk(const virDomainDef *def, */ static bool virDomainDriveAddressIsUsedByHostdev(const virDomainDef *def, - enum virDomainHostdevSubsysType type, + virDomainHostdevSubsysType type, unsigned int controller, unsigned int unit) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8f17c74010fcef10cfc524a35c129b3ae90fbfbc..40d96ddf56f7bdb238477eb691304a1cdb12cb7c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -183,7 +183,7 @@ struct _virDomainDeviceDef { /* Different types of hypervisor */ /* NB: Keep in sync with virDomainVirtTypeToString impl */ -enum virDomainVirtType { +typedef enum { VIR_DOMAIN_VIRT_QEMU, VIR_DOMAIN_VIRT_KQEMU, VIR_DOMAIN_VIRT_KVM, @@ -200,9 +200,9 @@ enum virDomainVirtType { VIR_DOMAIN_VIRT_BHYVE, VIR_DOMAIN_VIRT_LAST -}; +} virDomainVirtType; -enum virDomainDeviceAddressType { +typedef enum { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE, @@ -216,15 +216,15 @@ enum virDomainDeviceAddressType { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST -}; +} virDomainDeviceAddressType; -enum virDomainPCIRombarMode { +typedef enum { VIR_DOMAIN_PCI_ROMBAR_DEFAULT = 0, VIR_DOMAIN_PCI_ROMBAR_ON, VIR_DOMAIN_PCI_ROMBAR_OFF, VIR_DOMAIN_PCI_ROMBAR_LAST -}; +} virDomainPCIRombarMode; typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress; typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr; @@ -277,12 +277,12 @@ struct _virDomainDeviceSpaprVioAddress { bool has_reg; }; -enum virDomainControllerMaster { +typedef enum { VIR_DOMAIN_CONTROLLER_MASTER_NONE, VIR_DOMAIN_CONTROLLER_MASTER_USB, VIR_DOMAIN_CONTROLLER_MASTER_LAST -}; +} virDomainControllerMaster; typedef struct _virDomainDeviceUSBMaster virDomainDeviceUSBMaster; typedef virDomainDeviceUSBMaster *virDomainDeviceUSBMasterPtr; @@ -363,20 +363,20 @@ struct _virDomainLeaseDef { }; -enum virDomainHostdevMode { +typedef enum { VIR_DOMAIN_HOSTDEV_MODE_SUBSYS, VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES, VIR_DOMAIN_HOSTDEV_MODE_LAST -}; +} virDomainHostdevMode; -enum virDomainHostdevSubsysType { +typedef enum { VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI, VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST -}; +} virDomainHostdevSubsysType; /* the backend driver used for PCI hostdev devices */ typedef enum { @@ -419,13 +419,13 @@ struct _virDomainHostdevSubsys { }; -enum virDomainHostdevCapsType { +typedef enum { VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE, VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC, VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET, VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST -}; +} virDomainHostdevCapsType; typedef struct _virDomainHostdevCaps virDomainHostdevCaps; typedef virDomainHostdevCaps *virDomainHostdevCapsPtr; @@ -465,16 +465,16 @@ struct _virDomainHostdevDef { /* Types of disk frontend (guest view). For backends (host view), see * virStorageType in util/virstoragefile.h */ -enum virDomainDiskDevice { +typedef enum { VIR_DOMAIN_DISK_DEVICE_DISK, VIR_DOMAIN_DISK_DEVICE_CDROM, VIR_DOMAIN_DISK_DEVICE_FLOPPY, VIR_DOMAIN_DISK_DEVICE_LUN, VIR_DOMAIN_DISK_DEVICE_LAST -}; +} virDomainDiskDevice; -enum virDomainDiskBus { +typedef enum { VIR_DOMAIN_DISK_BUS_IDE, VIR_DOMAIN_DISK_BUS_FDC, VIR_DOMAIN_DISK_BUS_SCSI, @@ -486,9 +486,9 @@ enum virDomainDiskBus { VIR_DOMAIN_DISK_BUS_SD, VIR_DOMAIN_DISK_BUS_LAST -}; +} virDomainDiskBus; -enum virDomainDiskCache { +typedef enum { VIR_DOMAIN_DISK_CACHE_DEFAULT, VIR_DOMAIN_DISK_CACHE_DISABLE, VIR_DOMAIN_DISK_CACHE_WRITETHRU, @@ -497,9 +497,9 @@ enum virDomainDiskCache { VIR_DOMAIN_DISK_CACHE_UNSAFE, VIR_DOMAIN_DISK_CACHE_LAST -}; +} virDomainDiskCache; -enum virDomainDiskErrorPolicy { +typedef enum { VIR_DOMAIN_DISK_ERROR_POLICY_DEFAULT, VIR_DOMAIN_DISK_ERROR_POLICY_STOP, VIR_DOMAIN_DISK_ERROR_POLICY_REPORT, @@ -507,82 +507,82 @@ enum virDomainDiskErrorPolicy { VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE, VIR_DOMAIN_DISK_ERROR_POLICY_LAST -}; +} virDomainDiskErrorPolicy; -enum virDomainDiskTray { +typedef enum { VIR_DOMAIN_DISK_TRAY_CLOSED, VIR_DOMAIN_DISK_TRAY_OPEN, VIR_DOMAIN_DISK_TRAY_LAST -}; +} virDomainDiskTray; -enum virDomainDiskGeometryTrans { +typedef enum { VIR_DOMAIN_DISK_TRANS_DEFAULT = 0, VIR_DOMAIN_DISK_TRANS_NONE, VIR_DOMAIN_DISK_TRANS_AUTO, VIR_DOMAIN_DISK_TRANS_LBA, VIR_DOMAIN_DISK_TRANS_LAST -}; +} virDomainDiskGeometryTrans; -enum virDomainDiskIo { +typedef enum { VIR_DOMAIN_DISK_IO_DEFAULT, VIR_DOMAIN_DISK_IO_NATIVE, VIR_DOMAIN_DISK_IO_THREADS, VIR_DOMAIN_DISK_IO_LAST -}; +} virDomainDiskIo; -enum virDomainIoEventFd { +typedef enum { VIR_DOMAIN_IO_EVENT_FD_DEFAULT = 0, VIR_DOMAIN_IO_EVENT_FD_ON, VIR_DOMAIN_IO_EVENT_FD_OFF, VIR_DOMAIN_IO_EVENT_FD_LAST -}; +} virDomainIoEventFd; -enum virDomainVirtioEventIdx { +typedef enum { VIR_DOMAIN_VIRTIO_EVENT_IDX_DEFAULT = 0, VIR_DOMAIN_VIRTIO_EVENT_IDX_ON, VIR_DOMAIN_VIRTIO_EVENT_IDX_OFF, VIR_DOMAIN_VIRTIO_EVENT_IDX_LAST -}; +} virDomainVirtioEventIdx; -enum virDomainDiskCopyOnRead { +typedef enum { VIR_DOMAIN_DISK_COPY_ON_READ_DEFAULT = 0, VIR_DOMAIN_DISK_COPY_ON_READ_ON, VIR_DOMAIN_DISK_COPY_ON_READ_OFF, VIR_DOMAIN_DISK_COPY_ON_READ_LAST -}; +} virDomainDiskCopyOnRead; -enum virDomainStartupPolicy { +typedef enum { VIR_DOMAIN_STARTUP_POLICY_DEFAULT = 0, VIR_DOMAIN_STARTUP_POLICY_MANDATORY, VIR_DOMAIN_STARTUP_POLICY_REQUISITE, VIR_DOMAIN_STARTUP_POLICY_OPTIONAL, VIR_DOMAIN_STARTUP_POLICY_LAST -}; +} virDomainStartupPolicy; -enum virDomainDeviceSGIO { +typedef enum { VIR_DOMAIN_DEVICE_SGIO_DEFAULT = 0, VIR_DOMAIN_DEVICE_SGIO_FILTERED, VIR_DOMAIN_DEVICE_SGIO_UNFILTERED, VIR_DOMAIN_DEVICE_SGIO_LAST -}; +} virDomainDeviceSGIO; -enum virDomainDiskDiscard { +typedef enum { VIR_DOMAIN_DISK_DISCARD_DEFAULT = 0, VIR_DOMAIN_DISK_DISCARD_UNMAP, VIR_DOMAIN_DISK_DISCARD_IGNORE, VIR_DOMAIN_DISK_DISCARD_LAST -}; +} virDomainDiskDiscard; typedef struct _virDomainBlockIoTuneInfo virDomainBlockIoTuneInfo; struct _virDomainBlockIoTuneInfo { @@ -866,8 +866,8 @@ struct _virDomainNetDef { struct { enum virDomainNetBackendType name; /* which driver backend to use */ enum virDomainNetVirtioTxModeType txmode; - enum virDomainIoEventFd ioeventfd; - enum virDomainVirtioEventIdx event_idx; + virDomainIoEventFd ioeventfd; + virDomainVirtioEventIdx event_idx; unsigned int queues; /* Multiqueue virtio-net */ } virtio; } driver; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1d5bce658d97b5d69b27a1e5b956266ced88952e..2e3dced4b2ce306220fec231ef31468d3a6b8fa2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1144,7 +1144,7 @@ int qemuDomainCCWAddressAssign(virDomainDeviceInfoPtr dev, static void qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, - enum virDomainDeviceAddressType type) + virDomainDeviceAddressType type) { /* declare address-less virtio devices to be of address type 'type' @@ -2596,7 +2596,7 @@ qemuBuildRomStr(virBufferPtr buf, static int qemuBuildIoEventFdStr(virBufferPtr buf, - enum virDomainIoEventFd use, + virDomainIoEventFd use, virQEMUCapsPtr qemuCaps) { if (use && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_IOEVENTFD)) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 78cfdc69f22727618f9d592f80044760d46e0421..8f14259e9e08f32be1307a3aec41eacf335beb6a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2221,7 +2221,7 @@ qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver, virUUIDFormat(vm->def->uuid, uuid); - switch ((enum virDomainStartupPolicy) startupPolicy) { + switch ((virDomainStartupPolicy) startupPolicy) { case VIR_DOMAIN_STARTUP_POLICY_OPTIONAL: break; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index b209b049deeb76231286e04af708f9054a88b0b9..45c57fb79ae2c07ed9eb57395c8eaa9db1464d05 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2598,7 +2598,7 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, virDomainAuditHostdev(vm, hostdev, "detach", true); - switch ((enum virDomainHostdevSubsysType) hostdev->source.subsys.type) { + switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: qemuDomainRemovePCIHostDevice(driver, vm, hostdev); break; diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 00f47cbde95c28bb435f280b9a08fc130077adf8..73bd83aa6c3ed5404caf098a98a41c89a1e1a9c0 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -488,7 +488,7 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr, if (cbdata.secdef && cbdata.secdef->norelabel) return 0; - switch ((enum virDomainHostdevSubsysType) dev->source.subsys.type) { + switch ((virDomainHostdevSubsysType) dev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: { virUSBDevicePtr usb; @@ -615,7 +615,7 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr, if (dev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) return 0; - switch ((enum virDomainHostdevSubsysType) dev->source.subsys.type) { + switch ((virDomainHostdevSubsysType) dev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: { virUSBDevicePtr usb;