[libvirt] [PATCHv2 0/2] Honor DAC norelabel attribute
by Michal Privoznik
Version two, this time split into two patches.
Michal Privoznik (2):
security_dac: Rework to make it more readable
security_dac: Honor norelabel attribute
src/security/security_dac.c | 355 ++++++++++++++++++++++++++------------------
1 file changed, 213 insertions(+), 142 deletions(-)
--
1.9.0
10 years, 7 months
[libvirt] [PATCH 1/3] virutil: Introduce a new macro named CLAMP.
by Dongsheng Yang
This patch introduce a new macro to return a
value clamped to a given range.
Signed-off-by: Dongsheng Yang <yangds.fnst(a)cn.fujitsu.com>
---
src/util/virutil.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/util/virutil.h b/src/util/virutil.h
index 2bb74e2..e8536d8 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -37,6 +37,12 @@
# ifndef MAX
# define MAX(a, b) ((a) > (b) ? (a) : (b))
# endif
+# ifndef CLAMP
+# define CLAMP(v, min, max) ({ \
+ typeof(v) _v = v; \
+ _v = _v < min ? min: _v; \
+ _v > max ? max: _v; })
+# endif
int virSetBlocking(int fd, bool blocking) ATTRIBUTE_RETURN_CHECK;
int virSetNonBlock(int fd) ATTRIBUTE_RETURN_CHECK;
--
1.8.2.1
10 years, 7 months
[libvirt] [PATCH] Hyper-V 2012 R2 support
by vikhyath reddy
Hi,
This patch adds support to libvirt to work with Hyper-V 2012 R2. This
will however mean
that Hyper-V 2008 will no longer be supported. Microsoft supports
hyperv 2008 management
via windows 7 and hyperv 2012 via windows 8.1 (note that the reverse
is not true, that is,
win 7 cannot manage hyperv 2012 and win 8.1 cannot manage hyperv
2008). I think they wanted
to keep the application code separate, in the sense that one manages
the old namespace and
the new one manages the new v2 namespace. The difference between the
two namespaces is not great
either, sadly, both of them have same class names but with different
field types (int, string etc.)
which have been separated by the namespace root/virtualization vs
root/virtualization/v2
For users who wish to use libvirt to manage Hyper-V 2008, using an
older version of libvirt <= 1.4.2 should work.
Since new Hyper-V 2008 drivers wont be contributed to libvirt anyway,
so it is not like the users will be missing on features.
And it is more likely that all future contributions to libvirt will be
on Hyper-V 2012 R2 and beyond.
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index aed9307..0253496 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -893,8 +893,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain,
unsigned int flags)
if (VIR_STRDUP(def->name, computerSystem->data->ElementName) < 0)
goto cleanup;
- if (VIR_STRDUP(def->description,
virtualSystemSettingData->data->Notes) < 0)
- goto cleanup;
+ // No need to check length of Notes, it is now a dynamic array
def->mem.max_balloon = memorySettingData->data->Limit * 1024; /*
megabyte to kilobyte */
def->mem.cur_balloon = memorySettingData->data->VirtualQuantity *
1024; /* megabyte to kilobyte */
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 6e6f629..4c9ad34 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -39,7 +39,7 @@
"http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/*"
#define ROOT_VIRTUALIZATION \
- "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/*"
+ "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/*"
#define VIR_FROM_THIS VIR_FROM_HYPERV
diff --git a/src/hyperv/hyperv_wmi_generator.input
b/src/hyperv/hyperv_wmi_generator.input
index 97f9dff..bb0e8c1 100644
--- a/src/hyperv/hyperv_wmi_generator.input
+++ b/src/hyperv/hyperv_wmi_generator.input
@@ -20,6 +20,9 @@
#
# Based on MSDN Hyper-V WMI Classes:
# http://msdn.microsoft.com/en-us/library/cc136986%28v=vs.85%29.aspx
+# Hyper-V 2012 version (root/virtualization/v2 namespace):
http://msdn.microsoft.com/en-us/library/hh850257(v=vs.85).aspx
+# + Currently, Classes {Msvm_MemorySettingData,
Msvm_ProcessorSettingData, Msvm_VirtualSystemSettingData} are in v2
namespace
+# + Will eventually need to upgrade the remainder of the
classes as well.
#
@@ -97,80 +100,90 @@ end
class Msvm_MemorySettingData
- string Caption
- string Description
- string InstanceID
- string ElementName
- uint16 ResourceType
- string OtherResourceType
- string ResourceSubType
- string PoolID
- uint16 ConsumerVisibility
- string HostResource[]
- string AllocationUnits
- uint64 VirtualQuantity
- uint64 Reservation
- uint64 Limit
- uint32 Weight
- boolean AutomaticAllocation
- boolean AutomaticDeallocation
- string Parent
- string Connection[]
- string Address
- uint16 MappingBehavior
- boolean IsVirtualized
- string DeviceID
- string DeviceIDFormat
- boolean DynamicMemoryEnabled
-# uint32 TargetMemoryBuffer # Available only on Windows Server 2008 R2 SP1
+ string InstanceID
+ string Caption
+ string Description
+ string ElementName
+ uint16 ResourceType
+ string OtherResourceType
+ string ResourceSubType
+ string PoolID
+ uint16 ConsumerVisibility
+ string HostResource[]
+ string AllocationUnits
+ uint64 VirtualQuantity
+ uint64 Reservation
+ uint64 Limit
+ uint32 Weight
+ boolean AutomaticAllocation
+ boolean AutomaticDeallocation
+ string Parent
+ string Connection[]
+ string Address
+ uint16 MappingBehavior
+ string AddressOnParent
+ string VirtualQuantityUnits
+ boolean DynamicMemoryEnabled
+ uint32 TargetMemoryBuffer
+ boolean IsVirtualized
+ boolean SwapFilesInUse
+ uint64 MaxMemoryBlocksPerNumaNode
end
class Msvm_ProcessorSettingData
- string Caption
- string Description
- string InstanceID
- string ElementName
- uint16 ResourceType
- string OtherResourceType
- string ResourceSubType
- string PoolID
- uint16 ConsumerVisibility
- string HostResource[]
- string AllocationUnits
- uint64 VirtualQuantity
- uint64 Reservation
- uint64 Limit
- uint32 Weight
- boolean AutomaticAllocation
- boolean AutomaticDeallocation
- string Parent
- string Connection[]
- string Address
- uint16 MappingBehavior
- boolean IsVirtualized
- string DeviceID
- string DeviceIDFormat
- uint16 ProcessorsPerSocket
- uint16 SocketCount
- boolean ThreadsEnabled
- boolean LimitCPUID
- boolean LimitProcessorFeatures
+ string InstanceID
+ string Caption
+ string Description
+ string ElementName
+ uint16 ResourceType
+ string OtherResourceType
+ string ResourceSubType
+ string PoolID
+ uint16 ConsumerVisibility
+ string HostResource[]
+ string AllocationUnits
+ uint64 VirtualQuantity
+ uint64 Reservation
+ uint64 Limit
+ uint32 Weight
+ boolean AutomaticAllocation
+ boolean AutomaticDeallocation
+ string Parent
+ string Connection[]
+ string Address
+ uint16 MappingBehavior
+ string AddressOnParent
+ string VirtualQuantityUnits
+ boolean LimitCPUID
+ boolean LimitProcessorFeatures
+ uint64 MaxProcessorsPerNumaNode
+ uint64 MaxNumaNodesPerSocket
end
class Msvm_VirtualSystemSettingData
+ string InstanceID
string Caption
string Description
string ElementName
- string InstanceID
- string SystemName
- uint16 SettingType
- uint16 VirtualSystemType
- string OtherVirtualSystemType
- boolean AutoActivate
+ string VirtualSystemIdentifier
+ string VirtualSystemType
+ string Notes[]
datetime CreationTime
- string Notes
+ string ConfigurationID
+ string ConfigurationDataRoot
+ string ConfigurationFile
+ string SnapshotDataRoot
+ string SuspendDataRoot
+ string SwapFileDataRoot
+ string LogDataRoot
+ uint16 AutomaticStartupAction
+ datetime AutomaticStartupActionDelay
+ uint16 AutomaticStartupActionSequenceNumber
+ uint16 AutomaticShutdownAction
+ uint16 AutomaticRecoveryAction
+ string RecoveryFile
string BIOSGUID
string BIOSSerialNumber
string BaseBoardSerialNumber
@@ -179,8 +192,22 @@ class Msvm_VirtualSystemSettingData
boolean BIOSNumLock
uint16 BootOrder[]
string Parent
- uint16 NumaNodeList[]
- boolean NumaNodesAreRequired
+ boolean IsSaved
+ string AdditionalRecoveryInformation
+ boolean AllowFullSCSICommandSet
+ uint32 DebugChannelId
+ uint16 DebugPortEnabled
+ uint32 DebugPort
+ string Version
+ boolean IncrementalBackupEnabled
+ boolean VirtualNumaEnabled
+ boolean AllowReducedFcRedundancy
+ string VirtualSystemSubType
+ string BootSourceOrder[]
+ boolean PauseAfterBootFailure
+ uint16 NetworkBootPreferredProtocol
+ boolean SecureBootEnabled
+ uint64 LowMmioGapSize
end
diff --git a/src/hyperv/hyperv_wmi_generator.py
b/src/hyperv/hyperv_wmi_generator.py
index f767d54..af3ce7e 100755
--- a/src/hyperv/hyperv_wmi_generator.py
+++ b/src/hyperv/hyperv_wmi_generator.py
@@ -71,7 +71,7 @@ class Class:
if self.name.startswith("Win32_"):
header += "
\"http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/%s\"\n" %
self.name
else:
- header += "
\"http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/%s\"\n"
% self.name
+ header += "
\"http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/%s\"\n"
% self.name
header += "\n"
header += "#define %s_CLASSNAME \\\n" % name_upper
10 years, 7 months
[libvirt] [PATCH 0/3] Minor chardev fixes
by Ján Tomko
Ján Tomko (3):
Remove chardev port calculation from DomainDefParse
Move console target port setting to DeviceDefPostParse
Create a console stub for the first serial device
src/conf/domain_conf.c | 77 ++++++++++++++++++++------------------------------
1 file changed, 30 insertions(+), 47 deletions(-)
--
1.8.3.2
10 years, 7 months
[libvirt] [PATCHv4 0/3] Time setting and getting in qemu guests
by Michal Privoznik
Hopefully the last round.
diff to v3:
-rebase & resend
Michal Privoznik (3):
Introduce virDomain{Get,Set}Time APIs
virsh: Expose virDomain{Get,Set}Time
qemu: Implement virDomain{Get,Set}Time
daemon/remote.c | 37 ++++++++++++
include/libvirt/libvirt.h.in | 14 +++++
src/access/viraccessperm.c | 2 +-
src/access/viraccessperm.h | 7 ++-
src/driver.h | 14 +++++
src/libvirt.c | 94 ++++++++++++++++++++++++++++++
src/libvirt_public.syms | 2 +
src/qemu/qemu_agent.c | 99 ++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 8 +++
src/qemu/qemu_driver.c | 109 +++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 35 ++++++++++++
src/remote/remote_protocol.x | 31 +++++++++-
src/remote_protocol-structs | 16 ++++++
tools/virsh-domain-monitor.c | 132 +++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 16 ++++++
15 files changed, 613 insertions(+), 3 deletions(-)
--
1.9.0
10 years, 7 months
[libvirt] [PATCH] qemu: Avoid leak in qemuDomainCheckRemoveOptionalDisk
by Jiri Denemark
Coverity complains about event being leaked in
qemuDomainCheckRemoveOptionalDisk. The best fix for it is to avoid
searching for the disk (using its srouce path even) we got by walking
through vm->def->disks array.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 7a0be12..78cfdc6 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2176,11 +2176,11 @@ qemuDomainSetFakeReboot(virQEMUDriverPtr driver,
static int
qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainDiskDefPtr disk)
+ size_t diskIndex)
{
char uuid[VIR_UUID_STRING_BUFLEN];
virObjectEventPtr event = NULL;
- virDomainDiskDefPtr del_disk = NULL;
+ virDomainDiskDefPtr disk = vm->def->disks[diskIndex];
const char *src = virDomainDiskGetSource(disk);
virUUIDFormat(vm->def->uuid, uuid);
@@ -2200,13 +2200,8 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
event = virDomainEventDiskChangeNewFromObj(vm, src, NULL,
disk->info.alias,
VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START);
-
- if (!(del_disk = virDomainDiskRemoveByName(vm->def, src))) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("no source device %s"), src);
- return -1;
- }
- virDomainDiskDefFree(del_disk);
+ virDomainDiskRemove(vm->def, diskIndex);
+ virDomainDiskDefFree(disk);
}
if (event)
@@ -2218,11 +2213,11 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver,
static int
qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainDiskDefPtr disk,
+ size_t diskIndex,
bool cold_boot)
{
char uuid[VIR_UUID_STRING_BUFLEN];
- int startupPolicy = disk->startupPolicy;
+ int startupPolicy = vm->def->disks[diskIndex]->startupPolicy;
virUUIDFormat(vm->def->uuid, uuid);
@@ -2244,7 +2239,7 @@ qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver,
break;
}
- if (qemuDomainCheckRemoveOptionalDisk(driver, vm, disk) < 0)
+ if (qemuDomainCheckRemoveOptionalDisk(driver, vm, diskIndex) < 0)
goto error;
return 0;
@@ -2282,11 +2277,11 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
{
int ret = -1;
size_t i;
- virDomainDiskDefPtr disk;
VIR_DEBUG("Checking for disk presence");
for (i = vm->def->ndisks; i > 0; i--) {
- disk = vm->def->disks[i - 1];
+ size_t idx = i - 1;
+ virDomainDiskDefPtr disk = vm->def->disks[idx];
const char *path = virDomainDiskGetSource(disk);
virStorageFileFormat format = virDomainDiskGetFormat(disk);
virStorageType type = virStorageSourceGetActualType(&disk->src);
@@ -2308,7 +2303,7 @@ qemuDomainCheckDiskPresence(virQEMUDriverPtr driver,
continue;
if (disk->startupPolicy &&
- qemuDomainCheckDiskStartupPolicy(driver, vm, disk,
+ qemuDomainCheckDiskStartupPolicy(driver, vm, idx,
cold_boot) >= 0) {
virResetLastError();
continue;
--
1.9.3
10 years, 7 months
[libvirt] [PATCH] virsh: For virsh migrate --tunnelled, use the virDomainMigrateToURI3 API.
by Richard W.M. Jones
Using virsh migrate + the --tunnelled flag causes virsh to use the
wrong API. This gives the error:
error: use virDomainMigrateToURI3 for peer-to-peer migration
As the error message is wrong, this patch also corrects the error
message.
https://bugzilla.redhat.com/show_bug.cgi?id=1095924
Signed-off-by: Richard W.M. Jones <rjones(a)redhat.com>
Cc: Jiri Denemark <jdenemar(a)redhat.com>
---
src/libvirt.c | 2 +-
tools/virsh-domain.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 2cd793c..6a361f6 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5726,7 +5726,7 @@ virDomainMigrate3(virDomainPtr domain,
if (flags & (VIR_MIGRATE_PEER2PEER | VIR_MIGRATE_TUNNELLED)) {
virReportInvalidArg(flags, "%s",
_("use virDomainMigrateToURI3 for peer-to-peer "
- "migration"));
+ "or tunnelled migration"));
goto error;
}
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3a7c260..5a5ce9d 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -8959,6 +8959,7 @@ doMigrate(void *opaque)
flags |= VIR_MIGRATE_ABORT_ON_ERROR;
if ((flags & VIR_MIGRATE_PEER2PEER) ||
+ (flags & VIR_MIGRATE_TUNNELLED) ||
vshCommandOptBool(cmd, "direct")) {
/* migrateuri doesn't make sense for tunnelled migration */
--
1.9.0
10 years, 7 months
[libvirt] [PATCH 0/3] security_dac: trivial cleanups
by Jim Fehlig
A while back, Michal Privoznik posted a small series to honor the
DAC norelabel attribute
https://www.redhat.com/archives/libvir-list/2014-April/msg00196.html
When reviewing patch 1, Jan Tomko noted that trivial whitespace changes and
the like should be separate from changes to the callback parameter passing.
This small series contains the most trivial changes Michal made to patch 1.
By "most trivial", I mean these could probably be pushed under the trivail rule,
but posting for a quick review nonetheless.
Jim Fehlig (3):
security_dac: Remove unnecessary ATTRIBUTE_UNUSED
security_dac: Remove unnecessary curly braces
security_dac: Fix indentation
src/security/security_dac.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
--
1.8.1.4
10 years, 7 months
[libvirt] [PATCH] virsh: Return false if only '--wipe-storage' is assigned when undefine a domain
by Li Yang
For now, if only '--wipe-storage' is assigned, user can undefine a
domain normally. But actually '--wipe-storage' doesn't work, this
may confuse user. And since '--wipe-storage' wipes data on the
removed volumes, if no removed volume storage assigned, we'd better
raise an error message.
Before:
$ virsh undefine virt-tests-vm1 --wipe-storage
Domain virt-tests-vm1 has been undefined
After:
$ virsh undefine virt-tests-vm1 --wipe-storage
error: '--wipe-storage' needs storage volume deletion: '--stroage <string>' or '--remove-all-storage' is necessary.
Signed-off-by: Li Yang <liyang.fnst(a)cn.fujitsu.com>
---
tools/virsh-domain.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3a7c260..25236a0 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2982,6 +2982,14 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
ignore_value(vshCommandOptString(cmd, "storage", &vol_string));
+ if (!(vol_string || remove_all_storage) && wipe_storage) {
+ vshError(ctl,
+ _("'--wipe-storage' needs storage volume deletion: "
+ "'--stroage <string>' or '--remove-all-storage' "
+ "is necessary."));
+ return false;
+ }
+
if (managed_save) {
flags |= VIR_DOMAIN_UNDEFINE_MANAGED_SAVE;
managed_save_safe = true;
--
1.7.1
10 years, 7 months
[libvirt] [PATCH 1/4] conf: use typedefs for enums in "src/conf/{node_device_conf, nwfilter_params}.h"
by Julio Faracco
In "src/conf/" there are many enumeration (enum) declarations. Similar to the recent cleanup to "src/util" directory, it's better to use a typedef for variable types, function types and other usages. Other enumeration and folders will be changed to typedef's in the future. Most of the files changed in this commit are reltaed to Network (node_device_conf.h and nwfilter_params.*) enums.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/conf/node_device_conf.h | 24 ++++++++++++------------
src/conf/nwfilter_params.c | 2 +-
src/conf/nwfilter_params.h | 14 +++++++-------
3 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
index 9b5d172..50e6805 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 ac4d4a8..a12e645 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 08e448f..98610a7 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);
--
1.7.10.4
10 years, 7 months