Re: [PATCH] tools: fix libvirt-guests.sh text assignments

2020-08-20 Thread Michael Chapman
On Thu, 20 Aug 2020, Christian Ehrhardt wrote: > On Wed, Aug 19, 2020 at 12:15 PM Christian Ehrhardt > wrote: > > > > In libvirt 6.6 stopping guests with libvirt-guests.sh is broken. > > As soon as there is more than one guest one can see > > `systemctl stop libvirt-guests` faiing and in the log

[libvirt] [PATCH 1/2] util: fix byte order of port in virSocketAddrResolveService

2019-09-17 Thread Michael Chapman
The ports in the socket address structures returned by getaddrinfo() are in network byte order. Convert to host byte order before returning them. Signed-off-by: Michael Chapman --- src/util/virsocketaddr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util

[libvirt] [PATCH 2/2] remote: fix registration of TLS socket

2019-09-17 Thread Michael Chapman
Signed-off-by: Michael Chapman --- src/remote/remote_daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 966f3da2d0..7195ac9218 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c

[libvirt] [PATCH 0/2] Fix systemd socket activation for systemd < v227

2019-09-17 Thread Michael Chapman
rtd-tls.socket was passed to libvirtd, leading to this socket not being properly registered. Michael Chapman (2): util: fix byte order of port in virSocketAddrResolveService remote: fix registration of TLS socket src/remote/remote_daemon.c | 2 +- src/util/virsocketaddr.c | 4 ++-- 2 fi

Re: [libvirt] [PATCH v2] virsh: improve waiting for block job readiness

2016-01-26 Thread Michael Chapman
, equivalent path when querying the block job. I'm pretty sure we came to the conclusion that that wouldn't ever have worked: the block job wouldn't be able to be identified if the path was different. On 01/06/2016 10:03 PM, Michael Chapman wrote: After a block job hits 100%, we only need to apply

[libvirt] [PATCH v3 3/4] virsh: ensure SIGINT action is reset on all errors

2016-01-26 Thread Michael Chapman
If virTimeMillisNow() fails, the SIGINT action must be reset back to its previous state. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c

[libvirt] [PATCH v3 2/4] virsh: be consistent with style of loop exit

2016-01-26 Thread Michael Chapman
When waiting for a block job, the various statuses (COMPLETED, READY, CANCELED, etc.) should all be treated consistently by having the loop be exited with "break". Use "goto cleanup" for the error cases only, when no block job status is available. Signed-off-by

[libvirt] [PATCH v3 0/4] virshBlockJobWait improvements

2016-01-26 Thread Michael Chapman
ot;goto" on all the error cases and "break" everywhere else. I had noticed another bug where the SIGINT signal action wasn't reset if the virTimeMillisNow() call failed; that's fixed in patch 3 in this series. Michael Chapman (4): virsh: avoid unnecessary progress updates virs

[libvirt] [PATCH v3 1/4] virsh: avoid unnecessary progress updates

2016-01-26 Thread Michael Chapman
There is no need to call virshPrintJobProgress() unless the block job's cur or end cursors have changed since the last iteration. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- tools/virsh-domain.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a

[libvirt] [PATCH v3 4/4] virsh: improve waiting for block job readiness

2016-01-26 Thread Michael Chapman
, then we're guaranteed to eventually get one of the events. The path being used by virsh must be exactly the source path or target device in the domain's disk definition, and these are the respective strings sent back in these two events. Signed-off-by: Michael Chapman <m...@very.puzzling.org> ---

Re: [libvirt] [PATCH] qemu: save config after pivot only if domain is persistent

2016-01-06 Thread Michael Chapman
On Wed, 6 Jan 2016, Peter Krempa wrote: On Tue, Jan 05, 2016 at 11:38:07 +1100, Michael Chapman wrote: On Mon, 4 Jan 2016, Peter Krempa wrote: On Thu, Dec 31, 2015 at 16:42:52 +1100, Michael Chapman wrote: ... @@ -188,8 +182,8 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver

