[libvirt] [PATCH] esx: Also allow virtualHW version 4 for ESX 4.0
by Matthias Bolte
A domain with virtualHW version 4 is allowed on an ESX 4.0 server.
If a domain is migrated from an ESX 3.5 server to an ESX 4.0 server
then the virtualHW version stays the same. So a ESX 4.0 server can
host domains with virtualHW version 4.
---
src/esx/esx_vmx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c
index 9aad592..d3cad1d 100644
--- a/src/esx/esx_vmx.c
+++ b/src/esx/esx_vmx.c
@@ -780,9 +780,9 @@ esxVMX_ParseConfig(virConnectPtr conn, esxVI_Context *ctx, const char *vmx,
break;
case esxVI_APIVersion_40:
- if (virtualHW_version != 7) {
+ if (virtualHW_version != 4 && virtualHW_version != 7) {
ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
- "Expecting VMX entry 'virtualHW.version' to be 7 for "
+ "Expecting VMX entry 'virtualHW.version' to be 4 or 7 for "
"VI API version 4.0 but found %lld", virtualHW_version);
goto failure;
}
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Don't free an uninitalized pointer in update_driver_name()
by Matthias Bolte
This invalid free results in heap corruption. Some symptoms I saw
because of this were libvirtd crashing and virt-manager hanging
while trying to enumerate devices.
---
src/node_device/node_device_driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index ecbac0f..fbadfca 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -78,7 +78,7 @@ static int update_driver_name(virConnectPtr conn,
virNodeDeviceObjPtr dev)
{
char *driver_link = NULL;
- char *devpath;
+ char *devpath = NULL;
char *p;
int ret = -1;
@@ -114,7 +114,7 @@ static int update_driver_name(virConnectPtr conn,
cleanup:
VIR_FREE(driver_link);
- free(devpath);
+ VIR_FREE(devpath);
return ret;
}
#else
--
1.6.0.4
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] iptables rules location
by Mihamina Rakotomandimby
Manao ahoana, Hello, Bonjour,
When starting libvirt there are some iptables rules setup.
I would like to know where are they stored (and the filename, I use
ubuntu package, need to 'find' or 'locate').
Misaotra, Thanks, Merci.
--
Architecte Informatique chez Blueline/Gulfsat:
Administration Systeme, Recherche & Developpement
+261 34 29 155 34 / +261 33 11 207 36
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: remove useless, warning-provoking test
by Jim Meyering
Tools like coverity and maybe clang notice that we dereference
uri_out, and then (later) test whether uri_out is NULL.
Obviously one or the other must go.
Presuming that we will always pass a non-NULL uri_out arg to
this function, I chose to mark that parameter as ATTRIBUTE_NONNULL.
I removed the unnecessary test, too.
If anyone is concerned that a non-NULL (non-literal)
value will be passed, I can also add an assertion.
>From 6ce3a9656d978b37d866f55606bc5031ad8e6b2f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 5 Jan 2010 16:32:11 +0100
Subject: [PATCH] qemu_driver.c: remove useless, warning-provoking test
* src/qemu/qemu_driver.c (qemudDomainMigratePrepare2): Remove useless
test of always-non-NULL uri_out parameter. Use ATTRIBUTE_NONNULL to
inform tools.
---
src/qemu/qemu_driver.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4639478..daa6f94 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1,7 +1,7 @@
/*
* driver.c: core driver methods for managing qemu guests
*
- * Copyright (C) 2006, 2007, 2008, 2009 Red Hat, Inc.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -6961,7 +6961,7 @@ cleanup:
*
* This starts an empty VM listening on a TCP port.
*/
-static int
+static int ATTRIBUTE_NONNULL (5)
qemudDomainMigratePrepare2 (virConnectPtr dconn,
char **cookie ATTRIBUTE_UNUSED,
int *cookielen ATTRIBUTE_UNUSED,
@@ -7068,7 +7068,7 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn,
}
}
- if (uri_out && *uri_out)
+ if (*uri_out)
VIR_DEBUG("Generated uri_out=%s", *uri_out);
/* Parse the domain XML. */
--
1.6.6.387.g2649b1
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