[libvirt] [PATCH] AUTHORS: add myself to commiters list
by Erik Skultety
---
AUTHORS.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/AUTHORS.in b/AUTHORS.in
index 329924f..6673b3f 100644
--- a/AUTHORS.in
+++ b/AUTHORS.in
@@ -16,6 +16,7 @@ Daniel Berrange <berrange(a)redhat.com>
Daniel Veillard <veillard(a)redhat.com>
Doug Goldstein <cardoe(a)gentoo.org>
Eric Blake <eblake(a)redhat.com>
+Erik Skultety <eskultet(a)redhat.com>
Gao Feng <gaofeng(a)cn.fujitsu.com>
Guido G��nther <agx(a)sigxcpu.org>
J��n Tomko <jtomko(a)redhat.com>
--
1.9.3
9 years, 8 months
[libvirt] [libvirt-perl PATCHv2 0/2] Add virDomainGetIOThreads and virDomainPinIOThread bindings
by John Ferlan
v1:
http://www.redhat.com/archives/libvir-list/2015-March/msg00352.html
Since I essentially copied the vcpuinfo.pl example to create the
iothreadsinfo.pl example, I figured I'd resend the patches again
with the changes that ended up working which are slightly different
than the review comment. The major difference being I needed to limit
the unpack bits format. Instead of "b*", I found "b$nodeinfo->{cpus}"
would print the just the cpu count bits.
Made the same change to the vcpuinfo.pl example. I didn't modify the
Virt.xs Safefree(info) check although it seems it would be possible
if desired.
John Ferlan (2):
Add virDomainGetIOThreads and virDomainPinIOThread bindings
Update the vcpuinfo.pl example
Changes | 3 ++-
Virt.xs | 42 ++++++++++++++++++++++++++++++++++++++++++
examples/iothreadsinfo.pl | 33 +++++++++++++++++++++++++++++++++
examples/vcpuinfo.pl | 6 ++----
lib/Sys/Virt/Domain.pm | 17 +++++++++++++++++
5 files changed, 96 insertions(+), 5 deletions(-)
create mode 100644 examples/iothreadsinfo.pl
--
2.1.0
9 years, 8 months
[libvirt] [PATCH] qemu: Check for negative port values in network drive configuration
by Erik Skultety
We interpret port values as signed int (convert them from char *),
so if a negative value is provided in network disk's configuration,
we accept it as valid, however there's an 'unknown cause' error raised later.
This error is only accidental because we return the port value in the return code.
This patch adds just a minor tweak to the already existing check so we
reject negative values the same way as we reject non-numerical strings.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1163553
---
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 743d6f0..c1e9559 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2954,7 +2954,7 @@ qemuNetworkDriveGetPort(int protocol,
int ret = 0;
if (port) {
- if (virStrToLong_i(port, NULL, 10, &ret) < 0) {
+ if (virStrToLong_i(port, NULL, 10, &ret) < 0 || ret < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to parse port number '%s'"),
port);
--
1.9.3
9 years, 8 months
[libvirt] [PATCH] conf: fix use the wrong type for period
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1140958
When we set period as unsigned int max value 4294967295 and
start the vm, qemu will report error. This becuase we define period
as a unsigned int and parse it as a unsigned int, but we use it as
a int when set it via QMP in qemuMonitorJSONSetMemoryStatsPeriod,
so 4294967295 turn to -1 when we send the QMP command.
After check the qemu's code this value type should be int, and found
a qemu commit 1f9296b for this values range.
Seems no other hypervisor vm use this so i add a check when we parse it.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 127fc91..54bd5aa 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10452,7 +10452,8 @@ virDomainMemballoonDefParseXML(xmlNodePtr node,
}
ctxt->node = node;
- if (virXPathUInt("string(./stats/@period)", ctxt, &def->period) < -1) {
+ if (virXPathInt("string(./stats/@period)", ctxt, &def->period) < -1 ||
+ def->period < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid statistics collection period"));
goto error;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index ea463cb..ee0f5fd 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1556,7 +1556,7 @@ enum {
struct _virDomainMemballoonDef {
int model;
virDomainDeviceInfo info;
- unsigned int period; /* seconds between collections */
+ int period; /* seconds between collections */
};
struct _virDomainNVRAMDef {
--
1.8.3.1
9 years, 8 months
[libvirt] [PATCH] virsh: fix report of non-active commit completion
by Eric Blake
Commit f182da20 (v1.2.6) caused a slight regression in virsh
reporting of a non-active block job; where it used to state
"Commit complete", it now states "Now in synchronized phase".
But the synchronized phase is only possible for an active commit.
For a reproducer, I created a chain 'a <- b <- c <- d <- e' and
ran virsh blockcommit $dom vda --top c --base a --verbose --wait
* tools/virsh-domain.c (cmdBlockCommit): Synchronized phase is
only possible on active commits.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
tools/virsh-domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 1a364bb..b4e9cb0 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2018,7 +2018,7 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd)
vshPrint(ctl, "\n%s", _("Commit aborted"));
else if (pivot)
vshPrint(ctl, "\n%s", _("Successfully pivoted"));
- else if (!finish)
+ else if (!finish && active)
vshPrint(ctl, "\n%s", _("Now in synchronized phase"));
else
vshPrint(ctl, "\n%s", _("Commit complete"));
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v3] util: don't fail if no PortData is found while getting migrateData
by zhang bo
Introduced by f6a2f97e
Problem Description:
After multiple times of migrating a domain, which has an ovs interface with no portData set,
with non-shared disk, nbd ports got overflowed.
The steps to reproduce the problem:
1 define and start a domain with its network configured as:
<interface type='bridge'>
<source bridge='br0'/>
<virtualport type='openvswitch'>
</virtualport>
<model type='virtio'/>
<driver name='vhost' queues='4'/>
</interface>
2 do not set the network's portData.
3 migrate(ToURI2) it with flag 91(1011011), which means:
VIR_MIGRATE_LIVE
VIR_MIGRATE_PEER2PEER
VIR_MIGRATE_PERSIST_DEST
VIR_MIGRATE_UNDEFINE_SOURCE
VIR_MIGRATE_NON_SHARED_DISK
4 migrate success, but we got an error log in libvirtd.log:
error : virCommandWait:2423 : internal error: Child process (ovs-vsctl --timeout=5 get Interface
vnet1 external_ids:PortData) unexpected exit status 1: ovs-vsctl: no key "PortData" in Interface
record "vnet1" column external_ids
5 migrate it back, migrate it , migrate it back, .......
6 nbd port got overflowed.
The reasons for the problem is :
1 virNetDevOpenvswitchGetMigrateData() takes it as wrong if no portData is available for the ovs
interface of a domain. (We think it's not appropriate, as portData is just OPTIONAL)
2 in func qemuMigrationBakeCookie(), it fails in qemuMigrationCookieAddNetwork(), and returns with -1.
qemuMigrationCookieAddNBD() is not called thereafter, and mig->nbd is still NULL.
3 However, qemuMigrationRun() just *WARN* if qemuMigrationBakeCookie() fails, migration still successes.
cookie is NULL, it's not baked on the src side.
4 On the destination side, it would alloc a port first and then free the nbd port in COOKIE.
But the cookie is NULL due to qemuMigrationCookieAddNetwork() failure at src side. thus the nbd port
is not freed.
In this patch, we add "--if-exists" option to make ovs-vsctl not raise error if there's no portData available.
Further more, because portData may be NULL in the cookie at the dest side, check it before setting portData.
Signed-off-by: Zhou Yimin <zhouyimin(a)huawei.com>
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
---
V1 here:
https://www.redhat.com/archives/libvir-list/2015-February/msg00388.html
V2:
Add "--if-exists" option to ovs-vsctl cmd, making ovs-vsctl not raise error if there's no portData
available. Suggested by Martin.
We Tested the patch, it works.
link: https://www.redhat.com/archives/libvir-list/2015-March/msg00104.html
V3:
move V1/V2/V3 description from above the patch to here. It did not show the detailed description above
after apply PATCH v2.
---
src/util/virnetdevopenvswitch.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index e5c87bb..722d0dd 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -30,9 +30,12 @@
#include "virerror.h"
#include "virmacaddr.h"
#include "virstring.h"
+#include "virlog.h"
#define VIR_FROM_THIS VIR_FROM_NONE
+VIR_LOG_INIT("util.netdevopenvswitch");
+
/**
* virNetDevOpenvswitchAddPort:
* @brname: the bridge name
@@ -206,7 +209,7 @@ int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
virCommandPtr cmd = NULL;
int ret = -1;
- cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "get", "Interface",
+ cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "--if-exists", "get", "Interface",
ifname, "external_ids:PortData", NULL);
virCommandSetOutputBuffer(cmd, migrate);
@@ -241,6 +244,12 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname)
virCommandPtr cmd = NULL;
int ret = -1;
+ if (!migrate) {
+ VIR_DEBUG("No OVS port data for interface %s", ifname);
+ return 0;
+ }
+
cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "set",
"Interface", ifname, NULL);
virCommandAddArgFormat(cmd, "external_ids:PortData=%s", migrate);
--
1.7.12.4
9 years, 8 months
[libvirt] [PATCH] network: avoid memory leak of dnsmasq capabilities
by Eric Blake
Valgrind detected a leak:
==17820== 102 (56 direct, 46 indirect) bytes in 1 blocks are definitely lost in loss record 479 of 646
==17820== at 0x4A08946: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17820== by 0x508521A: virAllocVar (viralloc.c:560)
==17820== by 0x50D9FCA: virObjectNew (virobject.c:193)
==17820== by 0x50A4FD9: dnsmasqCapsNewEmpty (virdnsmasq.c:784)
==17820== by 0x50A514E: dnsmasqCapsNewFromBinary (virdnsmasq.c:830)
==17820== by 0x1B508287: networkStateInitialize (bridge_driver.c:666)
It looks like commit 172acef introduced the problem, because
networkGetDnsmasqCaps() increments the reference count but an
early exit never does a matching decrement.
* src/network/bridge_driver.c (networkStateCleanup): Plug leak.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/network/bridge_driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 13e1717..a007388 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -391,8 +391,8 @@ networkUpdateState(virNetworkObjPtr obj,
virObjectLock(obj);
if (!virNetworkObjIsActive(obj)) {
- virObjectUnlock(obj);
- return 0;
+ ret = 0;
+ goto cleanup;
}
switch (obj->def->forward.type) {
--
2.1.0
9 years, 8 months
[libvirt] [PATCH] netdev: silence valgrind warning about ioctl use
by Eric Blake
Valgrind complained:
==3770== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
==3770== at 0x919D407: ioctl (syscall-template.S:81)
==3770== by 0x530FE7E: rpl_ioctl (ioctl.c:42)
==3770== by 0x50CB433: virNetDevFeatureAvailable (virnetdev.c:2764)
==3770== by 0x50CB6A7: virNetDevGetFeatures (virnetdev.c:2830)
==3770== by 0x1F0E5347: udevProcessNetworkInterface (node_device_udev.c:722)
==3770== by 0x1F0E689F: udevGetDeviceDetails (node_device_udev.c:1300)
==3770== by 0x1F0E6E06: udevAddOneDevice (node_device_udev.c:1422)
==3770== by 0x1F0E6FB8: udevProcessDeviceListEntry (node_device_udev.c:1464)
==3770== by 0x1F0E70CF: udevEnumerateDevices (node_device_udev.c:1494)
==3770== by 0x1F0E7BB4: nodeStateInitialize (node_device_udev.c:1806)
==3770== by 0x51B4303: virStateInitialize (libvirt.c:777)
==3770== by 0x11DEE7: daemonRunStateInit (libvirtd.c:906)
==3770== Address 0x228e38d4 is on thread 12's stack
==3770== in frame #2, created by virNetDevFeatureAvailable (virnetdev.c:2750)
* src/util/virnetdev.c (virNetDevFeatureAvailable): Initialize all
bytes of ifr.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
src/util/virnetdev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 093c99c..54d866e 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2758,6 +2758,7 @@ virNetDevFeatureAvailable(const char *ifname, struct ethtool_value *cmd)
goto cleanup;
}
+ memset(&ifr, 0, sizeof(ifr));
strcpy(ifr.ifr_name, ifname);
ifr.ifr_data = (void*) cmd;
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v4 0/7] Drop network driver lock
by Michal Privoznik
Hopefully, the last version. Again, some patches are ACKed
already, but I'm sending them again. Not to trash the review
bandwidth, but for reviewer to get better picture.
Michal Privoznik (7):
bridge_driver: Don't access global driver randomly
network_driver: Use accessor for dnsmasqCaps
struct _virNetworkDriverState: Annotate items
bridge_driver: Drop networkDriverLock() from almost everywhere
test_driver: Drop testDriverLock() from almost everywhere
parallels_network: Drop parallelsDriverLock() from everywhere.
bridge_driver: Use more of networkObjFromNetwork
src/network/bridge_driver.c | 467 ++++++++++++++++++-----------------
src/network/bridge_driver_platform.h | 7 +
src/parallels/parallels_network.c | 33 +--
src/test/test_driver.c | 56 +----
4 files changed, 255 insertions(+), 308 deletions(-)
--
2.0.5
9 years, 8 months