Re: [libvirt] [PATCH] libvirt-guests: emit most messages to stderr

2016-01-06 Thread Michael Chapman
On Wed, 6 Jan 2016, Martin Kletzander wrote: On Thu, Dec 31, 2015 at 04:53:54PM +1100, Michael Chapman wrote: Some of the shell functions in this script (e.g. check_guests_shutdown) produce output that is captured and processed by other parts of the script. Any error messages from these shell

Re: [libvirt] [PATCH] virsh: improve waiting for block job readiness

2016-01-04 Thread Michael Chapman
On Mon, 4 Jan 2016, Andrea Bolognani wrote: On Thu, 2015-12-31 at 16:34 +1100, Michael Chapman wrote: Wait for a block job event after the job has reached 100% only if exactly one of the BLOCK_JOB and BLOCK_JOB_2 callbacks were successfully registered.   If neither callback was registered

Re: [libvirt] [PATCH] virsh: improve waiting for block job readiness

2016-01-04 Thread Michael Chapman
On Mon, 4 Jan 2016, Peter Krempa wrote: On Thu, Dec 31, 2015 at 16:34:49 +1100, Michael Chapman wrote: Wait for a block job event after the job has reached 100% only if exactly one of the BLOCK_JOB and BLOCK_JOB_2 callbacks were successfully registered. If neither callback was registered

Re: [libvirt] [PATCH] qemu: save config after pivot only if domain is persistent

2016-01-04 Thread Michael Chapman
On Mon, 4 Jan 2016, Peter Krempa wrote: On Thu, Dec 31, 2015 at 16:42:52 +1100, Michael Chapman wrote: When pivoting after a completed block job, only save the domain's persistent configuration if the domain is actually marked persistent. This commit also refactors the logic surrounding

[libvirt] [PATCH] virsh: improve waiting for block job readiness

2015-12-30 Thread Michael Chapman
to match one of the events. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- I have found that even a 2.5 second timeout isn't always sufficiently long for QEMU to flush a disk at the end of a block job. I hope I've understood the code properly here, because as far as I can tell the c

[libvirt] [PATCH] qemu: fix default migration_address for NBD server

2015-12-30 Thread Michael Chapman
"type": "inet", "data": { "host": null, "port": "49153" } } }, "id": "libvirt-14" } The migration address only applies to direct migration. Unfortunately we can't move this logic as far back a

[libvirt] [PATCH] libvirt-guests: emit most messages to stderr

2015-12-30 Thread Michael Chapman
and which are not (and maintaining this safety as the script is refactored), simplify things by emitting all messages to stderr, except for the output from gueststatus(), rh_status() and usage(). Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- tools/libvirt-guests.sh.i

[libvirt] [PATCH 0/2] Various RHEL 6 bugfixes

2015-12-30 Thread Michael Chapman
This patch set fixes a couple of minor bugs I discovered while building libvirt v1.3.0 for RHEL 6. Michael Chapman (2): spec: fix builds on RHEL <= 6 virtlogd: fix lock file path in initscript libvirt.spec.in | 8 src/logging/virtlogd.init.in | 6 +++--- 2 fi

[libvirt] [PATCH 1/3] qemu: do not copy out non-existent block job info

2015-12-30 Thread Michael Chapman
==by 0x6E08A50: start_thread (in /lib64/libpthread-2.12.so) ==23975==by 0x82BE93C: clone (in /lib64/libc-2.12.so) If no matching block job is found, qemuMonitorGetBlockJobInfo returns 0 and we should not write anything to the caller-supplied virDomainBlockJobInfo pointer. Signed-off-by: Michael

[libvirt] [PATCH 3/3] storage: do not leak storage pool XML filename

2015-12-30 Thread Michael Chapman
-by: Michael Chapman <m...@very.puzzling.org> --- src/storage/storage_driver.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 0bb577f..c8f259e 100644 --- a/src/storage/storage_driver.c +++ b/src/s

