[libvirt] [PATCH 0/3] Support changing user passwords in the guest
by Ján Tomko
The guest-set-user-password command was added to qemu-agent in the 2.3.0
release by Daniel Berrange (some of you might have heard of him):
commit 215a2771a7b6b29037ee8deba484815d816b6fdd
qga: add guest-set-user-password command
http://git.qemu.org/?p=qemu.git;a=commitdiff;h=215a277
This mini-series introduces a libvirt API, set_password ACL,
a virsh command and wires up the API in the QEMU driver.
Any bikesh^Wsuggestions regarding the API naming and the
order of the virsh parameters are welcome.
Ján Tomko (3):
Introduce virDomainSetUserPassword API
virsh: add set-user-password command
qemu: wire up virDomainSetUserPassword
include/libvirt/libvirt-domain.h | 9 +++++
src/access/viraccessperm.c | 2 +-
src/access/viraccessperm.h | 6 ++++
src/driver-hypervisor.h | 7 ++++
src/libvirt-domain.c | 47 +++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++
src/qemu/qemu_agent.c | 39 +++++++++++++++++++++
src/qemu/qemu_agent.h | 4 +++
src/qemu/qemu_driver.c | 55 +++++++++++++++++++++++++++++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 15 +++++++-
src/remote_protocol-structs | 7 ++++
tools/virsh-domain.c | 76 ++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 11 ++++++
14 files changed, 282 insertions(+), 2 deletions(-)
--
2.0.5
9 years, 7 months
[libvirt] [PATCH 0/3] parallels: fix prlsdkLoadDomain and prlsdkAddDomain
by Maxim Nestratov
Maxim Nestratov (3):
parallels: fix prlsdkAddDomain
parallels: move up updating autostart parameter in prlsdkLoadDomain
parallels: fix possible crash in case of errors in prlsdkLoadDomain
src/parallels/parallels_sdk.c | 39 ++++++++++++++++++++++++++-------------
1 file changed, 26 insertions(+), 13 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH 0/2] Add and use for virDomainDiskIndexBy*
by Jiri Denemark
Sometimes the only thing we need is the pointer to virDomainDiskDef and
having to call virDomainDiskIndexBy* APIs, storing the disk index, and
looking it up in the disks array is ugly. After this patch, we can just
call virDomainDiskBy* and get the pointer in one step.
Jiri Denemark (2):
Add wrappers for virDomainDiskIndexBy*
Use virDomainDiskByName where appropriate
src/conf/domain_conf.c | 20 +++++++++++++++
src/conf/domain_conf.h | 8 ++++++
src/libvirt_private.syms | 2 ++
src/libxl/libxl_driver.c | 4 +--
src/lxc/lxc_driver.c | 10 +++-----
src/qemu/qemu_agent.c | 9 ++++---
src/qemu/qemu_blockjob.c | 5 ++--
src/qemu/qemu_driver.c | 62 ++++++++++++++++++-----------------------------
src/qemu/qemu_migration.c | 6 ++---
src/qemu/qemu_process.c | 23 ++++--------------
10 files changed, 72 insertions(+), 77 deletions(-)
--
2.4.1
9 years, 7 months
[libvirt] [PATCH] threadpool: Switch to detached threads
by Jiri Denemark
Using joinable threads does not help anything, but it can lead to memory
leaks.
When a worker thread exits, it decreases nWorkers or nPrioWorkers and
once both nWorkers and nPrioWorkers are zero (i.e., the last worker is
gone), quit_cond is signaled. When freeing the pool we first tell all
threads to die and then we are waiting for both nWorkers and
nPrioWorkers to become zero. At this point we already know all threads
are gone. So the only reason for calling virThreadJoin of all workers is
to free the memory allocated for joinable threads. If we avoid
allocating this memory, we don't need to take care of freeing it.
Moreover, any memory associated with a worker thread which died before
we asked it to die (e.g., because virCondWait failed in the thread)
would be lost anyway since virThreadPoolFree calls virThreadJoin only
for threads which were running at the time virThreadPoolFree was called.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/util/virthreadpool.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c
index ed22486..f640448 100644
--- a/src/util/virthreadpool.c
+++ b/src/util/virthreadpool.c
@@ -201,7 +201,7 @@ virThreadPoolNewFull(size_t minWorkers,
data->cond = &pool->cond;
if (virThreadCreateFull(&pool->workers[i],
- true,
+ false,
virThreadPoolWorker,
pool->jobFuncName,
true,
@@ -225,7 +225,7 @@ virThreadPoolNewFull(size_t minWorkers,
data->priority = true;
if (virThreadCreateFull(&pool->prioWorkers[i],
- true,
+ false,
virThreadPoolWorker,
pool->jobFuncName,
true,
@@ -249,16 +249,11 @@ void virThreadPoolFree(virThreadPoolPtr pool)
{
virThreadPoolJobPtr job;
bool priority = false;
- size_t i;
- size_t nWorkers;
- size_t nPrioWorkers;
if (!pool)
return;
virMutexLock(&pool->mutex);
- nWorkers = pool->nWorkers;
- nPrioWorkers = pool->nPrioWorkers;
pool->quit = true;
if (pool->nWorkers > 0)
virCondBroadcast(&pool->cond);
@@ -275,12 +270,6 @@ void virThreadPoolFree(virThreadPoolPtr pool)
VIR_FREE(job);
}
- for (i = 0; i < nWorkers; i++)
- virThreadJoin(&pool->workers[i]);
-
- for (i = 0; i < nPrioWorkers; i++)
- virThreadJoin(&pool->prioWorkers[i]);
-
VIR_FREE(pool->workers);
virMutexUnlock(&pool->mutex);
virMutexDestroy(&pool->mutex);
@@ -338,7 +327,7 @@ int virThreadPoolSendJob(virThreadPoolPtr pool,
data->cond = &pool->cond;
if (virThreadCreateFull(&pool->workers[pool->nWorkers - 1],
- true,
+ false,
virThreadPoolWorker,
pool->jobFuncName,
true,
--
2.4.1
9 years, 7 months
[libvirt] [PATCH] qemu: Log error if domain uses security driver which is not loaded
by Erik Skultety
When starting a domain, if we find out domain requests security drivers
we do not have loaded, we fail. However we don't check for this during
reconnect, so any operation relying on security driver functionality would fail.
If someone e.g. starts a domain with selinux driver loaded, then they turn off
the security driver in config, restart the daemon and call dump/save/..,
QEMU returns an error.
As we shouldn't kill the domain, we should at least log an error to let the
user know that domain reconnect wasn't completely clean.
https://bugzilla.redhat.com/show_bug.cgi?id=1183893
---
src/qemu/qemu_process.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 56719eb..8da79e5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3747,6 +3747,12 @@ qemuProcessReconnect(void *opaque)
if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0)
goto error;
+ /* if domain requests security driver we haven't loaded, report error, but
+ * do not kill the domain
+ */
+ ignore_value(virSecurityManagerCheckAllLabel(driver->securityManager,
+ obj->def));
+
if (virSecurityManagerReserveLabel(driver->securityManager, obj->def, obj->pid) < 0)
goto error;
--
1.9.3
9 years, 7 months
[libvirt] [PATCH 0/3] virsh: Fix and enhance handling of numeric options
by Andrea Bolognani
The first commit improves error messages by making them much more
consistent and a little bit more helpful to the user.
The other two commits contain smaller fixes and enhancement.
Andrea Bolognani (3):
virsh: Improve error message on integer value parsing failure.
virsh: Fix dommemstat --period option type.
virsh: Improve handling of send-process-signal --pid.
tests/vcpupin | 4 +-
tools/virsh-domain-monitor.c | 12 +++--
tools/virsh-domain.c | 114 ++++++++++++++++++++++++++++++-------------
tools/virsh-host.c | 44 ++++++++++++-----
tools/virsh-interface.c | 4 +-
tools/virsh-network.c | 4 +-
tools/virsh-volume.c | 16 ++++--
7 files changed, 141 insertions(+), 57 deletions(-)
--
2.1.0
9 years, 7 months
[libvirt] [PATCH 0/2] Fix virsh nodeset on shutoff domains
by Michal Privoznik
This goes on the top of Martin's (ACKed) patch:
https://www.redhat.com/archives/libvir-list/2015-May/msg00585.html
Michal Privoznik (2):
virDomainNumatuneGetMode: Report if numatune was defined
qemuDomainGetNumaParameters: Don't report spurious info
src/conf/numa_conf.c | 38 ++++++++++++++++++++++--------
src/conf/numa_conf.h | 5 ++--
src/lxc/lxc_cgroup.c | 5 ++--
src/lxc/lxc_controller.c | 30 ++++++++++++------------
src/parallels/parallels_sdk.c | 5 ++--
src/qemu/qemu_cgroup.c | 15 +++++++-----
src/qemu/qemu_command.c | 4 ++--
src/qemu/qemu_driver.c | 54 ++++++++++++++++++++++++++++---------------
src/qemu/qemu_process.c | 28 +++++++++++-----------
9 files changed, 113 insertions(+), 71 deletions(-)
--
2.3.6
9 years, 7 months
[libvirt] [libvirt-python 0/3] reproducible builds
by Guido Günther
Debian tries to make builds reporducible[0] therefore we need predictable
output (i.e. no timestamps, predictable iteration over hashes, etc.). This
patch (mostly by Chris Lamb) to libvirt-python makes the necessary changes.
[0] https://wiki.debian.org/ReproducibleBuilds
Guido Günther (3):
Sort dictionary keys
Simplify sorting
Sort tuples on both items
generator.py | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
--
2.1.4
9 years, 7 months
[libvirt] [PATCH v3 0/4] Introduce pci-serial
by Michal Privoznik
diff to v2:
- Allocate address on domain define
diff to v1:
- Fix hot(un-)plug
Michal Privoznik (4):
Introduce pci-serial
qemu: Implement pci-serial
qemuDomainAttachChrDevice: Fix chardev hotplug
qemuDomainDetachChrDevice: Fix chardev hot-unplug
docs/formatdomain.html.in | 16 ++++++----
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 3 +-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 30 +++++++++++++++++-
src/qemu/qemu_hotplug.c | 36 ++++++++++++++++-----
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 1 +
.../qemuxml2argv-pci-serial-dev-chardev.args | 7 ++++
.../qemuxml2argv-pci-serial-dev-chardev.xml | 37 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 3 ++
tests/qemuxml2xmltest.c | 1 +
18 files changed, 128 insertions(+), 16 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pci-serial-dev-chardev.xml
--
2.3.6
9 years, 7 months
[libvirt] [PATCH] conf: Catch memory size overflow earlier
by Peter Krempa
virDomainParseMemory parses the size and then rounds up while converting
it to kibibytes. Since the number is limit-checked before the rounding
it's possible to use a number that would be correctly parsed the first
time, but not the second time. For numbers not limited to 32 bit systems
the magic is 9223372036854775807 bytes. That number then can't be parsed
back in kibibytes.
To solve the issue add a second overflow check for the few values that
would cause the problem. Since virDomainParseMemory is used in config
parsing, this avoids vanishing VMs.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1221504
---
src/conf/domain_conf.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index bfdc94e..ba4f430 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7237,6 +7237,13 @@ virDomainParseMemory(const char *xpath,
/* Yes, we really do use kibibytes for our internal sizing. */
*mem = VIR_DIV_UP(bytes, 1024);
+
+ if (*mem >= VIR_DIV_UP(max, 1024)) {
+ virReportError(VIR_ERR_OVERFLOW, "%s", _("size value too large"));
+ ret = -1;
+ goto cleanup;
+ }
+
ret = 0;
cleanup:
return ret;
--
2.3.5
9 years, 7 months