[libvirt] [PATCH] Change 'interface' to 'iface' in virNetworkDHCPLease
by Daniel P. Berrange
Variables/fields named 'interface' clash with system
header symbols on some platforms.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
daemon/remote.c | 4 ++--
include/libvirt/libvirt.h.in | 2 +-
src/libvirt.c | 2 +-
src/network/bridge_driver.c | 2 +-
src/remote/remote_driver.c | 2 +-
src/remote/remote_protocol.x | 2 +-
src/remote_protocol-structs | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
Pushed as build-breaker fix
diff --git a/daemon/remote.c b/daemon/remote.c
index f4ec8ea..ae19b2a 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -6223,7 +6223,7 @@ remoteSerializeDHCPLease(remote_network_dhcp_lease *lease_dst, virNetworkDHCPLea
lease_dst->type = lease_src->type;
lease_dst->prefix = lease_src->prefix;
- if (VIR_STRDUP(lease_dst->interface, lease_src->interface) < 0 ||
+ if (VIR_STRDUP(lease_dst->iface, lease_src->iface) < 0 ||
VIR_STRDUP(lease_dst->ipaddr, lease_src->ipaddr) < 0 ||
VIR_STRDUP(*mac_tmp, lease_src->mac) < 0 ||
VIR_STRDUP(*iaid_tmp, lease_src->iaid) < 0 ||
@@ -6248,7 +6248,7 @@ remoteSerializeDHCPLease(remote_network_dhcp_lease *lease_dst, virNetworkDHCPLea
VIR_FREE(hostname_tmp);
VIR_FREE(clientid_tmp);
VIR_FREE(lease_dst->ipaddr);
- VIR_FREE(lease_dst->interface);
+ VIR_FREE(lease_dst->iface);
return -1;
}
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index b3120e2..7e695a3 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -5174,7 +5174,7 @@ typedef enum {
typedef struct _virNetworkDHCPLease virNetworkDHCPLease;
typedef virNetworkDHCPLease *virNetworkDHCPLeasePtr;
struct _virNetworkDHCPLease {
- char *interface; /* Network interface name */
+ char *iface; /* Network interface name */
long long expirytime; /* Seconds since epoch */
int type; /* virIPAddrType */
char *mac; /* MAC address */
diff --git a/src/libvirt.c b/src/libvirt.c
index f4d03bc..a0cdfa2 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -21176,7 +21176,7 @@ virNetworkDHCPLeaseFree(virNetworkDHCPLeasePtr lease)
{
if (!lease)
return;
- VIR_FREE(lease->interface);
+ VIR_FREE(lease->iface);
VIR_FREE(lease->mac);
VIR_FREE(lease->iaid);
VIR_FREE(lease->ipaddr);
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index d5577e0..a407c6e 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3490,7 +3490,7 @@ networkGetDHCPLeasesHelper(virNetworkObjPtr obj,
if ((VIR_STRDUP(lease->mac, mac_tmp) < 0) ||
(VIR_STRDUP(lease->ipaddr, ip_tmp) < 0) ||
- (VIR_STRDUP(lease->interface, obj->def->bridge) < 0))
+ (VIR_STRDUP(lease->iface, obj->def->bridge) < 0))
goto error;
/* Fields that can be NULL */
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index af79cb5..76ce4a9 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -7557,7 +7557,7 @@ remoteSerializeDHCPLease(virNetworkDHCPLeasePtr lease_dst, remote_network_dhcp_l
lease_dst->type = lease_src->type;
lease_dst->prefix = lease_src->prefix;
- if (VIR_STRDUP(lease_dst->interface, lease_src->interface) < 0)
+ if (VIR_STRDUP(lease_dst->iface, lease_src->iface) < 0)
goto error;
if (VIR_STRDUP(lease_dst->ipaddr, lease_src->ipaddr) < 0)
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index b5f44f7..4b75bdb 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -3022,7 +3022,7 @@ struct remote_node_get_free_pages_ret {
};
struct remote_network_dhcp_lease {
- remote_nonnull_string interface;
+ remote_nonnull_string iface;
hyper expirytime;
int type;
remote_string mac;
diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index d363247..222f125 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2486,7 +2486,7 @@ struct remote_node_get_free_pages_ret {
} counts;
};
struct remote_network_dhcp_lease {
- remote_nonnull_string interface;
+ remote_nonnull_string iface;
int64_t expirytime;
int type;
remote_string mac;
--
1.9.3
10 years, 6 months
[libvirt] [PATCH v2 0/2] virtportallocator: remember not auto allocated graphics ports
by Giuseppe Scrivano
Changes in v2:
* virPortAllocatorSetUsed returns an error if the port is already used.
* Changed *[pP]ortAllocated to *[pP]ortReserved that keep track only of ports that
were marked used but not bound.
* Handle separately port and tlsPort for SPICE.
Fix a conflict when both autoport graphics and statically configured
ports are used, like:
<graphics type='spice' autoport='yes'/>
<graphics type='vnc' port='5900' autoport='no'/>
More details in 2/2
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1081881
Giuseppe Scrivano (2):
virtportallocator: new function "virPortAllocatorSetUsed"
graphics: remember graphics not auto allocated ports
src/conf/domain_conf.h | 3 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_process.c | 68 +++++++++++++++++++++++++++++++++++++++++----
src/util/virportallocator.c | 44 ++++++++++++++++++++++++++++-
src/util/virportallocator.h | 4 +++
5 files changed, 113 insertions(+), 7 deletions(-)
--
1.9.3
10 years, 6 months
[libvirt] [PATCH] Fix shadowed variable with older gcc
by Ján Tomko
Commit 2cff94c fixed the shadowed 'link' added by commit 975f0e2,
but forgot the 'link' added by commit 08aa22e.
---
Pushed as a build-breaker fix.
tests/virstoragetest.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index f86d25c..e85dc6e 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -542,16 +542,16 @@ static const char *testPathCanonicalizeSymlinks[][2] =
static int
testPathCanonicalizeReadlink(const char *path,
- char **link,
+ char **linkpath,
void *data ATTRIBUTE_UNUSED)
{
size_t i;
- *link = NULL;
+ *linkpath = NULL;
for (i = 0; i < ARRAY_CARDINALITY(testPathCanonicalizeSymlinks); i++) {
if (STREQ(path, testPathCanonicalizeSymlinks[i][0])) {
- if (VIR_STRDUP(*link, testPathCanonicalizeSymlinks[i][1]) < 0)
+ if (VIR_STRDUP(*linkpath, testPathCanonicalizeSymlinks[i][1]) < 0)
return -1;
return 0;
--
1.8.5.5
10 years, 6 months
[libvirt] [PATCH v3] LXC: trivially support flag VIR_DRV_FEATURE_TYPED_PARAM_STRING
by Chen Hanxiao
fix:
virsh -c lxc:/// memtune DOMAIN
error: Unable to get number of memory parameters
error: unsupported flags (0x4) in function lxcDomainGetMemoryParameters
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
v2: also fix a similar issue in lxcDomainGetSchedulerParametersFlags
v3: fix improper comments
src/lxc/lxc_driver.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 06f3e18..3875bf3 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -895,7 +895,11 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
size_t i;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
- VIR_DOMAIN_AFFECT_CONFIG, -1);
+ VIR_DOMAIN_AFFECT_CONFIG |
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ /* We don't return strings, and thus trivially support this flag. */
+ flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
if (!(vm = lxcDomObjFromDomain(dom)))
goto cleanup;
@@ -1993,7 +1997,11 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom,
virLXCDomainObjPrivatePtr priv;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
- VIR_DOMAIN_AFFECT_CONFIG, -1);
+ VIR_DOMAIN_AFFECT_CONFIG |
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ /* We don't return strings, and thus trivially support this flag. */
+ flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
if (!(vm = lxcDomObjFromDomain(dom)))
goto cleanup;
--
1.9.0
10 years, 6 months
[libvirt] [PATCH 0/3] Couple of huge pages improvements
by Michal Privoznik
*** BLURB HERE ***
Michal Privoznik (3):
virNumaGetPageInfo: Take huge pages into account
virNumaGetPages: Don't fail on huge page-less systems
virnuma: Actually build huge page code
src/nodeinfo.c | 2 +-
src/util/virnuma.c | 87 +++++++++++++++++++++++++++++++-----------------------
src/util/virnuma.h | 1 +
3 files changed, 52 insertions(+), 38 deletions(-)
--
1.8.5.5
10 years, 6 months
[libvirt] [PATCH V3] enhance capabilities mode hostdev process
by Jincheng Miao
hostdev has mode "capabilities" for LXC, from formatdomain.html:
"
Block / character devices from the host can be passed through to
the guest using the hostdev element.
This is only possible with container based virtualization.
since after 1.0.1 for LXC
"
So forbid capabilities mode hostdev if domain is not LXC.
The affected files are:
* src/libxl/libxl_domain.c
* src/openvz/openvz_driver.c
* src/qemu/qemu_domain.c
* src/uml/uml_driver.c
* src/xen/xen_driver.c
* src/xenapi/xenapi_driver.c
There are some drivers lack function devicesPostParseCallback(),
like: vbox, bhyve, and so on.
V3: move the hostdev checking to devicesPostParseCallback(),
this is more reasonable to check it in define phase, and
implement in each driver.
V2: move the hostdev checking to qemuBuildCommandLine().
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/libxl/libxl_domain.c | 8 ++++++++
src/openvz/openvz_driver.c | 9 +++++++++
src/qemu/qemu_domain.c | 9 +++++++++
src/uml/uml_driver.c | 9 +++++++++
src/xen/xen_driver.c | 9 +++++++++
src/xenapi/xenapi_driver.c | 9 +++++++++
6 files changed, 53 insertions(+)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 73242ac..96f3b88 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -485,6 +485,14 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
virDomainHostdevDefPtr hostdev = dev->data.hostdev;
+ /* forbid capabilities mode hostdev in this kind of hypervisor */
+ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported capabilities mode hostdev in %s"),
+ virDomainVirtTypeToString(def->virtType));
+ return -1;
+ }
+
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
hostdev->source.subsys.u.pci.backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT)
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 4c815ed..8635f50 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -113,6 +113,15 @@ openvzDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
dev->data.chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE)
dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ;
+ /* forbid capabilities mode hostdev in this kind of hypervisor */
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
+ dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported capabilities mode hostdev in %s"),
+ virDomainVirtTypeToString(def->virtType));
+ return -1;
+ }
+
return 0;
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e40c5ec..9c07385 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -940,6 +940,15 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
dev->data.chr->source.data.nix.listen = true;
}
+ /* forbid capabilities mode hostdev in this kind of hypervisor */
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
+ dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported capabilities mode hostdev in %s"),
+ virDomainVirtTypeToString(def->virtType));
+ goto cleanup;
+ }
+
ret = 0;
cleanup:
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 5ccd443..9990fc0 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -430,6 +430,15 @@ umlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
dev->data.chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE)
dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML;
+ /* forbid capabilities mode hostdev in this kind of hypervisor */
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
+ dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported capabilities mode hostdev in %s"),
+ virDomainVirtTypeToString(def->virtType));
+ return -1;
+ }
+
return 0;
}
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index bd51909..9882bd4 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -343,6 +343,15 @@ xenDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
STRNEQ(def->os.type, "hvm"))
dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
+ /* forbid capabilities mode hostdev in this kind of hypervisor */
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
+ dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported capabilities mode hostdev in %s"),
+ virDomainVirtTypeToString(def->virtType));
+ return -1;
+ }
+
return 0;
}
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 908448b..c2fe8a1 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -55,6 +55,15 @@ xenapiDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
STRNEQ(def->os.type, "hvm"))
dev->data.chr->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
+ /* forbid capabilities mode hostdev in this kind of hypervisor */
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
+ dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported capabilities mode hostdev in %s"),
+ virDomainVirtTypeToString(def->virtType));
+ return -1;
+ }
+
return 0;
}
--
1.8.4.2
10 years, 6 months
[libvirt] [PATCH v2] LXC: trivially support flag VIR_DRV_FEATURE_TYPED_PARAM_STRING
by Chen Hanxiao
fix:
virsh -c lxc:/// memtune DOMAIN
error: Unable to get number of memory parameters
error: unsupported flags (0x4) in function lxcDomainGetMemoryParameters
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
v2: also fix a similar issue in lxcDomainGetSchedulerParametersFlags
src/lxc/lxc_driver.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 06f3e18..d8a31d3 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -895,7 +895,13 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
size_t i;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
- VIR_DOMAIN_AFFECT_CONFIG, -1);
+ VIR_DOMAIN_AFFECT_CONFIG,
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ /* We blindly return a string, and let libvirt.c and
+ * remote_driver.c do the filtering on behalf of older clients
+ * that can't parse it. */
+ flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
if (!(vm = lxcDomObjFromDomain(dom)))
goto cleanup;
@@ -1993,7 +1999,13 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom,
virLXCDomainObjPrivatePtr priv;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
- VIR_DOMAIN_AFFECT_CONFIG, -1);
+ VIR_DOMAIN_AFFECT_CONFIG |
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ /* We blindly return a string, and let libvirt.c and
+ * remote_driver.c do the filtering on behalf of older clients
+ * that can't parse it. */
+ flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
if (!(vm = lxcDomObjFromDomain(dom)))
goto cleanup;
--
1.9.0
10 years, 6 months
[libvirt] [PATCH] storage: gluster: Avoid name shadow on older compilers
by Peter Krempa
s/link/linkpath/g in virStorageFileBackendGlusterReadlinkCallback as
older gcc complains.
---
Notes:
Pushed as trivial.
src/storage/storage_backend_gluster.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index c8077a1..cab23b0 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -717,7 +717,7 @@ virStorageFileBackendGlusterAccess(virStorageSourcePtr src,
static int
virStorageFileBackendGlusterReadlinkCallback(const char *path,
- char **link,
+ char **linkpath,
void *data)
{
virStorageFileBackendGlusterPrivPtr priv = data;
@@ -726,7 +726,7 @@ virStorageFileBackendGlusterReadlinkCallback(const char *path,
ssize_t ret;
struct stat st;
- *link = NULL;
+ *linkpath = NULL;
if (glfs_stat(priv->vol, path, &st) < 0) {
virReportSystemError(errno,
@@ -754,7 +754,7 @@ virStorageFileBackendGlusterReadlinkCallback(const char *path,
buf[ret] = '\0';
- *link = buf;
+ *linkpath = buf;
return 0;
--
1.9.3
10 years, 6 months
[libvirt] [PATCH 0/2] virtportallocator: remember not auto allocated graphics ports
by Giuseppe Scrivano
Fix a conflict when both autoport graphics and statically configured
ports are used, like:
<graphics type='spice' autoport='yes'/>
<graphics type='vnc' port='5900' autoport='no'/>
More details in 2/2
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1081881
Giuseppe Scrivano (2):
virtportallocator: new function "virPortAllocatorSetUsed"
graphics: remember graphics not auto allocated ports
src/conf/domain_conf.h | 3 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_process.c | 79 +++++++++++++++++++++++++++++++++++++++------
src/util/virportallocator.c | 40 ++++++++++++++++++++++-
src/util/virportallocator.h | 4 +++
5 files changed, 117 insertions(+), 10 deletions(-)
--
1.9.3
10 years, 6 months