[libvirt] [PATCH 2/3] qemu: do not leak NBD disk data in migration cookie

2015-12-30 Thread Michael Chapman
the old object (including the disk list) and allocate a new one. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- src/qemu/qemu_migration.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4

[libvirt] [PATCH 0/3] Various Valgrind fixes

2015-12-30 Thread Michael Chapman
Valgrind reported a couple of memory leaks and jumps conditional on uninitialized values. Happy New Year! Michael Chapman (3): qemu: do not copy out non-existent block job info qemu: do not leak NBD disk data in migration cookie storage: do not leak storage pool XML filename src/qemu

[libvirt] [PATCH 2/2] virtlogd: fix lock file path in initscript

2015-12-30 Thread Michael Chapman
The virtlogd initscript's lock file should go in /var/lock/subsys/, not (the nonexistent) /var/log/subsys/. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- src/logging/virtlogd.init.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/l

[libvirt] [PATCH 1/2] spec: fix builds on RHEL <= 6

2015-12-30 Thread Michael Chapman
- dbus-devel is needed as build dependency if polkit support is enabled. - chkconfig(8) and service(8) are in /sbin/, not /bin/. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- libvirt.spec.in | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libvirt.s

[libvirt] [PATCH] qemu: save config after pivot only if domain is persistent

2015-12-30 Thread Michael Chapman
nce if virStorageSourceCopy were to fail to allocate memory. Signed-off-by: Michael Chapman <m...@very.puzzling.org> --- src/qemu/qemu_blockjob.c | 34 ++ 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c inde

[libvirt] [PATCH 3/5] qemuProcessStop: wake up pending sync block jobs

2015-04-16 Thread Michael Chapman
Other threads may be blocked in qemuBlockJobSyncWait. Ensure that they're woken up when the domain is stopped. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_process.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu

[libvirt] [PATCH 2/5] qemuBlockJobSync*: introduce sync block job helpers

2015-04-16 Thread Michael Chapman
, timeout, status) 0) { /* domain died while waiting for event */ ret = -1; goto error; } } while (status == -1); qemuBlockJobSyncEnd(driver, vm, disk, NULL); Signed-off-by: Michael Chapman m...@very.puzzling.org --- po/POTFILES.in

[libvirt] [PATCH 5/5] qemu: migration: use sync block job helpers

2015-04-16 Thread Michael Chapman
) source VM. If a drive mirror can not be cancelled, then the destination is not in a consistent state. In this case it is not safe to continue with the migration. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 439

[libvirt] [PATCH 1/5] qemuBlockJobEventProcess: move to new source file

2015-04-16 Thread Michael Chapman
We will want to use synchronous block jobs from qemu_migration as well, so split this function out into a new source file. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/Makefile.am | 1 + src/qemu/qemu_blockjob.c | 167

[libvirt] [PATCH 0/5] Use synchronous block job events in qemu_migration

2015-04-16 Thread Michael Chapman
a synchronous block job. Patch 3 ensures that a thread waiting on a synchronous block job event is woken up should the domain crash. Patches 4 and 5 use the new synchronous block job helpers in qemu_driver and qemu_migration respectively. Michael Chapman (5): qemuBlockJobEventProcess: move to new

[libvirt] [PATCH] virCondWaitUntil: calculate timespec correctly

2015-04-16 Thread Michael Chapman
ts.tv_nsec was off by a factor of 1000, making timeouts less than a second in the future often expiring immediately. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/util/virthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virthread.c b/src/util

[libvirt] [PATCH 4/5] qemuDomainBlockJobAbort: use sync block job helpers

2015-04-16 Thread Michael Chapman
The !modern code path needs to call qemuBlockJobEventProcess directly. the modern code path will call it via qemuBlockJobSyncWait. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_driver.c | 56 ++ 1 file changed, 20

Re: [libvirt] [PATCH 11/11] qemu: Refactor qemuDomainBlockJobAbort()

