[libvirt] [PATCH] [RFC] xen domctl version 6
by Jim Fehlig
xen-unstable c/s 20685 changed the domctl interface, adding a field to
xen_domctl_getdomaininfo structure. This additional field causes stack
corruption in libvirt. xen-unstable c/s 20711 rightly bumped the domctl
interface version so it is at least possible to handle the new field.
The attached patch accounts for shr_pages field added to
xen_domctl_getdomaininfo structure. I'm not thrilled about the changes
to all the macros - suggestions for improvement welcomed.
Tested with domctl version 5 and 6.
Regards,
Jim
14 years, 11 months
[libvirt] Fwd: Re: [Qemu-devel] Re: qemu-kvm-0.12 bug?
by Thomas Treutner
Hi,
there is a new parameter in qemu-0.12 required for virtio_balloon support. Is
there an appropriate XML-entry in libvirt's domain config yet or any plans to
introduce one? A quick googling for "libvirt balloon" didn't reveal any
hints.
Adam, how did you test the memstat reporting feature?
kr,
tom
---------- Forwarded Message ----------
Subject: Re: [Qemu-devel] Re: qemu-kvm-0.12 bug?
Date: Tuesday 29 December 2009
From: Luiz Capitulino <lcapitulino(a)redhat.com>
To: Thomas Treutner <thomas(a)scripty.at>
On Tue, 29 Dec 2009 13:08:26 +0100
Thomas Treutner <thomas(a)scripty.at> wrote:
> On Tuesday 29 December 2009 12:48:39 Luiz Capitulino wrote:
> > On Tue, 29 Dec 2009 13:10:36 +0200 Avi Kivity <avi(a)redhat.com> wrote:
> > > Hm, I get "The balloon device has not been activated by the guest" in
> > > the qemu monitor.
> >
> > Is the "-balloon virtio" parameter passed on the command-line?
>
> # grep balloon /usr/local/var/log/libvirt/qemu/* | wc -l
> 0
>
> These logs include some history - so the parameter isn't used by libvirt
even
> when ballooning works?
This parameter is new in qemu-0.12.
14 years, 11 months
[libvirt] [PATCH] Disable building of static Python module.
by Diego Elio Pettenò
Python modules are loaded at runtime so the static version of it is not
really needed, this avoids duplicating the build for the PIC and non-PIC
cases.
---
python/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/python/Makefile.am b/python/Makefile.am
index 04342b7..58c6729 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -39,7 +39,7 @@ libvirtmod_la_SOURCES = libvirt-override.c typewrappers.c libvirt.c libvirt.h
# need extra flags here
libvirtmod_la_CFLAGS = @WARN_PYTHON_CFLAGS@
-libvirtmod_la_LDFLAGS = -module -avoid-version -L$(top_builddir)/src/.libs \
+libvirtmod_la_LDFLAGS = -module -avoid-version -shared -L$(top_builddir)/src/.libs \
@CYGWIN_EXTRA_LDFLAGS@
libvirtmod_la_LIBADD = $(mylibs) \
@CYGWIN_EXTRA_LIBADD@ @CYGWIN_EXTRA_PYTHON_LIBADD@
--
1.6.6.rc4
14 years, 11 months
[libvirt] [PATCH] Fix parsing of 'info chardev' line endings
by Matthew Booth
This change makes the 'info chardev' parser ignore any trailing whitespace on a
line. This fixes a specific problem handling a '\r\n' line ending.
* src/qemu/qemu_monitor_text.c: Ignore trailing whitespace in 'info chardev'
output.
---
src/qemu/qemu_monitor_text.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 0cb9ea6..4fd8c4a 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -1622,15 +1622,26 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
goto cleanup;
}
- char *pos = reply; /* The current start of searching */
- char *end = pos + strlen(reply); /* The end of the reply string */
+ char *pos; /* The current start of searching */
+ char *next = reply; /* The start of the next line */
char *eol; /* The character which ends the current line */
+ char *end = reply + strlen(reply); /* The end of the reply string */
+
+ while (next) {
+ pos = next;
- while (pos < end) {
/* Split the output into lines */
eol = memchr(pos, '\n', end - pos);
- if (eol == NULL)
+ if (eol == NULL) {
eol = end;
+ next = NULL;
+ } else {
+ next = eol + 1;
+ }
+
+ /* Ignore all whitespace immediately before eol */
+ while (eol > pos && c_isspace(*(eol-1)))
+ eol -= 1;
/* Look for 'filename=pty:' */
#define NEEDLE "filename=pty:"
@@ -1638,13 +1649,13 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
/* If it's not there we can ignore this line */
if (!needle)
- goto next;
+ continue;
/* id is everthing from the beginning of the line to the ':'
* find ':' and turn it into a terminator */
char *colon = memchr(pos, ':', needle - pos);
if (colon == NULL)
- goto next;
+ continue;
*colon = '\0';
char *id = pos;
@@ -1664,9 +1675,6 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
goto cleanup;
}
#undef NEEDLE
-
- next:
- pos = eol + 1;
}
ret = 0;
--
1.6.5.2
14 years, 11 months
[libvirt] [PATCH] vbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure
by Jim Meyering
Similar to others,
>From 5dcb4d95a351cb6fa32ebaafb96756275e1079e2 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 16 Dec 2009 13:56:57 +0100
Subject: [PATCH] vbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure
* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Don't call
vboxDomainUndefine on a NULL "dom".
---
src/vbox/vbox_tmpl.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index d6b681c..ba70053 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -990,8 +990,6 @@ cleanup:
static virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
unsigned int flags ATTRIBUTE_UNUSED) {
- virDomainPtr dom = NULL;
-
/* VirtualBox currently doesn't have support for running
* virtual machines without actually defining them and thus
* for time being just define new machine and start it.
@@ -1000,17 +998,13 @@ static virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
* change this behaviour to the expected one.
*/
- dom = vboxDomainDefineXML(conn, xml);
- if (dom) {
- if (vboxDomainCreate(dom) < 0)
- goto cleanup;
- } else {
- goto cleanup;
- }
+ virDomainPtr dom = vboxDomainDefineXML(conn, xml);
+ if (dom == NULL)
+ return NULL;
- return dom;
+ if (0 < vboxDomainCreate(dom))
+ return dom;
-cleanup:
vboxDomainUndefine(dom);
return NULL;
}
--
1.6.6.rc2.275.g51e2d
14 years, 11 months
[libvirt] [PATCH] qemu_driver.c: avoid NULL dereference upon disk-op failure
by Jim Meyering
The local, "cgroup" is initialized to NULL, and may still
have that value when the code below is reached.
That would provoke a NULL-dereference in virCgroupDenyDevicePath.
>From c1caed370a7b2eae2e964a6059b014530143075c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 16 Dec 2009 14:15:50 +0100
Subject: [PATCH] qemu_driver.c: avoid NULL dereference upon disk-op failure
* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
virCgroupDenyDevicePath only if cgroup is non-NULL.
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9ef6c35..81afecf 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5485,7 +5485,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
virDomainDiskDeviceTypeToString(dev->data.disk->device));
/* Fallthrough */
}
- if (ret != 0) {
+ if (ret != 0 && cgroup) {
virCgroupDenyDevicePath(cgroup,
dev->data.disk->src);
}
--
1.6.6.rc2.275.g51e2d
14 years, 11 months
[libvirt] [PATCH] openvz_conf.c: don't dereference NULL upon failure
by Jim Meyering
"dom" is set to NULL within the while loop:
virDomainObjUnlock(dom);
dom = NULL;
If on a subsequent iteration something fails,
we goto "cleanup" or "no_memory", both of which
have us run this code:
fclose(fp);
virDomainObjUnref(dom);
return -1;
And the virDomainObjUnref function would dereference "dom".
>From 3971ff17c7e9f1ddbc443d48b86fe6ba60a2d4a0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 15 Dec 2009 16:16:57 +0100
Subject: [PATCH] openvz_conf.c: don't dereference NULL upon failure
* src/openvz/openvz_conf.c (openvzLoadDomains): Avoid NULL deref
of "dom".
---
src/openvz/openvz_conf.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 7e9abbf..43bbaf2 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -535,7 +535,8 @@ int openvzLoadDomains(struct openvz_driver *driver) {
cleanup:
fclose(fp);
- virDomainObjUnref(dom);
+ if (dom)
+ virDomainObjUnref(dom);
return -1;
}
--
1.6.6.rc2.275.g51e2d
14 years, 11 months
[libvirt] [PATCH 0/3] Block assignment of PCI devices below non-ACS capable switch
by Jiri Denemark
Hi.
This is a patchset for blocking assignment of PCI devices below non-ACS
capable switch. In case user still wants to assign such device even though it
might not be safe, she can specify permissive='yes' attribute for <hostdev>.
Special thanks to Chris L. who created a standalone program the PCI check.
This code is a port of that check to libvirt.
Jiri Denemark (3):
Tests for ACS in PCIe switches
New 'permissive' attribute for hostdev
Use pciDeviceIsAssignable in qemu driver
docs/schemas/domain.rng | 8 +++
src/conf/domain_conf.c | 14 ++++-
src/conf/domain_conf.h | 1 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_driver.c | 9 +++-
src/util/pci.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++
src/util/pci.h | 7 ++
7 files changed, 186 insertions(+), 3 deletions(-)
14 years, 11 months
Re: [libvirt] New libvirt API for domain memory statistics reporting (V3)
by Thomas Treutner
On Wednesday 23 December 2009 19:42:20 Adam Litke wrote:
> Attached to this email are two patches:
>
> memstats-kernel-2.6.32-rc5.patch:
> Applies to 2.6.32-rc5 which should be a capable-enough kernel for
> testing and development.
>
> memstats-qemu-0.12.1.patch:
> Applies to qemu-0.12.1 which can be found here:
> http://mirrors.igsobe.com/nongnu/qemu/qemu-0.12.1.tar.gz
> Unfortunately, it is not trivial for me to port this work to 0.11.0 so
> you will have to find a resolution to your BIOS woes first and then use
> this version. Who knows, it might already be fixed in 0.12.1.
I tried with qemu-*kvm*-0.12.1.1, no memstats yet, but dynamically setting the
amount of memory now doesn't work at all. I'll try to isolate the problem, I
suspect it comes from qemu-kvm-0.12.1.1.
I can't use qemu-0.12.1:
$ ./configure --enable-kvm --disable-xen
#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS
NOTE: To enable KVM support, update your kernel to 2.6.29+ or install
recent kvm-kmod from http://sourceforge.net/projects/kvm.
ERROR
ERROR: User requested feature kvm
ERROR: configure was not able to find it
ERROR
$ uname -r
2.6.32.2
$ modinfo kvm_amd
...
vermagic: 2.6.32.2 SMP mod_unload modversions
....
kr,tom
14 years, 11 months