[libvirt] [PATCH] qemu: Fix domain resume after failed migration
by Jiri Denemark
Libvirt relies on being able to kill the destination domain and resume
the source one during migration until we called "cont" on the
destination. Unfortunately, QEMU automatically activates block devices
at the end of migration even when it's called with -S. This wasn't a big
issue in the past since the guest is not running and thus no data are
written to the block devices. However, when QEMU introduced its internal
block device locks, we can no longer resume the source domain once the
destination domain already activated the block devices (and thus
acquired all locks) unless the destination domain is killed first.
Since it's impossible to synchronize the destination and the source
libvirt daemons after a failed migration, QEMU introduced a new
migration capability called "late-block-activat" which ensures QEMU
won't activate block devices until it gets "cont". The only thing we
need to do is to enable this capability whenever QEMU supports it.
https://bugzilla.redhat.com/show_bug.cgi?id=1568407
QEMU commit implementing the capability: v2.12.0-952-g0f073f44df
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_migration_params.c | 4 ++++
src/qemu/qemu_migration_params.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index 2083563d32..63d20ff5dc 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -84,6 +84,7 @@ VIR_ENUM_IMPL(qemuMigrationCapability, QEMU_MIGRATION_CAP_LAST,
"postcopy-ram",
"compress",
"pause-before-switchover",
+ "late-block-activate",
);
@@ -129,6 +130,9 @@ struct _qemuMigrationParamsTPMapItem {
static const qemuMigrationParamsAlwaysOnItem qemuMigrationParamsAlwaysOn[] = {
{QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER,
QEMU_MIGRATION_SOURCE},
+
+ {QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE,
+ QEMU_MIGRATION_DESTINATION},
};
/* Translation from virDomainMigrateFlags to qemuMigrationCapability. */
diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h
index 9a865b19f3..bee503d0f4 100644
--- a/src/qemu/qemu_migration_params.h
+++ b/src/qemu/qemu_migration_params.h
@@ -37,6 +37,7 @@ typedef enum {
QEMU_MIGRATION_CAP_POSTCOPY,
QEMU_MIGRATION_CAP_COMPRESS,
QEMU_MIGRATION_CAP_PAUSE_BEFORE_SWITCHOVER,
+ QEMU_MIGRATION_CAP_LATE_BLOCK_ACTIVATE,
QEMU_MIGRATION_CAP_LAST
} qemuMigrationCapability;
--
2.17.1
6 years, 4 months
[libvirt] [v2 RESEND 0/3] qemu: Allow concurrent access to monitor and guest agent
by Michal Privoznik
Obsoletes:
https://www.redhat.com/archives/libvir-list/2018-June/msg01320.html
This is the same version as the one linked above, but since I've merged
my other patchset that touches the same area in the code reviewers will
get merge conflicts when applying these. Rebase & resend.
Michal Privoznik (3):
qemu: Introduce qemuDomainAgentJob
qemu: Introduce APIs for manipulating qemuDomainAgentJob
qemu: Switch code to use new agent job APIs
src/qemu/THREADS.txt | 112 +++++++++++++++++++++++++---
src/qemu/qemu_domain.c | 193 ++++++++++++++++++++++++++++++++++++++++---------
src/qemu/qemu_domain.h | 30 ++++++++
src/qemu/qemu_driver.c | 91 ++++++++++++++---------
4 files changed, 346 insertions(+), 80 deletions(-)
--
2.16.4
6 years, 4 months
[libvirt] [dbus PATCH 00/14] Introduce NodeDevice APIs
by Katerina Koukiou
Katerina Koukiou (14):
Introduce NodeDevice Interface
Implement ListNodeDevices method for Connect Interface
Register NodeDevice Lifecycle Events
Implement NodeDeviceCreateXML method for Connect Interface
Implement Destroy method for NodeDevice Interface
Implement Detach method for NodeDevice Interface
Implement Name property for NodeDevice Interface
Implement Parent property for NodeDevice Interface
Implement GetXMLDesc property for NodeDevice Interface
Implement ListCaps method for NodeDevicesInterface
Implement NodeDeviceLookupByName method for Connect Interface
Implement NodeDeviceLookupSCSIHostByWWN method for Connect Interface
Implement ReAttach method for NodeDevice Interface
Implement Reset method for NodeDevice Interface
data/Makefile.am | 1 +
data/org.libvirt.Connect.xml | 34 +++++
data/org.libvirt.NodeDevice.xml | 45 +++++++
src/Makefile.am | 1 +
src/connect.c | 148 +++++++++++++++++++++
src/connect.h | 2 +
src/events.c | 42 ++++++
src/nodedev.c | 283 ++++++++++++++++++++++++++++++++++++++++
src/nodedev.h | 9 ++
src/util.c | 35 +++++
src/util.h | 15 +++
tests/Makefile.am | 1 +
tests/libvirttest.py | 13 ++
tests/test_connect.py | 27 ++++
tests/test_nodedev.py | 52 ++++++++
tests/xmldata.py | 16 +++
16 files changed, 724 insertions(+)
create mode 100644 data/org.libvirt.NodeDevice.xml
create mode 100644 src/nodedev.c
create mode 100644 src/nodedev.h
create mode 100755 tests/test_nodedev.py
--
2.15.0
6 years, 4 months
[libvirt] [PATCH v2 0/3] Implement the HTM pSeries feature
by Andrea Bolognani
Applies cleanly on top of b1acfaaf890a16ecb2fecdbe7f121eff314dd0e9.
Changes from [v1]:
* drop qom-list-properties machinery, as equivalent functionality
has been merged in the meantime;
* don't introduce scaffolding for uniform machine option handling
as a requirement for implementing this specific feature: we can
do ad-hoc processing for now, per the status quo, then clean up
everything (including existing features) with a separate series
later.
Changes from [RFC v3]:
* can be considered for merging, since the QEMU part already has;
* fix compatibility issues with QEMU <2.12 spotted by Shivaprasad;
* drop all features except for HTM, at least for the time being;
* add documentation.
Changes from [RFC v2]:
* use qom-list-properties to probe availability;
* test all features with a single XML file.
Changes from [RFC v1]:
* don't nest features inside a <pseries/> element;
* implement all optional features.
[v1] https://www.redhat.com/archives/libvir-list/2018-March/msg00474.html
[RFC v3] https://www.redhat.com/archives/libvir-list/2018-March/msg00042.html
[RFC v2] https://www.redhat.com/archives/libvir-list/2018-February/msg00310.html
[RFC v1] https://www.redhat.com/archives/libvir-list/2018-January/msg00779.html
Andrea Bolognani (3):
qemu: Add capability for the HTM pSeries feature
qemu: Implement the HTM pSeries feature
news: Update for the HTM pSeries feature
docs/formatdomain.html.in | 8 +
docs/news.xml | 9 +
docs/schemas/domaincommon.rng | 5 +
src/conf/domain_conf.c | 19 ++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 8 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 20 ++
src/qemu/qemu_domain.c | 13 ++
.../caps_2.12.0.aarch64.replies | 48 +++--
.../caps_2.12.0.aarch64.xml | 2 +-
.../caps_2.12.0.ppc64.replies | 197 ++++++++++++++++--
.../caps_2.12.0.ppc64.xml | 3 +-
.../caps_2.12.0.s390x.replies | 52 +++--
.../caps_2.12.0.s390x.xml | 2 +-
.../caps_2.12.0.x86_64.replies | 64 +++---
.../caps_2.12.0.x86_64.xml | 2 +-
tests/qemuxml2argvdata/pseries-features.args | 3 +-
tests/qemuxml2argvdata/pseries-features.xml | 1 +
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmltest.c | 1 +
21 files changed, 383 insertions(+), 77 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] tests: Fix qemucapsfixreplies
by Andrea Bolognani
Since e6be524508d5 we include the executed command along
with the reply in *.replies files, which breaks the
renumbering logic implemented in qemucapsfixreplies.
Adapt the script so that it works with the new format.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tests/qemucapsfixreplies | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/qemucapsfixreplies b/tests/qemucapsfixreplies
index 4e3371a1f7..597f9ecd6e 100755
--- a/tests/qemucapsfixreplies
+++ b/tests/qemucapsfixreplies
@@ -8,7 +8,7 @@ if [ "$#" -ne 1 ] || [ "$1" = "--help" ] || [ ! -f "$1" ]; then
fi
awk -i inplace \
- 'BEGIN {count=1; pattern="libvirt-[0-9]+"}
+ 'BEGIN {last=0; pattern="libvirt-[0-9]+"}
{
if (match($0, "libvirt-1[^0-9]")) {
count=1;
@@ -16,7 +16,11 @@ awk -i inplace \
if (match($0, pattern)) {
str="libvirt-" count;
sub(pattern, str, $0);
- count++;
+ if (last != count) {
+ last=count;
+ } else {
+ count++;
+ }
}
print
}' "$1"
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] Add condiitonal definition for constants
by Daniel P. Berrangé
To be able to build against older libvirt, we need to conditionally
define the constants, even though they're not exposed in the public
API.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed as build fix.
connect_compat.h | 16 ++++++++++++++++
domain_compat.h | 4 ++++
2 files changed, 20 insertions(+)
diff --git a/connect_compat.h b/connect_compat.h
index cd6d678..f780e58 100644
--- a/connect_compat.h
+++ b/connect_compat.h
@@ -243,4 +243,20 @@ int virNodeGetSEVInfoCompat(virConnectPtr conn,
int *nparams,
unsigned int flags);
+#ifndef VIR_NODE_SEV_CBITPOS
+#define VIR_NODE_SEV_CBITPOS "cbitpos"
+#endif
+
+#ifndef VIR_NODE_SEV_REDUCED_PHYS_BITS
+#define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits"
+#endif
+
+#ifndef VIR_NODE_SEV_PDH
+#define VIR_NODE_SEV_PDH "pdh"
+#endif
+
+#ifndef VIR_NODE_SEV_CERT_CHAIN
+#define VIR_NODE_SEV_CERT_CHAIN "cert-chain"
+#endif
+
#endif /* LIBVIRT_GO_CONNECT_COMPAT_H__ */
diff --git a/domain_compat.h b/domain_compat.h
index 5c93ef5..345505c 100644
--- a/domain_compat.h
+++ b/domain_compat.h
@@ -1042,4 +1042,8 @@ int virDomainGetLaunchSecurityInfoCompat(virDomainPtr domain,
int *nparams,
unsigned int flags);
+#ifndef VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT
+#define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT "sev-measurement"
+#endif
+
#endif /* LIBVIRT_GO_DOMAIN_COMPAT_H__ */
--
2.17.0
6 years, 4 months
[libvirt] [dbus PATCH] README: Drop warning about lack of API/ABI guarantees
by Andrea Bolognani
We have promised not to break compatibility after v1.0.0,
which means the warning is no longer accurate and should
be dropped.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/README.md b/README.md
index 1ce265c..66aa6f6 100644
--- a/README.md
+++ b/README.md
@@ -18,9 +18,6 @@ The latest official releases can be found at:
* [https://libvirt.org/sources/dbus/](https://libvirt.org/sources/dbus/)
-NB: at this time, libvirt-dbus is *NOT* considered API/ABI stable. Future
-releases may still include API/ABI incompatible changes.
-
Dependencies / supported platforms
----------------------------------
--
2.17.1
6 years, 4 months
[libvirt] [PATCH v2 0/5] Introduce VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2018-June/msg00546.html
diff to v1:
- Rename to STATS_NOWAIT
- John's review worked in
- added comment to qemuDomainObjBeginJobNowait
Michal Privoznik (5):
qemu_domain: Document qemuDomainObjBeginJob
qemuDomainObjBeginJobInternal: Remove spurious @ret assignment
qemu_domain: Introduce qemuDomainObjBeginJobNowait
Introduce VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT
virsh: Introduce --nowait to domstats
include/libvirt/libvirt-domain.h | 2 ++
src/libvirt-domain.c | 12 ++++++++
src/qemu/qemu_domain.c | 60 +++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_domain.h | 4 +++
src/qemu/qemu_driver.c | 15 ++++++++--
tools/virsh-domain-monitor.c | 7 +++++
tools/virsh.pod | 16 +++++++----
7 files changed, 101 insertions(+), 15 deletions(-)
--
2.16.4
6 years, 4 months
[libvirt] [PATCH] tests: add test file for smartcard database
by Anya Harter
Add test case explicitly defining a smartcard host certificates
database via the following xml:
<smartcard mode='host-certificates'>
<database>/tmp/foo</database>
</smartcard>
This case is not currently covered in the test suite.
Signed-off-by: Anya Harter <aharter(a)redhat.com>
---
.../smartcard-host-certificates-database.args | 28 +++++++++++++++
.../smartcard-host-certificates-database.xml | 21 +++++++++++
tests/qemuxml2argvtest.c | 2 ++
.../smartcard-host-certificates-database.xml | 35 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
5 files changed, 87 insertions(+)
create mode 100644 tests/qemuxml2argvdata/smartcard-host-certificates-database.args
create mode 100644 tests/qemuxml2argvdata/smartcard-host-certificates-database.xml
create mode 100644 tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml
diff --git a/tests/qemuxml2argvdata/smartcard-host-certificates-database.args b/tests/qemuxml2argvdata/smartcard-host-certificates-database.args
new file mode 100644
index 0000000000..bc159f234d
--- /dev/null
+++ b/tests/qemuxml2argvdata/smartcard-host-certificates-database.args
@@ -0,0 +1,28 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot c \
+-device usb-ccid,id=ccid0,bus=usb.0,port=1 \
+-usb \
+-device ccid-card-emulated,backend=certificates,cert1=cert1,cert2=cert2,\
+cert3=cert3,db=/tmp/foo,id=smartcard0,bus=ccid0.0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/smartcard-host-certificates-database.xml b/tests/qemuxml2argvdata/smartcard-host-certificates-database.xml
new file mode 100644
index 0000000000..fa35645736
--- /dev/null
+++ b/tests/qemuxml2argvdata/smartcard-host-certificates-database.xml
@@ -0,0 +1,21 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <smartcard mode='host-certificates'>
+ <certificate>cert1</certificate>
+ <certificate>cert2</certificate>
+ <certificate>cert3</certificate>
+ <database>/tmp/foo</database>
+ </smartcard>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index f44cac9fef..194a8d2bab 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1404,6 +1404,8 @@ mymain(void)
QEMU_CAPS_CCID_EMULATED);
DO_TEST("smartcard-host-certificates",
QEMU_CAPS_CCID_EMULATED);
+ DO_TEST("smartcard-host-certificates-database",
+ QEMU_CAPS_CCID_EMULATED);
DO_TEST("smartcard-passthrough-tcp",
QEMU_CAPS_CCID_PASSTHRU);
DO_TEST("smartcard-passthrough-spicevmc",
diff --git a/tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml b/tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml
new file mode 100644
index 0000000000..55d54a4355
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/smartcard-host-certificates-database.xml
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-i686</emulator>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ccid' index='0'/>
+ <smartcard mode='host-certificates'>
+ <certificate>cert1</certificate>
+ <certificate>cert2</certificate>
+ <certificate>cert3</certificate>
+ <database>/tmp/foo</database>
+ <address type='ccid' controller='0' slot='0'/>
+ </smartcard>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index f5805c7f50..4449954ad4 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1163,6 +1163,7 @@ mymain(void)
DO_TEST("smartcard-host", NONE);
DO_TEST("smartcard-host-certificates", NONE);
+ DO_TEST("smartcard-host-certificates-database", NONE);
DO_TEST("smartcard-passthrough-tcp", NONE);
DO_TEST("smartcard-passthrough-spicevmc", NONE);
DO_TEST("smartcard-controller", NONE);
--
2.17.1
6 years, 4 months