2015-04-09 Thread Michael Chapman
On Wed, 1 Apr 2015, Peter Krempa wrote: Change few variable names and refactor the code flow. As an additional bonus the function now fails if the event state is not as expected. --- src/qemu/qemu_driver.c | 108 - 1 file changed, 52 insertions(+),

Re: [libvirt] [PATCH 2/3] qemu: event: Don't fiddle with disk backing trees without a job

2015-04-08 Thread Michael Chapman
On Fri, 13 Mar 2015, Peter Krempa wrote: Surprisingly we did not grab a VM job when a block job finished and we'd happily rewrite the backing chain data. This made it possible to crash libvirt when queueing two backing chains tightly and other badness. To fix it, add yet another handler to the

[libvirt] [PATCH] qemu_driver: check caps after starting block job

2015-04-08 Thread Michael Chapman
not supported with this QEMU binary Move the qemuCaps check into the block job so that we are guaranteed the domain is running. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_driver.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/qemu

[libvirt] [PATCH] qemu_migrate: use nested job when adding NBD to cookie

2015-04-08 Thread Michael Chapman
/qemu_monitor.c:975 975 while (!mon-msg-finished) { (gdb) print mon-msg $1 = (qemuMonitorMessagePtr) 0x0 Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu

Re: [libvirt] [PATCH 4/4] util: fix removal of callbacks in virCloseCallbacksRun

2015-04-07 Thread Michael Chapman
On Tue, 7 Apr 2015, Ján Tomko wrote: On Mon, Mar 30, 2015 at 01:41:01PM +1100, Michael Chapman wrote: The close callbacks hash are keyed by a UUID-string, but virCloseCallbacksRun was attempting to remove them by raw UUID. This patch ensures the callback entries are removed by UUID-string

[libvirt] [PATCH 4/4 v2] util: fix removal of callbacks in virCloseCallbacksRun

2015-04-07 Thread Michael Chapman
\ --verbose --compressed --live --auto-converge \ --abort-on-error --unsafe --persistent \ --undefinesource --copy-storage-all --xml example.xml error: Requested operation is not valid: domain 'example' is not being migrated Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/util

Re: [libvirt] [PATCH] qemu: fix crash in qemuProcessAutoDestroy

2015-03-29 Thread Michael Chapman
On Fri, 27 Mar 2015, Michael Chapman wrote: The destination libvirt daemon in a migration may segfault if the client disconnects immediately after the migration has begun: # virsh -c qemu+tls://remote/system list --all IdName State

[libvirt] [PATCH 2/4] qemu: fix error propagation in qemuMigrationBegin

2015-03-29 Thread Michael Chapman
If virCloseCallbacksSet fails, qemuMigrationBegin must return NULL to indicate an error occurred. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu

[libvirt] [PATCH 1/4] qemu: fix crash in qemuProcessAutoDestroy

2015-03-29 Thread Michael Chapman
and lxcProcessAutoDestroy (which call virDomainObjListRemove directly). Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_domain.c | 5 + src/qemu/qemu_process.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu

[libvirt] [PATCH 3/4] qemu: fix race between disk mirror fail and cancel

2015-03-29 Thread Michael Chapman
if it is already aborted. Do the check *after* aborting the block job in QEMU to avoid a race. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 8 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 21432c0

[libvirt] [PATCH 4/4] util: fix removal of callbacks in virCloseCallbacksRun

2015-03-29 Thread Michael Chapman
\ --verbose --compressed --live --auto-converge \ --abort-on-error --unsafe --persistent \ --undefinesource --copy-storage-all --xml example.xml error: Requested operation is not valid: domain 'example' is not being migrated Signed-off-by: Michael Chapman m...@very.puzzling.org --- src

[libvirt] [PATCH 0/4] Various bugfixes for cancelled VM migrations

2015-03-29 Thread Michael Chapman
callback handling on the source libvirt side. Patch 3 ensures that the VM on the source libvirt does not get into an invalid state if its migration is aborted during disk mirroring. All patches are independent of one another and can be applied separately. Michael Chapman (4): qemu: fix crash

Re: [libvirt] qemu_migration: Precreate missing storage breaks with network drives

2015-03-26 Thread Michael Chapman
On Thu, 26 Mar 2015, Noel Burton-Krahn wrote: Hi Michal, How can we move this along as a patch to libvirt? Can we submit a patch ourselves? Hi Noel, Michal applied my patch for this as commit a1b1805155. It looks like we've been trying to solve the same problem in different threads;

[libvirt] [PATCH] qemu: fix crash in qemuProcessAutoDestroy

2015-03-26 Thread Michael Chapman
and lxcProcessAutoDestroy (which call virDomainObjListRemove directly). Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_domain.c | 5 + src/qemu/qemu_process.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu

Re: [libvirt] qemu_migration: Precreate missing storage breaks with network drives

2015-03-20 Thread Michael Chapman
On Fri, 20 Mar 2015, Noel Burton-Krahn wrote: Hi Michal, I think issuing a libvirt migrate to a host where the network disks don't already exist would be a prequisite failure. Libvirt can never copy a network disk, but it shouldn't fail trying to migrate an existing domain that contains a

Re: [libvirt] [PATCH] qemu: skip precreation of network disks

2015-03-19 Thread Michael Chapman
On Fri, 13 Mar 2015, Michael Chapman wrote: Commit cf54c60699833b3791a5d0eb3eb5a1948c267f6b introduced the ability to create missing storage volumes during migration. For network disks, however, we may not necessarily be able to detect whether they already exist -- there is no straight-forward

[libvirt] [PATCH] qemu: skip precreation of network disks

2015-03-12 Thread Michael Chapman
-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 83be435..ebe8af5 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c

[libvirt] [PATCH] domain_conf: fix crash in virDomainObjListFindByUUIDInternal

2015-03-10 Thread Michael Chapman
If a domain object is being removed and looked up concurrently we must ensure we unlock the object before unreferencing it, since the latter might free the object. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[libvirt] [PATCH] {domain, network}_conf: disable autostart when deleting config

2015-03-10 Thread Michael Chapman
) are removed. The bridge network driver cleared this flag itself in networkUndefine. This commit moves this into virNetworkDeleteConfig for symmetry with virDomainDeleteConfig, and to ensure it is not missed in future network drivers. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src

