[libvirt] [PATCH] qemu_cgroup: initialize mem_mask to NULL
by Pavel Hrdina
If 'virNumaGetHostNodeset()' fails then the error path will try to free
uninitialized pointer mem_mask. Introduced by commit af2a1f058.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed under trivial rule.
src/qemu/qemu_cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index fc46450..7b8eed0 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -791,32 +791,32 @@ qemuInitCgroup(virQEMUDriverPtr driver,
static void
qemuRestoreCgroupState(virDomainObjPtr vm)
{
- char *mem_mask;
+ char *mem_mask = NULL;
int empty = -1;
qemuDomainObjPrivatePtr priv = vm->privateData;
virBitmapPtr all_nodes;
if (!(all_nodes = virNumaGetHostNodeset()))
goto error;
if (!(mem_mask = virBitmapFormat(all_nodes)))
goto error;
if ((empty = virCgroupHasEmptyTasks(priv->cgroup,
VIR_CGROUP_CONTROLLER_CPUSET)) <= 0)
goto error;
if (virCgroupSetCpusetMems(priv->cgroup, mem_mask) < 0)
goto error;
cleanup:
VIR_FREE(mem_mask);
virBitmapFree(all_nodes);
return;
error:
virResetLastError();
VIR_DEBUG("Couldn't restore cgroups to meaningful state");
goto cleanup;
}
--
2.0.5
9 years, 8 months
[libvirt] [PATCH] qemu: fix vm deadlock when try to use numatune in session mode
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1126762
commit 43b67f introduce a deadlock issue when we use numatune
to change numa settings to a vm in session mode.
Jump to endjob instead of jump to cleanup.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 709f468..1bbbe9b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9495,7 +9495,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
flags & VIR_DOMAIN_AFFECT_LIVE) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("NUMA tuning is not available in session mode"));
- goto cleanup;
+ goto endjob;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
--
1.8.3.1
9 years, 8 months
[libvirt] Fwd: libvirt 1.2.10 and latest EL6 qemu-kvm
by Franky Van Liedekerke
Since there was no reaction in the user list, I'm posting it in the
devel in the hope for some guidance to the problem mentioned below
(sorry about this).
Franky
---------- Forwarded message ----------
From: Franky Van Liedekerke <franky(a)e-dynamics.be>
Date: Wed, Feb 11, 2015 at 3:44 PM
Subject: Re: libvirt 1.2.10 and latest EL6 qemu-kvm
To: libvirt-users(a)redhat.com
(I'm sorry, I didn't find my original message but I provide the
archive link: https://www.redhat.com/archives/libvirt-users/2015-January/msg00069.html
)
I just tried the latest libvirt release (1.2.12), combined with the
following qemu EL6 package from centos:
qemu-kvm-0.12.1.2-2.448.el6_6.x86_64
Using 1.2.12 and this version of qemu-kvm, I still get the following
error when trying to start a domain:
error: Failed to start domain btcab0001ap.unix.banksys.be
error: internal error: unable to execute QEMU command 'qom-list': The
command qom-list has not been found
The older qemu package (qemu-kvm-0.12.1.2-2.415.el6_5.14.x86_64) works
just fine though (I also tried the qemu-rhev-packages for el6 from
ovirt, but no change).
I verified the changelog from libvirt 1.2.12 and the earlier suggested
fix is in there (but doesn't seem to change anything):
2015-01-14 Pavel Hrdina <phrdina(a)redhat.com>
qemu_monitor: introduce new function to get QOM path
Now, I have activated libvirtd debug and these are the qom-list lines
(I can provide the full logfile if wanted):
2015-02-11 14:10:33.259+0000: 13280: debug : virJSONValueToString:1528
: result={"execute":"qom-list","arguments":{"path":"/machine/unattached/device[0]"},"id":"libvirt-5"}
2015-02-11 14:10:33.259+0000: 13280: debug :
qemuMonitorJSONCommandWithFd:290 : Send command
'{"execute":"qom-list","arguments":{"path":"/machine/unattached/device[0]"},"id":"libvirt-5"}'
for write with FD -1
2015-02-11 14:10:33.259+0000: 13280: info : qemuMonitorSend:972 :
QEMU_MONITOR_SEND_MSG: mon=0x7fa62801cbf0
msg={"execute":"qom-list","arguments":{"path":"/machine/unattached/device[0]"},"id":"libvirt-5"}
2015-02-11 14:10:33.260+0000: 13278: info : qemuMonitorIOWrite:503 :
QEMU_MONITOR_IO_WRITE: mon=0x7fa62801cbf0
buf={"execute":"qom-list","arguments":{"path":"/machine/unattached/device[0]"},"id":"libvirt-5"}
2015-02-11 14:10:33.261+0000: 13278: info : qemuMonitorIOProcess:399 :
QEMU_MONITOR_IO_PROCESS: mon=0x7fa62801cbf0 buf={"id": "libvirt-5",
"error": {"class": "CommandNotFound", "desc": "The command qom-list
has not been found", "data": {"name": "qom-list"}}}
2015-02-11 14:10:33.261+0000: 13278: debug :
qemuMonitorJSONIOProcessLine:183 : Line [{"id": "libvirt-5", "error":
{"class": "CommandNotFound", "desc": "The command qom-list has not
been found", "data": {"name": "qom-list"}}}]
2015-02-11 14:10:33.261+0000: 13278: debug :
virJSONValueFromString:1361 : string={"id": "libvirt-5", "error":
{"class": "CommandNotFound", "desc": "The command qom-list has not
been found", "data": {"name": "qom-list"}}}
2015-02-11 14:10:33.261+0000: 13278: info :
qemuMonitorJSONIOProcessLine:203 : QEMU_MONITOR_RECV_REPLY:
mon=0x7fa62801cbf0 reply={"id": "libvirt-5", "error": {"class":
"CommandNotFound", "desc": "The command qom-list has not been found",
"data": {"name": "qom-list"}}}
2015-02-11 14:10:33.289+0000: 13280: debug : virJSONValueToString:1528
: result={"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-7"}
2015-02-11 14:10:33.289+0000: 13280: debug :
qemuMonitorJSONCommandWithFd:290 : Send command
'{"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-7"}'
for write with FD -1
2015-02-11 14:10:33.289+0000: 13280: info : qemuMonitorSend:972 :
QEMU_MONITOR_SEND_MSG: mon=0x7fa62801cbf0
msg={"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-7"}
2015-02-11 14:10:33.289+0000: 13278: info : qemuMonitorIOWrite:503 :
QEMU_MONITOR_IO_WRITE: mon=0x7fa62801cbf0
buf={"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-7"}
2015-02-11 14:10:33.291+0000: 13278: info : qemuMonitorIOProcess:399 :
QEMU_MONITOR_IO_PROCESS: mon=0x7fa62801cbf0 buf={"id": "libvirt-7",
"error": {"class": "CommandNotFound", "desc": "The command qom-list
has not been found", "data": {"name": "qom-list"}}}
2015-02-11 14:10:33.291+0000: 13278: debug :
qemuMonitorJSONIOProcessLine:183 : Line [{"id": "libvirt-7", "error":
{"class": "CommandNotFound", "desc": "The command qom-list has not
been found", "data": {"name": "qom-list"}}}]
2015-02-11 14:10:33.291+0000: 13278: debug :
virJSONValueFromString:1361 : string={"id": "libvirt-7", "error":
{"class": "CommandNotFound", "desc": "The command qom-list has not
been found", "data": {"name": "qom-list"}}}
2015-02-11 14:10:33.291+0000: 13278: info :
qemuMonitorJSONIOProcessLine:203 : QEMU_MONITOR_RECV_REPLY:
mon=0x7fa62801cbf0 reply={"id": "libvirt-7", "error": {"class":
"CommandNotFound", "desc": "The command qom-list has not been found",
"data": {"name": "qom-list"}}}
2015-02-11 14:10:33.291+0000: 13280: debug : virJSONValueToString:1528
: result={"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-7"}
2015-02-11 14:10:33.292+0000: 13280: debug : virJSONValueToString:1528
: result={"id":"libvirt-7","error":{"class":"CommandNotFound","desc":"The
command qom-list has not been found","data":{"name":"qom-list"}}}
2015-02-11 14:10:33.292+0000: 13280: debug :
qemuMonitorJSONCheckError:370 : unable to execute QEMU command
{"execute":"qom-list","arguments":{"path":"/machine/peripheral"},"id":"libvirt-7"}:
{"id":"libvirt-7","error":{"class":"CommandNotFound","desc":"The
command qom-list has not been found","data":{"name":"qom-list"}}}
2015-02-11 14:10:33.292+0000: 13280: error :
qemuMonitorJSONCheckError:381 : internal error: unable to execute QEMU
command 'qom-list': The command qom-list has not been found
(again: full log can be provided, but maybe that should be sent in
private, I don't know if it is allowed as an attachment here).
Any tips?
Franky
9 years, 8 months
[libvirt] Getting Introduced to the Community
by Gaurav Bansal
Hi,
My name is Gaurav Bansal and I would like to introduce myself to the
developers of this community. I'm (technically) a junior in the Computer
Science degree program at Birla Institute of Technology and Science Pilani.
I am well versed with Python, C/C++, Java, PHP and bash. I have been using
the qemu tool and the virt-manager for almost 6 months now and I'm
comfortable with it.
I was very much fascinated with the concept of Virtualization and wanted to
explore it more and what could be a better way to start off than KVM.
I was having a look at the GSoC 2015 ideas
<http://qemu-project.org/Google_Summer_of_Code_2015> page and the
particular project of Running docker containers using virt-sandbox
<http://qemu-project.org/Google_Summer_of_Code_2015#Running_docker_contain...>.
I
have some basic information about the docker images and have worked using
the libvirt API. I have also tried the proof of concept uploaded by Daniel
for downloading the docker images.
Could you please guide me through where should I look forward that would be
helpful for the project?
- Gaurav Bansal
Github : https://github.com/gauravb7090
IRC : gauravb7090
LinkedIn <http://in.linkedin.com/in/gauravb7090/>
9 years, 8 months
[libvirt] [PATCH] virsh: fix IP address in vncdisplay for listen type='network'
by Luyao Huang
Just like the fix for domdisplay in commit 1ba815.
---
tools/virsh-domain.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index dc4a863..2506b89 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10269,6 +10269,18 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
listen_addr = virXPathString("string(/domain/devices/graphics"
"[@type='vnc']/@listen)", ctxt);
+ if (!listen_addr) {
+ /* The subelement address - <listen address='xyz'/> -
+ * *should* have been automatically backfilled into its
+ * parent <graphics listen='xyz'> (which we just tried to
+ * retrieve into listen_addr above) but in some cases it
+ * isn't, so we also do an explicit check for the
+ * subelement (which, by the way, doesn't exist on libvirt
+ * < 0.9.4, so we really do need to check both places)
+ */
+ listen_addr = virXPathString("string(/domain/devices/graphics"
+ "[@type='vnc']/listen/@address)", ctxt);
+ }
if (listen_addr == NULL || STREQ(listen_addr, "0.0.0.0"))
vshPrint(ctl, ":%d\n", port-5900);
else
--
1.8.3.1
9 years, 8 months
[libvirt] [PATCH] Comment out variables/functions that are unused.
by Gary R Hook
Avoids complaints when the compiler is configured to "warn-unused".
A few files contain unnecessary code that results in the compiler
erroring out when -Wunused* options are used. Comment out the code
until such time as it is needed.
---
src/libxl/libxl_conf.c | 2 ++
tests/virnetsockettest.c | 8 ++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0555b91..f8db4d2 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -305,7 +305,9 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
regmatch_t subs[4];
char *saveptr = NULL;
size_t i;
+/*
virArch hostarch = caps->host.arch;
+*/
struct guest_arch guest_archs[32];
int nr_guest_archs = 0;
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 5d91f26..988ab43 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -333,9 +333,10 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED)
return ret;
}
+/*
static int testSocketCommandNormal(const void *data ATTRIBUTE_UNUSED)
{
- virNetSocketPtr csock = NULL; /* Client socket */
+ virNetSocketPtr csock = NULL; / * Client socket * /
char buf[100];
size_t i;
int ret = -1;
@@ -360,10 +361,12 @@ static int testSocketCommandNormal(const void *data ATTRIBUTE_UNUSED)
virObjectUnref(csock);
return ret;
}
+*/
+/*
static int testSocketCommandFail(const void *data ATTRIBUTE_UNUSED)
{
- virNetSocketPtr csock = NULL; /* Client socket */
+ virNetSocketPtr csock = NULL; / * Client socket * /
char buf[100];
int ret = -1;
virCommandPtr cmd = virCommandNewArgList("/bin/cat", "/dev/does-not-exist", NULL);
@@ -383,6 +386,7 @@ static int testSocketCommandFail(const void *data ATTRIBUTE_UNUSED)
virObjectUnref(csock);
return ret;
}
+*/
struct testSSHData {
const char *nodename;
--
1.9.1
9 years, 8 months
[libvirt] [PATCH] qemu: check the validity of a pointer
by Matthias Gatto
In the current code if mem_mask is NULL there is a "goto error", but
we freeing it without knowing if mem_mask is NULL or not, therefor
I've had a check.
Signed-off-by: Matthias Gatto <matthias.gatto(a)outscale.com>
---
src/qemu/qemu_cgroup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index ca255c8..926726c 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -810,7 +810,8 @@ qemuRestoreCgroupState(virDomainObjPtr vm)
goto error;
cleanup:
- VIR_FREE(mem_mask);
+ if (mem_mask)
+ VIR_FREE(mem_mask);
virBitmapFree(all_nodes);
return;
--
1.8.3.1
9 years, 8 months
[libvirt] [PATCH 0/2] Document virtlockd
by Daniel P. Berrange
Just some docs additions wrt virtlockd
Daniel P. Berrange (2):
docs: split out sanlock setup docs
docs: add page about virtlockd setup
docs/locking-lockd.html.in | 160 +++++++++++++++++++++++++
docs/locking-sanlock.html.in | 247 ++++++++++++++++++++++++++++++++++++++
docs/locking.html.in | 277 ++++++-------------------------------------
docs/sitemap.html.in | 10 ++
4 files changed, 450 insertions(+), 244 deletions(-)
create mode 100644 docs/locking-lockd.html.in
create mode 100644 docs/locking-sanlock.html.in
--
2.1.0
9 years, 8 months
[libvirt] [PATCH 0/3] numatune: Prefer old approach
by Michal Privoznik
Consider the following part of domain XML:
<numatune>
<memory mode='static' nodeset="0,2"/>
</numatune>
<cpu>
<numa>
<cell id='0' cpus='0' memory='65536' unit='KiB'/>
</numa>
</cpu>
Yes, this have a great potential of breaking things. Especially,
this will break migration between previous two or three upstream
releases and current release we are working on, because libvirt
started domains in more complicated way (even if not needed).
After these patches, domains will be started in simpler way which
is incompatible.
On the other hand, we get backward compatibility with much more
releases than we are about to break.
Michal Privoznik (3):
numatune_conf: Expose virDomainNumatuneNodeSpecified
qemuxml2argvtest: Fake response from numad
qemuBuildMemoryBackendStr: Report backend requirement more
appropriately
src/conf/numatune_conf.c | 2 +-
src/conf/numatune_conf.h | 3 +++
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 6 ++++--
tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args | 5 +++++
tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args | 5 +++++
tests/qemuxml2argvtest.c | 12 +++++++++++-
8 files changed, 31 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-numatune-auto-prefer.args
--
2.0.5
9 years, 8 months
[libvirt] [PATCH 0/2] Fix virFileFindResource in VPATH
by Jiri Denemark
Jiri Denemark (2):
virFileFindResource: Add support for looking in source tree
Search for schemas and cpu_map.xml in source tree
src/Makefile.am | 2 ++
src/conf/domain_conf.c | 6 ++---
src/cpu/cpu_map.c | 6 ++---
src/driver.c | 1 +
src/libvirt_private.syms | 1 +
src/locking/lock_driver_lockd.c | 1 +
src/locking/lock_manager.c | 1 +
src/remote/remote_driver.c | 1 +
src/util/virfile.c | 49 +++++++++++++++++++++++++++++++++--------
src/util/virfile.h | 12 +++++++++-
10 files changed, 64 insertions(+), 16 deletions(-)
--
2.3.0
9 years, 8 months