[libvirt] [PATCH] Fix build with older libcurl
by Ján Tomko
Add ATTRIBUTE_UNUSED marker to the unused timeout_ms option
in esxVI_MultiCURL_TimerCallback.
Introduced by commit 125007d.
---
Pushed under the build breaker rule.
src/esx/esx_vi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index fcd2e70..b00d8e7 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -711,7 +711,8 @@ esxVI_MultiCURL_SocketCallback(CURL *handle ATTRIBUTE_UNUSED,
static int
esxVI_MultiCURL_TimerCallback(CURLM *handle ATTRIBUTE_UNUSED,
- long timeout_ms, void *callback_opaque)
+ long timeout_ms ATTRIBUTE_UNUSED,
+ void *callback_opaque)
{
esxVI_MultiCURL *multi = callback_opaque;
--
2.0.4
10 years, 1 month
[libvirt] [PATCH-RFC-V2] qemu: Add network bandwidth setting for ethernet interfaces
by Anirban Chakraborty
V2:
Consolidate calls to virNetDevBandwidthSet
Clear bandwidth settings when the interface is detached or domain destroyed
V1:
Ethernet interfaces in libvirt currently do not support bandwidth setting.
For example, following xml file for an interface will not apply these
settings to corresponding qdiscs.
<interface type="ethernet">
<mac address="02:36:1d:18:2a:e4"/>
<model type="virtio"/>
<script path=""/>
<target dev="tap361d182a-e4"/>
<bandwidth>
<inbound average="984" peak="1024" burst="64"/>
<outbound average="2000" peak="2048" burst="128"/>
</bandwidth>
</interface>
Signed-off-by: Anirban Chakraborty <abchak(a)juniper.net>
---
src/conf/domain_conf.h | 7 +++++++
src/lxc/lxc_process.c | 27 ++++++++++++++-------------
src/qemu/qemu_command.c | 9 ++++-----
src/qemu/qemu_driver.c | 21 +++++++++++++++++++++
src/qemu/qemu_hotplug.c | 13 +++++++++++++
src/util/virnetdevmacvlan.c | 10 ----------
src/util/virnetdevmacvlan.h | 1 -
7 files changed, 59 insertions(+), 29 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 640a4c5..3c950f1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -829,6 +829,13 @@ typedef enum {
VIR_DOMAIN_NET_TYPE_LAST
} virDomainNetType;
+/* check bandwidth configuration for a network interface */
+#define NETDEVIF_SUPPORT_BANDWIDTH(type) \
+ ((type == VIR_DOMAIN_NET_TYPE_ETHERNET || \
+ type == VIR_DOMAIN_NET_TYPE_NETWORK || \
+ type == VIR_DOMAIN_NET_TYPE_BRIDGE || \
+ type == VIR_DOMAIN_NET_TYPE_DIRECT) ? true : false)
+
/* the backend driver used for virtio interfaces */
typedef enum {
VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT, /* prefer kernel, fall back to user */
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index ed30c37..5ef91e8 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -274,11 +274,6 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
if (virNetDevSetOnline(parentVeth, true) < 0)
goto cleanup;
- if (virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net),
- false) < 0)
- goto cleanup;
-
if (net->filter &&
virDomainConfNWFilterInstantiate(conn, vm->uuid, net) < 0)
goto cleanup;
@@ -300,6 +295,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
virNetDevBandwidthPtr bw;
virNetDevVPortProfilePtr prof;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
+ const char *linkdev = virDomainNetGetActualDirectDev(net);
/* XXX how todo bandwidth controls ?
* Since the 'net-ifname' is about to be moved to a different
@@ -329,16 +325,15 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
if (virNetDevMacVLanCreateWithVPortProfile(
net->ifname, &net->mac,
- virDomainNetGetActualDirectDev(net),
+ linkdev,
virDomainNetGetActualDirectMode(net),
false, def->uuid,
- virDomainNetGetActualVirtPortProfile(net),
+ prof,
&res_ifname,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
cfg->stateDir,
- virDomainNetGetActualBandwidth(net), 0) < 0)
+ 0) < 0)
goto cleanup;
-
ret = res_ifname;
cleanup:
@@ -368,6 +363,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
int ret = -1;
size_t i;
size_t niface = 0;
+ int actualType;
for (i = 0; i < def->nnets; i++) {
char *veth = NULL;
@@ -381,7 +377,8 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
if (VIR_EXPAND_N(*veths, *nveths, 1) < 0)
goto cleanup;
- switch (virDomainNetGetActualType(def->nets[i])) {
+ actualType = virDomainNetGetActualType(def->nets[i]);
+ switch (actualType) {
case VIR_DOMAIN_NET_TYPE_NETWORK: {
virNetworkPtr network;
char *brname = NULL;
@@ -444,11 +441,15 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
case VIR_DOMAIN_NET_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported network type %s"),
- virDomainNetTypeToString(
- virDomainNetGetActualType(def->nets[i])
- ));
+ virDomainNetTypeToString(actualType));
goto cleanup;
}
+ /* set network bandwidth */
+ if (NETDEVIF_SUPPORT_BANDWIDTH(actualType) && virNetDevBandwidthSet(
+ def->nets[i]->ifname, virDomainNetGetActualBandwidth(
+ def->nets[i]),
+ false) < 0)
+ goto cleanup;
(*veths)[(*nveths)-1] = veth;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f2e6e5a..404c51b 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -191,7 +191,6 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
virDomainNetGetActualVirtPortProfile(net),
&res_ifname,
vmop, cfg->stateDir,
- virDomainNetGetActualBandwidth(net),
macvlan_create_flags);
if (rc >= 0) {
virDomainAuditNetDevice(def, net, res_ifname, true);
@@ -371,10 +370,6 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
&net->mac) < 0)
goto cleanup;
- if (virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net),
- false) < 0)
- goto cleanup;
if (net->filter &&
virDomainConfNWFilterInstantiate(conn, def->uuid, net) < 0) {
@@ -7313,6 +7308,10 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
if (tapfd[0] < 0)
goto cleanup;
}
+ /* Set bandwidth */
+ if (NETDEVIF_SUPPORT_BANDWIDTH(actualType) && virNetDevBandwidthSet(
+ net->ifname, virDomainNetGetActualBandwidth(net), false) < 0)
+ goto cleanup;
if ((actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5fd89a3..f5a5cbe 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -186,6 +186,9 @@ qemuVMFilterRebuild(virDomainObjListIterator iter, void *data)
return virDomainObjListForEach(qemu_driver->domains, iter, data);
}
+static void
+qemuDomainClearNetBandwidth(virDomainObjPtr vm);
+
static virNWFilterCallbackDriver qemuCallbackDriver = {
.name = QEMU_DRIVER_NAME,
.vmFilterRebuild = qemuVMFilterRebuild,
@@ -2196,6 +2199,9 @@ qemuDomainDestroyFlags(virDomainPtr dom,
if (virDomainDestroyFlagsEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ /* Clear network bandwidth settings */
+ qemuDomainClearNetBandwidth(vm);
+
qemuDomainSetFakeReboot(driver, vm, false);
@@ -17952,6 +17958,21 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
return ret;
}
+/* Clear the bandwidth setting of all the network interfaces of a vm */
+static void
+qemuDomainClearNetBandwidth(virDomainObjPtr vm)
+{
+ size_t i;
+ int actualType;
+
+ for (i = 0; i < vm->def->nnets; i++) {
+ virDomainNetDefPtr net = vm->def->nets[i];
+ actualType = virDomainNetGetActualType(net);
+ if (NETDEVIF_SUPPORT_BANDWIDTH(actualType))
+ virNetDevBandwidthClear(net->ifname);
+ }
+}
+
static virDriver qemuDriver = {
.no = VIR_DRV_QEMU,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7bc19cd..acf48af 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -947,6 +947,10 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd, &vhostfdSize) < 0)
goto cleanup;
}
+ /* Set bandwidth */
+ if (NETDEVIF_SUPPORT_BANDWIDTH(actualType) && virNetDevBandwidthSet(net->ifname,
+ virDomainNetGetActualBandwidth(net), false) < 0)
+ goto cleanup;
for (i = 0; i < tapfdSize; i++) {
if (virSecurityManagerSetTapFDLabel(driver->securityManager,
@@ -3481,6 +3485,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
virDomainNetDefPtr detach = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
int rc;
+ int actualType;
if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net)) < 0)
goto cleanup;
@@ -3517,6 +3522,14 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
}
}
+ actualType = virDomainNetGetActualType(detach);
+ if (NETDEVIF_SUPPORT_BANDWIDTH(actualType) &&
+ (virNetDevBandwidthClear(detach->ifname) < 0)) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("cannot clear bandwidth setting for device : %s"),
+ detach->ifname);
+ goto cleanup;
+ }
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
qemuDomainObjEnterMonitor(driver, vm);
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index c83341c..956a96b 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -811,7 +811,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
char **res_ifname,
virNetDevVPortProfileOp vmOp,
char *stateDir,
- virNetDevBandwidthPtr bandwidth,
unsigned int flags)
{
const char *type = (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ?
@@ -925,14 +924,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
rc = 0;
}
- if (virNetDevBandwidthSet(cr_ifname, bandwidth, false) < 0) {
- if (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP)
- VIR_FORCE_CLOSE(rc); /* sets rc to -1 */
- else
- rc = -1;
- goto disassociate_exit;
- }
-
if (vmOp == VIR_NETDEV_VPORT_PROFILE_OP_CREATE ||
vmOp == VIR_NETDEV_VPORT_PROFILE_OP_RESTORE) {
/* Only directly register upon a create or restore (restarting
@@ -1076,7 +1067,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
char **res_ifname ATTRIBUTE_UNUSED,
virNetDevVPortProfileOp vmop ATTRIBUTE_UNUSED,
char *stateDir ATTRIBUTE_UNUSED,
- virNetDevBandwidthPtr bandwidth ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCheckFlags(0, -1);
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index 41aa4e2..f08d32b 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -68,7 +68,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
char **res_ifname,
virNetDevVPortProfileOp vmop,
char *stateDir,
- virNetDevBandwidthPtr bandwidth,
unsigned int flags)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6)
ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) ATTRIBUTE_RETURN_CHECK;
--
1.9.1
10 years, 1 month
[libvirt] [PATCH 0/2] esx: Add libcurl based stream driver and implement virDomainScreenshot
by Matthias Bolte
I had the code in these two patches bascially sitting around since 2012,
yes 2012! But I never managed to get the code properly split into patches
and touched up good enough to post it here. This was also hindered by the
fact that I had no ESX test system at hand for the last year or so.
Dawid Zamirski posted some patches [1] to implement virDomainScreenshot
for ESX. So I finally managed to set up some ESX test system again this
weekend and get my old code dusted up. His implementation has two
disadvantages, namely storing the screenshot to a temporary file before
feeding it to a stream and the method of creating the screenshot itself
is availalbe since ESX 4.0 only.
My implementation direcly feeds the screenshot data to a stream and
screenshot creation uses a method available since ESX 2.5.
[1] https://www.redhat.com/archives/libvir-list/2014-March/msg01786.html
10 years, 1 month
Re: [libvirt] increase number of libvirt threads by starting tansient guest doamin - is it a bug?
by web2
Hello,
sorry for my later answer.
so, after i started libvirtd (no vm´s running) and attach gdb i get the following threads
(gdb) info thread
Id Target Id Frame
11 Thread 0x7f18fef4e700 (LWP 20695) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7f18fe74d700 (LWP 20696) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7f18fdf4c700 (LWP 20697) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7f18fd74b700 (LWP 20698) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7f18fcf4a700 (LWP 20699) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7f18fc749700 (LWP 20700) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7f18fbf48700 (LWP 20701) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7f18fb747700 (LWP 20702) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7f18faf46700 (LWP 20703) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7f18fa745700 (LWP 20704) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7f190892f840 (LWP 20694) "libvirtd" 0x00007f190677d7cd in poll () at ../sysdeps/unix/syscall-template.S:81
if i restore an persistent domain, i see the following in gdb:
Detaching after fork from child process 20880.
Detaching after fork from child process 20882.
[New Thread 0x7f190893d700 (LWP 20883)]
Detaching after fork from child process 20890.
Detaching after fork from child process 20906.
(gdb) info thread
Id Target Id Frame
12 Thread 0x7f190893d700 (LWP 20883) "libvirtd" 0x00007f1906e6684d in read () at ../sysdeps/unix/syscall-template.S:81
11 Thread 0x7f18fef4e700 (LWP 20695) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7f18fe74d700 (LWP 20696) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7f18fdf4c700 (LWP 20697) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7f18fd74b700 (LWP 20698) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7f18fcf4a700 (LWP 20699) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7f18fc749700 (LWP 20700) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7f18fbf48700 (LWP 20701) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7f18fb747700 (LWP 20702) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7f18faf46700 (LWP 20703) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7f18fa745700 (LWP 20704) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7f190892f840 (LWP 20694) "libvirtd" 0x00007f190677d7cd in poll () at ../sysdeps/unix/syscall-template.S:81
if i now destroy this vm i get the following:
(gdb) info thread
Id Target Id Frame
12 Thread 0x7f190893d700 (LWP 20883) "libvirtd" 0x00007f1906e6684d in read () at ../sysdeps/unix/syscall-template.S:81
11 Thread 0x7f18fef4e700 (LWP 20695) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7f18fe74d700 (LWP 20696) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7f18fdf4c700 (LWP 20697) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7f18fd74b700 (LWP 20698) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7f18fcf4a700 (LWP 20699) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7f18fc749700 (LWP 20700) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7f18fbf48700 (LWP 20701) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7f18fb747700 (LWP 20702) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7f18faf46700 (LWP 20703) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7f18fa745700 (LWP 20704) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7f190892f840 (LWP 20694) "libvirtd" 0x00007f190677d7cd in poll () at ../sysdeps/unix/syscall-template.S:81
attaching thread Id 12 and bt:
(gdb) thread 12
[Switching to thread 12 (Thread 0x7f190893d700 (LWP 20883))]
#0 0x00007f1906e6684d in read () at ../sysdeps/unix/syscall-template.S:81
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
(gdb) bt
#0 0x00007f1906e6684d in read () at ../sysdeps/unix/syscall-template.S:81
#1 0x00007f18f8c415be in read (__nbytes=16, __buf=0x7f18d4000c50, __fd=26) at /usr/include/bits/unistd.h:44
#2 read_all (fd=26, data=data@entry =0x7f18d4000c50, len=len@entry =16, nonblocking=nonblocking@entry =0) at xs.c:374
#3 0x00007f18f8c41675 in read_message (h=h@entry =0x7f18e8001070, nonblocking=nonblocking@entry =0) at xs.c:1139
#4 0x00007f18f8c41e90 in read_thread (arg=0x7f18e8001070) at xs.c:1211
#5 0x00007f1906e5ff35 in start_thread (arg=0x7f190893d700) at pthread_create.c:309
#6 0x00007f1906787c3d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
and then bt full:
(gdb) bt full
#0 0x00007f1906e6684d in read () at ../sysdeps/unix/syscall-template.S:81
No locals.
#1 0x00007f18f8c415be in read (__nbytes=16, __buf=0x7f18d4000c50, __fd=26) at /usr/include/bits/unistd.h:44
No locals.
#2 read_all (fd=26, data=data@entry =0x7f18d4000c50, len=len@entry =16, nonblocking=nonblocking@entry =0) at xs.c:374
done = <optimized out>
#3 0x00007f18f8c41675 in read_message (h=h@entry =0x7f18e8001070, nonblocking=nonblocking@entry =0) at xs.c:1139
__clframe = {__cancel_routine = <optimized out>, __cancel_arg = 0x7f18d4000c40, __do_it = 1, __cancel_type = <optimized out>}
msg = 0x7f18d4000c40
body = 0x0
saved_errno = 0
ret = -1
#4 0x00007f18f8c41e90 in read_thread (arg=0x7f18e8001070) at xs.c:1211
h = 0x7f18e8001070
fd = <optimized out>
#5 0x00007f1906e5ff35 in start_thread (arg=0x7f190893d700) at pthread_create.c:309
__res = <optimized out>
pd = 0x7f190893d700
now = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139745494816512, 9092725460686644452, 1, 0, 139745494817216, 139745494816512, -9214988784542636828, -9214975709026802460}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0},
data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
pagesize_m1 = <optimized out>
sp = <optimized out>
freesize = <optimized out>
#6 0x00007f1906787c3d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.
now the same for a transient domain, also after start of libvirtd (no vm running):
(gdb) info thread
Id Target Id Frame
11 Thread 0x7fe5cf507700 (LWP 21097) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7fe5ced06700 (LWP 21098) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7fe5ce505700 (LWP 21099) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7fe5cdd04700 (LWP 21100) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7fe5cd503700 (LWP 21101) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7fe5ccd02700 (LWP 21102) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7fe5cc501700 (LWP 21103) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7fe5cbd00700 (LWP 21104) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7fe5cb4ff700 (LWP 21105) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7fe5cacfe700 (LWP 21106) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7fe5d8ee8840 (LWP 21096) "libvirtd" 0x00007fe5d6d367cd in poll () at ../sysdeps/unix/syscall-template.S:81
now restore the transient domain from a statefile without define them before:
Continuing.
Detaching after fork from child process 21276.
Detaching after fork from child process 21278.
[New Thread 0x7fe5d8ef6700 (LWP 21279)]
Detaching after fork from child process 21285.
Detaching after fork from child process 21302.
(gdb) info thread
Id Target Id Frame
12 Thread 0x7fe5d8ef6700 (LWP 21279) "libvirtd" 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
11 Thread 0x7fe5cf507700 (LWP 21097) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7fe5ced06700 (LWP 21098) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7fe5ce505700 (LWP 21099) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7fe5cdd04700 (LWP 21100) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7fe5cd503700 (LWP 21101) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7fe5ccd02700 (LWP 21102) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7fe5cc501700 (LWP 21103) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7fe5cbd00700 (LWP 21104) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7fe5cb4ff700 (LWP 21105) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7fe5cacfe700 (LWP 21106) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7fe5d8ee8840 (LWP 21096) "libvirtd" 0x00007fe5d6d367cd in poll () at ../sysdeps/unix/syscall-template.S:81
destroy these vm:
(gdb) info thread
Id Target Id Frame
12 Thread 0x7fe5d8ef6700 (LWP 21279) "libvirtd" 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
11 Thread 0x7fe5cf507700 (LWP 21097) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7fe5ced06700 (LWP 21098) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7fe5ce505700 (LWP 21099) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7fe5cdd04700 (LWP 21100) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7fe5cd503700 (LWP 21101) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7fe5ccd02700 (LWP 21102) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7fe5cc501700 (LWP 21103) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7fe5cbd00700 (LWP 21104) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7fe5cb4ff700 (LWP 21105) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7fe5cacfe700 (LWP 21106) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7fe5d8ee8840 (LWP 21096) "libvirtd" 0x00007fe5d6d367cd in poll () at ../sysdeps/unix/syscall-template.S:81
and again restore vm:
Continuing.
Detaching after fork from child process 21347.
Detaching after fork from child process 21349.
[New Thread 0x7fe5d8dff700 (LWP 21350)]
Detaching after fork from child process 21353.
Detaching after fork from child process 21373.
(gdb) info thread
Id Target Id Frame
13 Thread 0x7fe5d8dff700 (LWP 21350) "libvirtd" 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
12 Thread 0x7fe5d8ef6700 (LWP 21279) "libvirtd" 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
11 Thread 0x7fe5cf507700 (LWP 21097) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7fe5ced06700 (LWP 21098) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7fe5ce505700 (LWP 21099) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7fe5cdd04700 (LWP 21100) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7fe5cd503700 (LWP 21101) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7fe5ccd02700 (LWP 21102) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7fe5cc501700 (LWP 21103) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7fe5cbd00700 (LWP 21104) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7fe5cb4ff700 (LWP 21105) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7fe5cacfe700 (LWP 21106) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7fe5d8ee8840 (LWP 21096) "libvirtd" 0x00007fe5d6d367cd in poll () at ../sysdeps/unix/syscall-template.S:81
and again, destroy vm:
(gdb) info thread
Id Target Id Frame
13 Thread 0x7fe5d8dff700 (LWP 21350) "libvirtd" 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
12 Thread 0x7fe5d8ef6700 (LWP 21279) "libvirtd" 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
11 Thread 0x7fe5cf507700 (LWP 21097) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
10 Thread 0x7fe5ced06700 (LWP 21098) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
9 Thread 0x7fe5ce505700 (LWP 21099) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
8 Thread 0x7fe5cdd04700 (LWP 21100) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
7 Thread 0x7fe5cd503700 (LWP 21101) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
6 Thread 0x7fe5ccd02700 (LWP 21102) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7fe5cc501700 (LWP 21103) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7fe5cbd00700 (LWP 21104) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7fe5cb4ff700 (LWP 21105) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7fe5cacfe700 (LWP 21106) "libvirtd" pthread_cond_wait@(a)GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7fe5d8ee8840 (LWP 21096) "libvirtd" 0x00007fe5d6d367cd in poll () at ../sysdeps/unix/syscall-template.S:81
attach thread 13 and bt full:
(gdb) thread 13
[Switching to thread 13 (Thread 0x7fe5d8dff700 (LWP 21350))]
#0 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
(gdb) bt full
#0 0x00007fe5d741f84d in read () at ../sysdeps/unix/syscall-template.S:81
No locals.
#1 0x00007fe5c91fa5be in read (__nbytes=16, __buf=0x7fe5a4000be0, __fd=37) at /usr/include/bits/unistd.h:44
No locals.
#2 read_all (fd=37, data=data@entry =0x7fe5a4000be0, len=len@entry =16, nonblocking=nonblocking@entry =0) at xs.c:374
done = <optimized out>
#3 0x00007fe5c91fa675 in read_message (h=h@entry =0x7fe5b80019b0, nonblocking=nonblocking@entry =0) at xs.c:1139
__clframe = {__cancel_routine = <optimized out>, __cancel_arg = 0x7fe5a4000bd0, __do_it = 1, __cancel_type = <optimized out>}
msg = 0x7fe5a4000bd0
body = 0x0
saved_errno = 0
ret = -1
#4 0x00007fe5c91fae90 in read_thread (arg=0x7fe5b80019b0) at xs.c:1211
h = 0x7fe5b80019b0
fd = <optimized out>
#5 0x00007fe5d7418f35 in start_thread (arg=0x7fe5d8dff700) at pthread_create.c:309
__res = <optimized out>
pd = 0x7fe5d8dff700
now = <optimized out>
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140625162794752, 9202584519348287509, 1, 0, 140625162795456, 140625162794752, -9188024510920296427, -9188034420488439787}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0},
data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
pagesize_m1 = <optimized out>
sp = <optimized out>
freesize = <optimized out>
#6 0x00007fe5d6d40c3d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.
i seen nothing that give me a hint while the new threads a still open.
all the best max
----------------ursprüngliche Nachricht-----------------
Von: "Michal Privoznik" mprivozn(a)redhat.com
An: ustermann78(a)web.de, libvirt-users(a)redhat.com
Datum: Fri, 26 Sep 2014 15:22:01 +0200
-------------------------------------------------
> [Disabling cross-post]
>
> On 26.09.2014 12:21, ustermann78(a)web.de wrote:
>> Hi Michal,
>> thank you for your answer.
>> so if i understand that correctly, no matter if i shutdown or destroy the
>> domain and no matter if it is a transient or an persistent vm, the thread should
>> disappear, right?
>>
>> in my case they still exist, also an hour after i destroy the domain (and don´t
>> start any new one).
>>
>> i use libvirt-1.1.35 on fedora core 20, for information.
>
> Well, can you attach gdb and see what is the new thread doing?
>
> Michal
>
--
10 years, 1 month
[libvirt] [RFC PATCH] include: make it easier to probe enum growth
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=1147639 is an example
of a downstream distro's dilemma - when backporting a feature that
is implemented in an ABI-compatible manner (no .so bump was
required) but where the feature involves new bits to be defined
in a flags variable, how does one write code to reliably detect
that those bits have been backported?
The solution presented here is a common idiom used in a number of
other header files (for example, glibc's /usr/include/langinfo.h
does it for ABDAY_1 and friends); by adding a self-referential
preprocessor macro, client code can easily do:
| switch (state) {
| #ifdef VIR_DOMAIN_PMSUSPENDED
| case VIR_DOMAIN_PMSUSPENDED:
| ....
| #endif
| }
rather than trying to figure out which version number introduced
VIR_DOMAIN_PMSUSPENDED (v.9.11), and using that with
LIBVIR_CHECK_VERSION. Of course, since 1.2.10 would be the first
release where this practice is reliable, we will still see clients
that target earlier libvirt doing:
| switch (state) {
| #if LIBVIR_CHECK_VERSION(0, 9, 11) || defined(VIR_DOMAIN_PMSUSPENDED)
| case VIR_DOMAIN_PMSUSPENDED:
| ....
| #endif
| }
but that is still more maintainable.
* include/libvirt/libvirt.h.in (virDomainState): Expose #defines
matching each enum value.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
This patch is an RFC because I want confirmation that it is worth
doing. Obviously, if it is desirable, there will be a LOT more
addition of #define throughout the file, but as that is mostly
busy-work, I want to get the idea approved first.
include/libvirt/libvirt.h.in | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index c910b31..0baea53 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -116,13 +116,28 @@ typedef virDomain *virDomainPtr;
* A domain may be in different states at a given point in time
*/
typedef enum {
+#define VIR_DOMAIN_NOSTATE VIR_DOMAIN_NOSTATE
VIR_DOMAIN_NOSTATE = 0, /* no state */
+
+#define VIR_DOMAIN_RUNNING VIR_DOMAIN_RUNNING
VIR_DOMAIN_RUNNING = 1, /* the domain is running */
+
+#define VIR_DOMAIN_BLOCKED VIR_DOMAIN_BLOCKED
VIR_DOMAIN_BLOCKED = 2, /* the domain is blocked on resource */
+
+#define VIR_DOMAIN_PAUSED VIR_DOMAIN_PAUSED
VIR_DOMAIN_PAUSED = 3, /* the domain is paused by user */
+
+#define VIR_DOMAIN_SHUTDOWN VIR_DOMAIN_SHUTDOWN
VIR_DOMAIN_SHUTDOWN= 4, /* the domain is being shut down */
+
+#define VIR_DOMAIN_SHUTOFF VIR_DOMAIN_SHUTOFF
VIR_DOMAIN_SHUTOFF = 5, /* the domain is shut off */
+
+#define VIR_DOMAIN_CRASHED VIR_DOMAIN_CRASHED
VIR_DOMAIN_CRASHED = 6, /* the domain is crashed */
+
+#define VIR_DOMAIN_PMSUSPENDED VIR_DOMAIN_PMSUSPENDED
VIR_DOMAIN_PMSUSPENDED = 7, /* the domain is suspended by guest
power management */
--
1.9.3
10 years, 1 month
[libvirt] [PATCH] Fix build-time pkg-config files in VPATH
by Jiri Denemark
The pkg-config files in src/ make it pretty easy to build language
bindings against an uninstalled libvirt, however, they don't work with
VPATH builds. The reason is that all *-api.xml files are generated in
source rather than build directory.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/libvirt-lxc.pc.in | 2 +-
src/libvirt-qemu.pc.in | 2 +-
src/libvirt.pc.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libvirt-lxc.pc.in b/src/libvirt-lxc.pc.in
index 88e431b..dd04950 100644
--- a/src/libvirt-lxc.pc.in
+++ b/src/libvirt-lxc.pc.in
@@ -6,7 +6,7 @@ prefix=@abs_top_builddir@
exec_prefix=@abs_top_builddir@
libdir=@abs_top_builddir(a)/src/.libs
includedir=@abs_top_builddir@/include
-datarootdir=@abs_top_builddir@
+datarootdir=@abs_top_srcdir@
libvirt_lxc_api=@datadir(a)/docs/libvirt-lxc-api.xml
diff --git a/src/libvirt-qemu.pc.in b/src/libvirt-qemu.pc.in
index ed1f68a..5483da9 100644
--- a/src/libvirt-qemu.pc.in
+++ b/src/libvirt-qemu.pc.in
@@ -6,7 +6,7 @@ prefix=@abs_top_builddir@
exec_prefix=@abs_top_builddir@
libdir=@abs_top_builddir(a)/src/.libs
includedir=@abs_top_builddir@/include
-datarootdir=@abs_top_builddir@
+datarootdir=@abs_top_srcdir@
libvirt_qemu_api=@datadir(a)/docs/libvirt-qemu-api.xml
diff --git a/src/libvirt.pc.in b/src/libvirt.pc.in
index c2bdbb2..548fa77 100644
--- a/src/libvirt.pc.in
+++ b/src/libvirt.pc.in
@@ -6,7 +6,7 @@ prefix=@abs_top_builddir@
exec_prefix=@abs_top_builddir@
libdir=@abs_top_builddir(a)/src/.libs
includedir=@abs_top_builddir@/include
-datarootdir=@abs_top_builddir@
+datarootdir=@abs_top_srcdir@
libvirt_api=@datadir(a)/docs/libvirt-api.xml
--
2.1.2
10 years, 1 month
[libvirt] [libvirt-python PATCH] setup.py: fix rpm build to return 1 on error
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
setup.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/setup.py b/setup.py
index 0c34ae1..c6a9ce3 100755
--- a/setup.py
+++ b/setup.py
@@ -245,8 +245,8 @@ class my_rpm(Command):
"""
self.run_command('sdist')
- os.system('rpmbuild -ta --clean dist/libvirt-python-%s.tar.gz' %
- self.distribution.get_version())
+ self.spawn(["/usr/bin/rpmbuild", "-ta", "--clean",
+ "dist/libvirt-python-%s.tar.gz" % self.distribution.get_version()])
class my_test(Command):
user_options = [
--
2.0.4
10 years, 1 month
[libvirt] [libvirt-python PATCH] sanitytest: define long for python version >= 3
by Martin Kletzander
Commit c58c7f362aab37e4961407c2efc8a74925ed9c37 fixed 32-bit python
build but broke build with python3 due to the lack of 'long' in the
newer version of python. This patch aims to fix it with a simple
string comparison of sys.version and '3'.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
sanitytest.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sanitytest.py b/sanitytest.py
index 5bd85a5..b161696 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -9,6 +9,9 @@ import string
sys.path.insert(0, sys.argv[1])
import libvirt
+if sys.version > '3':
+ long = int
+
# Path to the libvirt API XML file
xml = sys.argv[2]
--
2.1.2
10 years, 1 month
[libvirt] [libvirt-python PATCH] sanitytest: count with the fact that large enums can be long
by Martin Kletzander
On 32-bit systems, one new flag that has the value of 1 << 31, namely
VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, fails to fit into an
'int' on python and is therefore of type 'long'. Fix sanitytest to
count with such fact in order to avoid build failures on 32-bit systems.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
Pushed as a build-breaker.
sanitytest.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sanitytest.py b/sanitytest.py
index 8cb0154..5bd85a5 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -84,7 +84,7 @@ for name in dir(libvirt):
thing = getattr(libvirt, name)
# Special-case libvirtError to deal with python 2.4 difference
# in Exception class type reporting.
- if type(thing) == int:
+ if type(thing) in (int, long):
gotenums.append(name)
elif type(thing) == type or name == "libvirtError":
gottypes.append(name)
--
2.1.2
10 years, 1 month