Re: [libvirt] QEMU migration with non-shared storage

2014-09-11 Thread Michael Chapman
On Thu, 11 Sep 2014, Blair Bethwaite wrote: A related problem arises mixing RBD and local disks when drive-mirroring / block-migrating - the RBDs get migrated too, volume round trips out of ceph - into source hypervisor - into dest hypervisor - back into ceph. Not great! This patch fixes that

[libvirt] QEMU migration with non-shared storage

2014-09-10 Thread Michael Chapman
Hello, I am trying to understand libvirt's logic for checking whether migration of a VM is safe, and how it determines which disks should be mirrored by QEMU. My particular use case involves VMs that may have disks backed onto LVM or onto Ceph RBD, or both. As far as I can tell, the

Re: [libvirt] storage conf: Add key-value options to storage pools

2014-06-04 Thread Michael Chapman
On Tue, 3 Jun 2014, Ján Tomko wrote: On 05/28/2014 11:38 AM, Wido den Hollander wrote: This series of patches adds the ability to pass down options to the storage pool drivers. In the case of NFS users can specify mount options and in the case of RBD users can specify options for librados to

Re: [libvirt] [PATCH] datatypes: Fix comments

2014-03-10 Thread Michael Chapman
On Thu, 6 Mar 2014, Ján Tomko wrote: On 03/04/2014 03:58 AM, Michael Chapman wrote: diff --git a/src/datatypes.c b/src/datatypes.c index 73f17e7..aafa54b 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -96,9 +96,8 @@ VIR_ONCE_GLOBAL_INIT(virDataTypes) /** * virGetConnect

[libvirt] [PATCH] datatypes: Fix comments

2014-03-10 Thread Michael Chapman
(), virGetDomainSnapshot(), virDomainSnapshotDispose(). Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/datatypes.c | 126 +--- 1 file changed, 74 insertions(+), 52 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index

[libvirt] [PATCH] spec: move some dirs into appropriate subpackages

2014-03-05 Thread Michael Chapman
-network. - %{_datadir}/libvirt/networks/ and %{_datadir}/libvirt/networks/default.xml Used only by the %post scriptlet in libvirt-daemon-config-network. Signed-off-by: Michael Chapman m...@very.puzzling.org --- libvirt.spec.in | 24 ++-- 1 file changed, 14 insertions

[libvirt] [PATCH 3/4] virIdentityGetSystem: don't fail if SELinux is disabled

2014-03-05 Thread Michael Chapman
if SELinux is disabled. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/util/viridentity.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/util/viridentity.c b/src/util/viridentity.c index 4f5127c..bd6adcf 100644 --- a/src/util/viridentity.c

[libvirt] [PATCH 2/4] tests: SELinux tests do not need to be skipped

2014-03-05 Thread Michael Chapman
With the previous commit's securityselinuxhelper enhancements, the SELinux security manager can be tested even without SELinux enabled on the test system. Signed-off-by: Michael Chapman m...@very.puzzling.org --- tests/securityselinuxlabeltest.c | 3 --- tests/securityselinuxtest.c | 3

[libvirt] [PATCH 0/4] Fix for virIdentityGetSystem when SELinux is disabled

2014-03-05 Thread Michael Chapman
isn't enabled on the test system. Michael Chapman (4): tests: Flesh out securityselinuxhelper tests: SELinux tests do not need to be skipped virIdentityGetSystem: don't fail if SELinux is disabled tests: Test virIdentityGetSystem src/util/viridentity.c | 18

[libvirt] [PATCH 1/4] tests: Flesh out securityselinuxhelper

2014-03-05 Thread Michael Chapman
manager code. Signed-off-by: Michael Chapman m...@very.puzzling.org --- tests/securityselinuxhelper.c | 162 - tests/securityselinuxhelperdata/lxc_contexts | 5 + .../virtual_domain_context | 2 + .../virtual_image_context

[libvirt] [PATCH 4/4] tests: Test virIdentityGetSystem

2014-03-05 Thread Michael Chapman
Test it once with SELinux enabled and once with it disabled. Signed-off-by: Michael Chapman m...@very.puzzling.org --- tests/Makefile.am | 4 +++ tests/viridentitytest.c | 75 - 2 files changed, 78 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH] datatypes: Fix comments

2014-03-03 Thread Michael Chapman
virObjectUnref()). - Add comments for virGetStream(), virStreamDispose(), virGetDomainSnapshot(), virDomainSnapshotDispose(). Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/datatypes.c | 174 1 file changed, 99 insertions

Re: [libvirt] [PATCH 4/8] storage: lvm: Separate creating of the volume from building

2014-02-12 Thread Michael Chapman
On Wed, 12 Feb 2014, Ján Tomko wrote: --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -1828,6 +1828,10 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj, pool-volumes.objs[pool-volumes.count++] = newvol; volobj = virGetStorageVol(obj-conn,

[libvirt] [PATCH] storage: handle NULL return from virGetStorageVol

2014-02-12 Thread Michael Chapman
virGetStorageVol can return NULL on out-of-memory. If it does, cleanly abort the volume clone operation. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/storage/storage_driver.c | 4 1 file changed, 4 insertions(+) diff --git a/src/storage/storage_driver.c b/src/storage

Re: [libvirt] [PATCH 4/8] storage: lvm: Separate creating of the volume from building

2014-02-11 Thread Michael Chapman
On Thu, 16 Jan 2014, Peter Krempa wrote: On 01/09/14 23:40, Eric Blake wrote: On 01/06/2014 09:44 AM, Peter Krempa wrote: Separate the steps to create libvirt's volume metadata from the actual volume building process. This is already done for regular file based pools to allow job support for

Re: [libvirt] [PATCH v2] virtlockd: make re-exec more robust

2013-12-16 Thread Michael Chapman
On Wed, 11 Dec 2013, Michael Chapman wrote: - Use $XDG_RUNTIME_DIR for re-exec state file when running unprivileged. - argv[0] may not contain a full path to the binary, however it should contain something that can be looked up in the PATH. Use execvp() to do path lookup on re-exec. - As per

Re: [libvirt] [PATCH 5/6] virtlockd: make re-exec more robust

2013-12-11 Thread Michael Chapman
On Tue, 10 Dec 2013, Daniel P. Berrange wrote: It would seem to be simpler to instead change the main() method so that --daemon is ignored when re-exec'ing. Yes, that does sound saner. I also noticed that virtlockd attempts to write out a re-exec state file under /var/ even when running

[libvirt] [PATCH v2] virtlockd: make re-exec more robust

2013-12-11 Thread Michael Chapman
-exec. [1] https://www.redhat.com/archives/libvir-list/2013-December/msg00514.html Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/locking/lock_daemon.c | 128 ++ 1 file changed, 94 insertions(+), 34 deletions(-) diff --git a/src/locking

[libvirt] [PATCH] storage_backend_rbd: rename stat variable

2013-12-11 Thread Michael Chapman
This variable shadows the stat(2) function, which only became visible in this scope as of commit 9cac8639. Rename the variable so it doesn't conflict. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/storage/storage_backend_rbd.c | 12 ++-- 1 file changed, 6 insertions(+), 6

[libvirt] [PATCH 0/6] Some virtlockd improvements

2013-12-08 Thread Michael Chapman
them due to missing symbols). Michael Chapman (6): virtlockd: improve systemd units virtlockd: improve initscripts virtlockd: treat SIGHUP like SIGUSR1 virtlockd: use common exit path when out-of-memory virtlockd: make re-exec more robust spec: clean up libvirtd and virtlockd service

[libvirt] [PATCH 3/6] virtlockd: treat SIGHUP like SIGUSR1

2013-12-08 Thread Michael Chapman
SIGHUP is commonly used to instruct a daemon to reload its config. For now we should handle it in virtlockd just like SIGUSR1, rather than having it kill the process. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/locking/lock_daemon.c | 2 ++ 1 file changed, 2 insertions(+) diff

[libvirt] [PATCH 6/6] spec: clean up libvirtd and virtlockd service mgmt

2013-12-08 Thread Michael Chapman
. As an older package would only reload libvirtd during %post, and the newer package would only reload libvirtd during %postun, such an upgrade would not reload libvirtd at all without the trigger. Signed-off-by: Michael Chapman m...@very.puzzling.org --- libvirt.spec.in | 43

[libvirt] [PATCH 4/6] virtlockd: use common exit path when out-of-memory

2013-12-08 Thread Michael Chapman
Also use a distinct, valid exit status for daemon re-execution failure. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/locking/lock_daemon.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking

[libvirt] [PATCH 5/6] virtlockd: make re-exec more robust

2013-12-08 Thread Michael Chapman
means we end up with the wrong PID and so we can't validate the state file. Instead, build a new argv for the new program that does not include --daemon. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/locking/lock_daemon.c | 49 +-- 1 file

[libvirt] [PATCH 2/6] virtlockd: improve initscripts

2013-12-08 Thread Michael Chapman
. LSB does not guarantee that this defaults to the inverse of Default-Start. Signed-off-by: Michael Chapman m...@very.puzzling.org --- daemon/libvirtd.init.in | 2 ++ src/locking/virtlockd.init.in | 11 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/daemon

[libvirt] [PATCH 1/6] virtlockd: improve systemd units

2013-12-08 Thread Michael Chapman
than multi-user.target. This is consistent with other socket units in Fedora, and it ensures that the socket is available before libvirtd is started. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/locking/virtlockd.service.in | 7 +-- src/locking/virtlockd.socket.in | 2

Re: [libvirt] [PATCH] spec: fix libvirt-docs subpackage on RHEL

2013-11-18 Thread Michael Chapman
On Wed, 13 Nov 2013, Michael Chapman wrote: error: create archive failed on file /builddir/build/BUILDROOT/libvirt-1.1.4-1.el6.x86_64/usr/share/doc/libvirt-docs-1.1.4/html/32favicon.png: cpio: Bad magic RPM build errors: File listed twice: /usr/share/doc/libvirt-docs-1.1.4 create

Re: [libvirt] [PATCH] spec: fix libvirt-docs subpackage on RHEL

2013-11-13 Thread Michael Chapman
On Wed, 13 Nov 2013, Daniel P. Berrange wrote: On Wed, Nov 13, 2013 at 12:02:08PM +1100, Michael Chapman wrote: RHEL's rpmbuild wipes the docdir for a (sub-)package if any %doc directives are present, prior to copying in the marked documentation. This means we can't prepopulate this directory

Re: [libvirt] rpmbuild problem for 1.1.4

2013-11-12 Thread Michael Chapman
On Thu, 7 Nov 2013, Franky Van Liedekerke wrote: Hi, using the latest 1.1.4, I'm having issues to get the rpm build to complete. I'm always getting this error: == Wrote: /root/rpmbuild/RPMS/x86_64/libvirt-1.1.4-1.el6.x86_64.rpm error: create archive failed on file

[libvirt] [PATCH] spec: fix libvirt-docs subpackage on RHEL

2013-11-12 Thread Michael Chapman
directory during %install and mark the contents of this temporary directory with %doc. Signed-off-by: Michael Chapman m...@very.puzzling.org --- libvirt.spec.in | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 72815f4..a5b01df 100644

Re: [libvirt] Using external ceph.conf for RBD pools and disks

2013-11-01 Thread Michael Chapman
On Fri, 1 Nov 2013, Daniel P. Berrange wrote: We have always taken the position that we do not want to rely on host configuration in this way. The goal of the XML configs is that they fully describe the functional setup of the resource in question. This is to ensure that if you put the same XML

Re: [libvirt] Using external ceph.conf for RBD pools and disks

2013-11-01 Thread Michael Chapman
On Fri, 1 Nov 2013, Eric Blake wrote: The old behavior is broken, so we can bill this as a bug fix (previously, qemu would behave differently than what the XML defined, which is not supposed to happen) rather than a backwards-incompatible change. Can you propose a patch in time for inclusion in

Re: [libvirt] [PATCH] qemu: fix well-formed migration URI formatting

2013-10-30 Thread Michael Chapman
On Tue, 29 Oct 2013, Eric Blake wrote: Apologies for the slow review time. ACK and pushed. A testsuite addition would also be nice, to prove we don't regress... Thanks! I did look into adding this to the testsuite, but as far as I can tell we don't have anything there yet that runs through

Re: [libvirt] [PATCH] qemu: fix well-formed migration URI formatting

2013-10-29 Thread Michael Chapman
On Wed, 23 Oct 2013, Michael Chapman wrote: When adding an automatically allocated port to a well-formed migration URI, keep it well-formed: tcp://1.2.3.4/ - tcp://1.2.3.4/:12345 # wrong tcp://1.2.3.4/ - tcp://1.2.3.4:12345/ # fixed tcp://1.2.3.4 - tcp://1.2.3.4:12345# still

[libvirt] [PATCH] qemu: fix well-formed migration URI formatting

2013-10-22 Thread Michael Chapman
# still works (old syntax) Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 0439ba4..cb59620 100644 --- a/src

[libvirt] [PATCH v2] Fix autostart flag when loading running domains

2011-06-12 Thread Michael Chapman
://bugzilla.redhat.com/show_bug.cgi?id=632100 https://bugzilla.redhat.com/show_bug.cgi?id=675319 v1 - v2: - free autostartLink - fixed comment Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/conf/domain_conf.c | 19 +++ 1 files changed, 11 insertions(+), 8 deletions