[libvirt] [PATCH] qemu: forbid large value wraparound in balloon period collection
by Erik Skultety
We do parse and represent period collection as unsigned int in our
internal structures, however commit
d5c67e7f4523450023b89b69c16472582c85eeaf converts this to int, thus wrapping
around inputs greater than INT_MAX which results in an error from QEMU.
This patch adds a check into QEMU driver, because period attribute is
only supported by QEMU.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1140958
---
src/qemu/qemu_driver.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index bec05d4..46bd880 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2414,6 +2414,12 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
/* Set the balloon driver collection interval */
priv = vm->privateData;
+ if (period < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("invalid value for collection period"));
+ goto endjob;
+ }
+
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
qemuDomainObjEnterMonitor(driver, vm);
--
1.9.3
10 years, 1 month
[libvirt] [PATCH] docs: add a note that spice channel is ignoret without spice graphics
by Pavel Hrdina
To prevent a confusion about missing chardev argument in qemu
command line add a note about that behavior into documentation.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
docs/formatdomain.html.in | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index fb0a0d1..cd179a6 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -5372,6 +5372,10 @@ qemu-kvm -net nic,model=? /dev/null
under a channel name specified in the <code>channel</code>
attribute. <span class="since">Since 1.2.2</span>
</p>
+ <p>
+ NOTE: if spice graphics is not defined the spice channel will
+ be ignored.
+ </p>
<pre>
...
--
2.0.5
10 years, 1 month
[libvirt] Adding timestamps for all emulator output
by Andrey Korolyov
Hello,
I think it would be useful if libvirt will be able to prefix all
messages from emulator pipes with the date stamping, for example I am
trying to catch very rare and non-fatal race with
virtio-serial-bus: Guest failure in adding device virtio-serial0.0
which is specific to the Windows guests on qemu-kvm. I have supporting
infrastructure which can tell me exact times for every action upon
this VM, but as bug is not frequent, the continuous monitoring looks
like an overkill for a desired goal - find a correlation between
emulator event and message from stderr. Patching emulator itself is
barely an option, as it is ugly, requires refresh of the running code
via loopback migration and completely non-universal, as every
hypervisor should be modified seperately.
I`d highly appreciate positive consideration for such functionality
addition or can write a patch shortly, if needed. Thanks!
10 years, 1 month
[libvirt] [PATCH 0/2] For 1.2.13 - Fix crash with gluster URIs
by Peter Krempa
Peter Krempa (2):
util: storagefile: Don't crash on gluster URIs without path
util: storage: Fix error type in virStorageSourceParseBackingURI
src/util/virstoragefile.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.2.2
10 years, 1 month
[libvirt] [PATCHv2 00/10] Add support for memory hotplug
by Peter Krempa
Version 2 fixes review comments and rebases to the current state. This series
applies on top of:
[PATCHv2 0/7] Automaticaly fill <memory> element for NUMA enabled guests
For convenience you can fetch the changes at:
git fetch git://pipo.sk/pipo/libvirt.git memory-hotplug-2
Peter Krempa (10):
conf: Add support for parsing and formatting max memory and slot count
qemu: Implement setup of memory hotplug parameters
conf: Add device address type for dimm devices
conf: Add interface to parse and format memory device information
qemu: memdev: Add infrastructure to load memory device information
qemu: migration: Forbid migration with memory modules lacking info
qemu: add support for memory devices
qemu: conf: Add support for memory device cold(un)plug
qemu: Implement memory device hotplug
qemu: Implement memory device hotunplug
docs/formatdomain.html.in | 98 ++++
docs/schemas/domaincommon.rng | 76 +++
src/bhyve/bhyve_domain.c | 9 +-
src/conf/domain_conf.c | 564 ++++++++++++++++++++-
src/conf/domain_conf.h | 59 +++
src/libvirt_private.syms | 7 +
src/libxl/libxl_domain.c | 8 +
src/lxc/lxc_domain.c | 8 +
src/openvz/openvz_driver.c | 14 +-
src/parallels/parallels_driver.c | 6 +-
src/phyp/phyp_driver.c | 6 +-
src/qemu/qemu_command.c | 166 +++++-
src/qemu/qemu_command.h | 15 +
src/qemu/qemu_domain.c | 80 +++
src/qemu/qemu_domain.h | 5 +
src/qemu/qemu_driver.c | 29 ++
src/qemu/qemu_hotplug.c | 177 +++++++
src/qemu/qemu_hotplug.h | 6 +
src/qemu/qemu_migration.c | 14 +
src/qemu/qemu_monitor.c | 42 ++
src/qemu/qemu_monitor.h | 14 +
src/qemu/qemu_monitor_json.c | 122 +++++
src/qemu/qemu_monitor_json.h | 5 +
src/qemu/qemu_process.c | 4 +
src/uml/uml_driver.c | 9 +-
src/vbox/vbox_common.c | 6 +-
src/vmware/vmware_driver.c | 6 +-
src/vmx/vmx.c | 6 +-
src/xen/xen_driver.c | 7 +
src/xenapi/xenapi_driver.c | 9 +-
tests/domainschemadata/maxMemory.xml | 19 +
.../qemuxml2argv-memory-hotplug-dimm.args | 11 +
.../qemuxml2argv-memory-hotplug-dimm.xml | 50 ++
.../qemuxml2argv-memory-hotplug-nonuma.xml | 22 +
.../qemuxml2argv-memory-hotplug.args | 6 +
.../qemuxml2argv-memory-hotplug.xml | 34 ++
tests/qemuxml2argvtest.c | 6 +
tests/qemuxml2xmltest.c | 4 +
38 files changed, 1706 insertions(+), 23 deletions(-)
create mode 100644 tests/domainschemadata/maxMemory.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nonuma.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug.xml
--
2.2.2
10 years, 1 month
[libvirt] [PATCH] util: do not take it as wrong if no PortData is found while getting migrateData
by Zhang Bo
The function virNetDevOpenvswitchGetMigrateData() uses the cmd ovs-vsctl to
get portdata. If no portdata is available, rather than failure in running
the cmd, we think we should just print a warning message here, rather than
taking it as wrong, because PortData is just optional for an ovs interface.
If we take it as wrong anyway, in function qemuMigrationBakeCookie() it will
terminate in the middle, and cookies such as NBD would not be baked, further
more errors would happen, such as nbd ports get overflowed, etc.
Thus, we add an if branch in virNetDevOpenvswitchGetMigrateData() to just warn
if portdata is unavailable.
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
Signed-off-by: Zhou Yimin <zhouyimin(a)huawei.com>
---
src/util/virnetdevopenvswitch.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index e5c87bb..6116377 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
@@ -204,18 +207,29 @@ int virNetDevOpenvswitchRemovePort(const char *brname ATTRIBUTE_UNUSED, const ch
int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
{
virCommandPtr cmd = NULL;
+ char *errbuf = NULL;
int ret = -1;
cmd = virCommandNewArgList(OVSVSCTL, "--timeout=5", "get", "Interface",
ifname, "external_ids:PortData", NULL);
virCommandSetOutputBuffer(cmd, migrate);
+ virCommandSetErrorBuffer(cmd, &errbuf);
/* Run the command */
- if (virCommandRun(cmd, NULL) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to run command to get OVS port data for "
- "interface %s"), ifname);
+ ret = virCommandRun(cmd, NULL);
+ if (ret < 0) {
+ /*PortData is optional, thus do not take it as wrong if the PortData is not found.*/
+ if (strstr(errbuf, "no key \"PortData\" in Interface record")) {
+ VIR_WARN("Can't find OVS port data for interface %s", ifname);
+ if (*migrate)
+ VIR_FREE(*migrate);
+ ret = 0;
+ } else {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to run command to get OVS port data for "
+ "interface %s"), ifname);
+ }
goto cleanup;
}
@@ -223,6 +237,7 @@ int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname)
(*migrate)[strlen(*migrate) - 1] = '\0';
ret = 0;
cleanup:
+ VIR_FREE(errbuf);
virCommandFree(cmd);
return ret;
}
@@ -241,6 +256,11 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, const char *ifname)
virCommandPtr cmd = NULL;
int ret = -1;
+ if (NULL == migrate) {
+ VIR_INFO("There is no need to set 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
10 years, 1 month
[libvirt] [PATCH] conf: error out on missing dhcp host attributes
by Ján Tomko
In virNetworkDHCPHostDefParseXML an error is reported
when partialOkay == true, and none of ip, mac, name
were supplied.
Add the missing goto and error out in this case.
---
src/conf/network_conf.c | 1 +
1 file changed, 1 insertion(+)
Pushed as trivial.
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 52fcf3d..0f4fc1e 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -746,6 +746,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName,
"must be specified for static host definition "
"in network '%s' "),
networkName);
+ goto cleanup;
}
} else {
/* normal usage - you need at least name (IPv6) or one of MAC
--
2.0.5
10 years, 1 month
[libvirt] [PATCH] conf: fix not jump to cleanup when parse a host id is invalid
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1196503
We already check whether the host id is valid or not, add a jump
to forbid invalid host id.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/conf/network_conf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 3d8bf05..52fcf3d 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -717,6 +717,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName,
virReportError(VIR_ERR_XML_ERROR,
_("Invalid character '%c' in id '%s' of network '%s'"),
*cp, id, networkName);
+ goto cleanup;
}
}
--
1.8.3.1
10 years, 1 month
[libvirt] [PATCH 0/2] check for null ifname when setting/clearing bandwidth
by Laine Stump
When John Ferlan ran the Coverity static checker on my patches to fix
the problem with nicindexes, it began complaining about calling the
virNetDevBandwidth* functions with a null ifname. Investigation
pointed out some real problems with this that are fixed by these two
patches (which will be pushed *before* the nicindex fix patch).
Laine Stump (2):
network: only clear bandwidth if it has been set
util: check for null ifname inside virNetDevBandwidthSet()
src/conf/netdev_bandwidth_conf.c | 6 ++++--
src/lxc/lxc_driver.c | 7 ++++++-
src/network/bridge_driver.c | 6 ++++--
src/qemu/qemu_hotplug.c | 4 +++-
src/util/virnetdevbandwidth.c | 9 ++++++++-
src/util/virnetdevbandwidth.h | 4 ++--
6 files changed, 27 insertions(+), 9 deletions(-)
--
2.1.0
10 years, 1 month
[libvirt] Entering freeze for libvirt-1.2.13
by Daniel Veillard
As suggested yesterday, and hearing no opposition, I have just tagged
Redlease Candidate 1 for libvirt-1.2.13 in git and signed tarballs and
rpms for it available at the usual place:
ftp://libvirt.org/libvirt/
Based on my own but minimal testing this seems to work, but obviously
please give it a try so we can squash bugs and portability issues in
time.
A candidate release 2 on Thursday and a final 1.2.13 release next
Monday is the schedule assumeing no major issue is found,
so please give it a test !
Thanks,
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
10 years, 1 month