libvirt/src/qemu
Daniel P. Berrange f26701f565 Fix race condition reconnecting to vms & loading configs
The following sequence

 1. Define a persistent QMEU guest
 2. Start the QEMU guest
 3. Stop libvirtd
 4. Kill the QEMU process
 5. Start libvirtd
 6. List persistent guests

At the last step, the previously running persistent guest
will be missing. This is because of a race condition in the
QEMU driver startup code. It does

 1. Load all VM state files
 2. Spawn thread to reconnect to each VM
 3. Load all VM config files

Only at the end of step 3, does the 'virDomainObjPtr' get
marked as "persistent". There is therefore a window where
the thread reconnecting to the VM will remove the persistent
VM from the list.

The easy fix is to simply switch the order of steps 2 & 3.

In addition to this though, we must only attempt to reconnect
to a VM which had a non-zero PID loaded from its state file.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-10-30 11:16:18 +00:00
..
libvirtd_qemu.aug qemu: Fix augeas support for migration ports 2013-10-18 18:30:13 +02:00
MIGRATION.txt qemu: Implement migration job phases 2011-07-27 08:45:09 -06:00
qemu_agent.c qemu_agent: Remove obvious comments 2013-07-31 14:25:43 +02:00
qemu_agent.h qemu_agent: Move updater function for VCPU hotplug into qemu_agent.c 2013-07-31 14:25:43 +02:00
qemu_bridge_filter.c maint: avoid 'const fooPtr' in qemu 2013-10-14 14:34:38 -06:00
qemu_bridge_filter.h maint: avoid 'const fooPtr' in qemu 2013-10-14 14:34:38 -06:00
qemu_capabilities.c qemu_migration: Avoid crashing if domain dies too quickly 2013-10-11 14:55:51 +02:00
qemu_capabilities.h qemu_capabilities: Introduce virQEMUCapsInitQMPMonitor 2013-10-01 10:48:47 +02:00
qemu_cgroup.c qemu: cgroup: Fix crash if starting nographics guest 2013-10-01 11:22:18 -04:00
qemu_cgroup.h Auto-detect existing cgroup placement 2013-07-23 22:46:31 +01:00
qemu_command.c Make virCommand env handling robust in setuid env 2013-10-21 14:03:52 +01:00
qemu_command.h qemu: Avoid assigning unavailable migration ports 2013-10-18 16:34:09 +02:00
qemu_conf.c capabilities: add baselabel per sec driver/virt type to secmodel 2013-10-29 07:06:04 -06:00
qemu_conf.h qemu: Make migration port range configurable 2013-10-18 16:35:38 +02:00
qemu_domain.c qemuDomainCleanupRemove: s/memmove/VIR_DELETE_ELEMENT_INPLACE/ 2013-10-17 15:24:05 +02:00
qemu_domain.h qemu: Avoid assigning unavailable migration ports 2013-10-18 16:34:09 +02:00
qemu_driver.c Fix race condition reconnecting to vms & loading configs 2013-10-30 11:16:18 +00:00
qemu_driver.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
qemu_hostdev.c qemu: simplify calling qemuDomainHostdevNetConfigRestore 2013-10-21 18:06:30 +03:00
qemu_hostdev.h qemu: Prefer VFIO for PCI device passthrough 2013-10-10 12:00:56 +02:00
qemu_hotplug.c qemu: fix removal of <interface type='hostdev'> 2013-10-21 18:09:04 +03:00
qemu_hotplug.h qemu: Move qemuDomainDetachDeviceDiskLive to qemu_hotplug.c 2013-08-26 16:09:54 +02:00
qemu_hotplugpriv.h qemu: Let tests override waiting time for device unplug 2013-08-26 16:09:55 +02:00
qemu_migration.c qemu: fix well-formed migration URI formatting 2013-10-29 08:49:42 -06:00
qemu_migration.h qemu: Implement support for VIR_MIGRATE_PARAM_LISTEN_ADDRESS 2013-10-11 11:08:55 +02:00
qemu_monitor_json.c maint: avoid 'const fooPtr' in qemu 2013-10-14 14:34:38 -06:00
qemu_monitor_json.h Remove ATTRIBUTE_NONNULL(3) from qemuMonitorJSONDrivePivot 2013-10-17 19:36:42 -04:00
qemu_monitor_text.c Convert 'int i' to 'size_t i' in src/qemu files 2013-07-10 17:55:15 +01:00
qemu_monitor_text.h qemu: Use bool instead of int in qemuMonitorSetCPU APIs 2013-06-07 15:57:03 +02:00
qemu_monitor.c qemu_migration: Avoid crashing if domain dies too quickly 2013-10-11 14:55:51 +02:00
qemu_monitor.h qemu: monitor: Add infrastructure to access VM logs for better err msgs 2013-09-25 13:50:56 +02:00
qemu_process.c Fix race condition reconnecting to vms & loading configs 2013-10-30 11:16:18 +00:00
qemu_process.h qemu_process: Make qemuProcessReadLog() more versatile and reusable 2013-09-25 13:50:56 +02:00
qemu_processpriv.h qemu: Export qemuProcessHandleDeviceDeleted for tests 2013-08-26 16:09:55 +02:00
qemu.conf qemu: Make migration port range configurable 2013-10-18 16:35:38 +02:00
test_libvirtd_qemu.aug.in qemu: Fix augeas support for migration ports 2013-10-18 18:30:13 +02:00
THREADS.txt Remove qemuDriverLock from almost everywhere 2013-02-13 11:10:30 +00:00