]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
6 years agoqemu: hotplug: Fix detach of disk with managed persistent reservations
Peter Krempa [Thu, 31 May 2018 13:18:20 +0000 (15:18 +0200)]
qemu: hotplug: Fix detach of disk with managed persistent reservations

In commit 8bebb2b735d I've refactored how the detach of disk with a
managed persistent reservations object is handled. After the commit if
any disk with a managed PR object would be removed libvirt would also
attempt to remove the shared 'pr-manager-helper' object potentially used
by other disks.

Thankfully this should not have practical impact as qemu should reject
deletion of the object if it was still used and the rest of the code is
correct.

Fix this by removing the disk from the definition earlier and checking
if the shared/managed pr-manager-helper object is still needed.

This basically splits the detach code for the managed PR object from the
unmanaged ones. The same separation will follow for the attachment code
as well as it greatly simplifies -blockdev support for this.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agotestUpdateQEMUCaps: Don't leak host cpuData
Michal Privoznik [Thu, 31 May 2018 10:00:41 +0000 (12:00 +0200)]
testUpdateQEMUCaps: Don't leak host cpuData

When preparing qemuCaps for test cases the following is
happening:

qemuTestParseCapabilitiesArch() is called, which calls
virQEMUCapsLoadCache() which in turn calls
virQEMUCapsInitHostCPUModel() which sets qemuCaps->kvmCPU and
qemuCaps->tcgCPU.

But then the code tries to update the capabilities:

testCompareXMLToArgv() calls testUpdateQEMUCaps() which calls
virQEMUCapsInitHostCPUModel() again overwriting previously
allocated memory. The solution is to free host cpuData in
testUpdateQEMUCaps().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agoconf: fixup USB input bus check
Xiao Feng Ren [Thu, 31 May 2018 09:11:58 +0000 (11:11 +0200)]
conf: fixup USB input bus check

This patch fixes the USB input bus check, the bug was introduced by commit 317badb

Signed-off-by: Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoaudit: Enforce enum switch type cast in virDomainAuditHostdev
Erik Skultety [Thu, 31 May 2018 07:42:58 +0000 (09:42 +0200)]
audit: Enforce enum switch type cast in virDomainAuditHostdev

There was a missing enum for mdev causing a strange 'unknown device type'
warning when hot-plugging mdev.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1583927

Signed-off-by: Erik Skultety <eskultet@redhat.com>
6 years agoqemuxml2argvtest: Don't initialize qemuCaps twice
Michal Privoznik [Wed, 30 May 2018 15:51:59 +0000 (17:51 +0200)]
qemuxml2argvtest: Don't initialize qemuCaps twice

There's no point in calling testInitQEMUCaps() (which sets
info.qemuCaps) only to overwrite (and leak) it on the very next
line.

==12962== 296 (208 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 265 of 331
==12962==    at 0x4C2CF26: calloc (vg_replace_malloc.c:711)
==12962==    by 0x5D28D9F: virAllocVar (viralloc.c:560)
==12962==    by 0x5D96AB4: virObjectNew (virobject.c:239)
==12962==    by 0x56DB7C7: virQEMUCapsNew (qemu_capabilities.c:1480)
==12962==    by 0x112A5B: testInitQEMUCaps (qemuxml2argvtest.c:361)
==12962==    by 0x1371C8: mymain (qemuxml2argvtest.c:2871)
==12962==    by 0x13AD0B: virTestMain (testutils.c:1120)
==12962==    by 0x1372FD: main (qemuxml2argvtest.c:2883)

Removing the function call renders @gic argument unused therefore
it's removed from the macro (and all its callers).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirDomainDefParseXML: Free @tmp when parsing genid
Michal Privoznik [Wed, 30 May 2018 15:50:30 +0000 (17:50 +0200)]
virDomainDefParseXML: Free @tmp when parsing genid

We need to free return value of virXPathString().

==12962== 37 bytes in 1 blocks are definitely lost in loss record 156 of 331
==12962==    at 0x4C2AF0F: malloc (vg_replace_malloc.c:299)
==12962==    by 0x91E8439: strdup (in /lib64/libc-2.25.so)
==12962==    by 0x5DBD551: virStrdup (virstring.c:977)
==12962==    by 0x5DD3E5E: virXPathString (virxml.c:84)
==12962==    by 0x5E178AB: virDomainDefParseXML (domain_conf.c:19110)
==12962==    by 0x5E1E985: virDomainDefParseNode (domain_conf.c:20885)
==12962==    by 0x5E1E7CB: virDomainDefParse (domain_conf.c:20827)
==12962==    by 0x5E1E871: virDomainDefParseFile (domain_conf.c:20853)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: fix vsock memory leaks
Ján Tomko [Wed, 30 May 2018 13:52:18 +0000 (15:52 +0200)]
conf: fix vsock memory leaks

Introduced by:
commit d4abb7b45d48aba77c2464dbea95f02a43a60834
    conf: introduce <vsock> element
commit b8b42ca036adbfaac1741c8efe389cd1403e220b
    qemu: add support for vhost-vsock-pci

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: free migEvent in qemuMigrationCapsCheck
Ján Tomko [Wed, 30 May 2018 13:52:50 +0000 (15:52 +0200)]
qemu: free migEvent in qemuMigrationCapsCheck

We allocate a temporary bitmap but never free it.

Introduced by <commit 1f8a1a9>:
    qemu: Do not use qemuMonitorSetMigrationCapability

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agotests: initialize some variables
Ján Tomko [Mon, 28 May 2018 07:05:29 +0000 (09:05 +0200)]
tests: initialize some variables

Found by cppcheck:
[tests/metadatatest.c:284]: (error) Uninitialized variable: test
[tests/objecteventtest.c:855]: (error) Uninitialized variable: test

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
6 years agospec: Fix permissions of nwfilter XMLs
Jiri Denemark [Tue, 29 May 2018 20:30:33 +0000 (22:30 +0200)]
spec: Fix permissions of nwfilter XMLs

The nwfilter XMLs in /etc are defined as %ghost in the spec file, which
means rpm will not install them, but it will record its existence and
permissions in the database. During installation the files are copied in
a %post scriptlet from /usr/share/libvirt/nwfilter, but once libvirtd is
restarted, it will rewrite the files to add generated UUIDs.

While RPM recorded 644 mode for the XMLs, libvirt saves them with 600
and thus any future attempt to verify the libvirt-daemon-config-nwfilter
package would fail. We need to tell RPM the ghost files are supposed to
have 600 permissions.

https://bugzilla.redhat.com/show_bug.cgi?id=1559284

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
6 years agostorage: Add capability to use LUKS encryption for disk backend
John Ferlan [Mon, 21 May 2018 10:40:58 +0000 (06:40 -0400)]
storage: Add capability to use LUKS encryption for disk backend

https://bugzilla.redhat.com/show_bug.cgi?id=1560946

Similar to the the Logical backend, use qemu-img on the created
disk partition device to set up for LUKS encryption. Secret mgmt
for the device can be complicated by a reboot possibly changing
the path to the device if the infrastructure changes.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Peter Krempa <pkrempa@redhat.com>
6 years agoqemu: add support for vhost-vsock-pci
Ján Tomko [Tue, 22 May 2018 13:57:47 +0000 (15:57 +0200)]
qemu: add support for vhost-vsock-pci

Create a new vsock endpoint by opening /dev/vhost-vsock,
set the requested CID via ioctl (or assign a free one if auto='yes'),
pass the file descriptor to QEMU and build the command line.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoutil: create virvsock.c
Ján Tomko [Tue, 22 May 2018 13:52:52 +0000 (15:52 +0200)]
util: create virvsock.c

A file for vsock-related helper functions.
virVsockSetGuestCid to set an already-known CID,
virVsockAcquireGuestCid that will use the first available CID

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoIntroduce QEMU_CAPS_DEVICE_VHOST_VSOCK
Ján Tomko [Wed, 1 Nov 2017 15:13:27 +0000 (16:13 +0100)]
Introduce QEMU_CAPS_DEVICE_VHOST_VSOCK

Add a new capability flag for vhost-vsock-device

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: add private data for vsock
Ján Tomko [Fri, 18 May 2018 11:14:42 +0000 (13:14 +0200)]
qemu: add private data for vsock

Introduce a structure and a class that will be used to store
the private data.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: introduce <vsock> element
Ján Tomko [Tue, 22 May 2018 09:21:15 +0000 (11:21 +0200)]
conf: introduce <vsock> element

Add a new 'vsock' element for the vsock device.
The 'model' attribute is optional.
A <source cid> subelement should be used to specify the guest cid,
or <source auto='yes'/> should be used.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: add privateData to virDomainVsockDef
Ján Tomko [Thu, 17 May 2018 14:58:24 +0000 (16:58 +0200)]
conf: add privateData to virDomainVsockDef

An object for storing driver-specific data in the vsock definition.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoIntroduce virDomainVsockDef
Ján Tomko [Tue, 22 May 2018 08:37:50 +0000 (10:37 +0200)]
Introduce virDomainVsockDef

A type to represent the new vsock device.
Also implement an allocation function to allow future addition
of private data.

https://bugzilla.redhat.com/show_bug.cgi?id=1291851

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agostorage: Remove rwlocks during virStoragePoolObjListForEach
John Ferlan [Thu, 24 May 2018 19:38:18 +0000 (15:38 -0400)]
storage: Remove rwlocks during virStoragePoolObjListForEach

Remove the locks since they are unnecessary and would cause
a hang for a driver reload/restart when a transient pool was
previously active as a result of the call:

virStoragePoolUpdateInactive:
...
    if (!virStoragePoolObjGetConfigFile(obj)) {
        virStoragePoolObjRemove(driver->pools, obj);
...

stack trace:

Thread 17 (Thread 0x7fffcc574700 (LWP 12465)):
...pthread_rwlock_wrlock
...virRWLockWrite
...virObjectRWLockWrite
...virStoragePoolObjRemove
...virStoragePoolUpdateInactive
...storagePoolUpdateStateCallback
...virStoragePoolObjListForEachCb
...virHashForEach
...virStoragePoolObjListForEach
...storagePoolUpdateAllState
...storageStateInitialize
...virStateInitialize
...daemonRunStateInit
...virThreadHelper
...start_thread
...clone

Introduced by commit id 4b2e0ed6e3.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu: domain: Pass 'qemuCaps' to post parse callbacks when parsing status XML
Peter Krempa [Mon, 28 May 2018 09:36:47 +0000 (11:36 +0200)]
qemu: domain: Pass 'qemuCaps' to post parse callbacks when parsing status XML

When status XML was parsed the post-parse callbacks could not access
qemu caps and potentially upgrade the definition according to the
present caps. Implement the callback to pass it in.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoconf: domain: Allow passing in 'parseOpaque' for post-parse of status XML
Peter Krempa [Mon, 28 May 2018 09:36:46 +0000 (11:36 +0200)]
conf: domain: Allow passing in 'parseOpaque' for post-parse of status XML

The status XML parser function virDomainObjParseXML could not pass in
parseOpaque into the post parse callbacks. Add a callback which will
allow hypervisor drivers to fill it from the 'virDomainObj' data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoconf: domain: Invoke post-parse callbacks after parsing private XML parts
Peter Krempa [Mon, 28 May 2018 09:36:45 +0000 (11:36 +0200)]
conf: domain: Invoke post-parse callbacks after parsing private XML parts

When parsing status XML the post-parse callbacks can't access any
private data present in the status XML as the private bits were parsed
after invoking post-parse callbacks.

Move the invocation so that everything is parsed first.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
6 years agoconf: remove 'bootHash' completely
Ján Tomko [Mon, 28 May 2018 12:34:51 +0000 (14:34 +0200)]
conf: remove 'bootHash' completely

Its only use is now to check for duplicate boot order values,
which is now also done in virDomainDefPostParseCommon.

Remove it completely.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: remove 'bootHash' from the post-parse infrastructure
Peter Krempa [Mon, 28 May 2018 09:36:44 +0000 (11:36 +0200)]
conf: remove 'bootHash' from the post-parse infrastructure

As the function signature of virDomainDefPostParseInternal does not
differ from virDomainDefPostParse now, the wrapper can be dropped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoconf: introduce virDomainDefBootOrderPostParse
Ján Tomko [Mon, 28 May 2018 12:31:50 +0000 (14:31 +0200)]
conf: introduce virDomainDefBootOrderPostParse

Move the check for boot elements into a separate function
and remove its dependency on the parser-supplied bootHash table.

Reconstructing the hash table from the domain definition
effectively duplicates the check for duplicate boot order
values, also present in virDomainDeviceBootParseXML.

Now it will also be run on domains created by other means than XML
parsing, since it will be run even for code paths that did not supply
the bootHash table before.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agovmx: add VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER
Ján Tomko [Mon, 28 May 2018 13:16:16 +0000 (15:16 +0200)]
vmx: add VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER

Further patches will introduce validation and a default setting
of def->os.bootDevs in postParse.

Introduce a feature flag to opt out of this and set it in the vmx
driver, otherwise we would be adding it <boot dev='hd'/> into every
vmx config despite having no way to change it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Don't build cache= cmd line for scsi-block
Michal Privoznik [Mon, 28 May 2018 14:28:09 +0000 (16:28 +0200)]
qemu: Don't build cache= cmd line for scsi-block

Trying to set any cache for <disk device='lun'/> makes no sense.
Such disk translates into -device scsi-block on the command line
and the device lacks any cache setting because it's merely a
middle man between qemu and real SCSI device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agonews: Mention new CPU related APIs
Jiri Denemark [Wed, 16 May 2018 08:05:57 +0000 (10:05 +0200)]
news: Mention new CPU related APIs

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Implement virConnectBaselineHypervisorCPU
Jiri Denemark [Fri, 11 May 2018 11:33:19 +0000 (13:33 +0200)]
qemu: Implement virConnectBaselineHypervisorCPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agoqemu_capabilities: Introduce virQEMUCapsGetCPUFeatures
Jiri Denemark [Tue, 15 May 2018 20:03:19 +0000 (22:03 +0200)]
qemu_capabilities: Introduce virQEMUCapsGetCPUFeatures

The function creates a list of all (or migratable only) CPU features
supported by QEMU. It works by looking at the CPU model info returned by
query-cpu-model-expansion QMP command.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agocpu: Add optional list of allowed features to virCPUBaseline
Jiri Denemark [Tue, 15 May 2018 09:57:35 +0000 (11:57 +0200)]
cpu: Add optional list of allowed features to virCPUBaseline

When computing a baseline CPU for a specific hypervisor we have to make
sure to include only CPU features supported by the hypervisor. Otherwise
the computed CPU could not be used for starting a new domain.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agocpu: Update style in virCPUBaseline
Jiri Denemark [Tue, 15 May 2018 09:04:10 +0000 (11:04 +0200)]
cpu: Update style in virCPUBaseline

To make it more consistent with the rest of the CPU driver code.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agocpu: Add explicit arch parameter for virCPUBaseline
Jiri Denemark [Tue, 15 May 2018 08:59:50 +0000 (10:59 +0200)]
cpu: Add explicit arch parameter for virCPUBaseline

This is required for virCPUBaseline to accept a list of guest CPU
definitions since they do not have arch set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agocpu_x86: Add support for passing guest CPUs to virCPUx86Baseline
Jiri Denemark [Tue, 15 May 2018 09:27:20 +0000 (11:27 +0200)]
cpu_x86: Add support for passing guest CPUs to virCPUx86Baseline

Modern host CPU models from domain capabilities XMLs are reported as
guest CPU definitions with feature policies. This patch updates
virCPUx86Baseline to properly handle such CPU models.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agocpu: Rename cpuBaseline as virCPUBaseline
Jiri Denemark [Tue, 15 May 2018 08:50:32 +0000 (10:50 +0200)]
cpu: Rename cpuBaseline as virCPUBaseline

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Introduce new hypervisor-cpu-baseline command
Jiri Denemark [Mon, 7 May 2018 13:10:52 +0000 (15:10 +0200)]
virsh: Introduce new hypervisor-cpu-baseline command

This command is a virsh wrapper for virConnectBaselineHypervisorCPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoremote: Implement virConnectBaselineHypervisorCPU
Jiri Denemark [Wed, 25 Apr 2018 11:43:24 +0000 (13:43 +0200)]
remote: Implement virConnectBaselineHypervisorCPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoIntroduce virConnectBaselineHypervisorCPU public API
Jiri Denemark [Tue, 24 Apr 2018 21:33:28 +0000 (23:33 +0200)]
Introduce virConnectBaselineHypervisorCPU public API

The new API computes the most feature-rich CPU which is compatible with
all given CPUs and can be provided by the specified hypervisor. It is a
more useful version of virConnectBaselineCPU, which doesn't consider any
hypervisor capabilities when computing the best CPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agoqemu: Implement virConnectCompareHypervisorCPU
Jiri Denemark [Wed, 9 May 2018 12:06:46 +0000 (14:06 +0200)]
qemu: Implement virConnectCompareHypervisorCPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Introduce new hypervisor-cpu-compare command
Jiri Denemark [Mon, 30 Apr 2018 12:48:03 +0000 (14:48 +0200)]
virsh: Introduce new hypervisor-cpu-compare command

This command is a virsh wrapper for virConnectCompareHypervisorCPU.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agoremote: Implement virConnectCompareHypervisorCPU
Jiri Denemark [Tue, 24 Apr 2018 20:19:03 +0000 (22:19 +0200)]
remote: Implement virConnectCompareHypervisorCPU

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoIntroduce virConnectCompareHypervisorCPU public API
Jiri Denemark [Tue, 24 Apr 2018 19:31:33 +0000 (21:31 +0200)]
Introduce virConnectCompareHypervisorCPU public API

This new API compares the given CPU description with the CPU the
specified hypervisor is able to provide on the host. It is a more useful
version of virConnectCompareCPU, which compares the CPU definition with
the host CPU without considering any specific hypervisor and its
abilities.

https://bugzilla.redhat.com/show_bug.cgi?id=1559832
https://bugzilla.redhat.com/show_bug.cgi?id=1559835

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
6 years agoqemu_capabilities: Introduce virQEMUCapsCacheLookupDefault
Jiri Denemark [Mon, 7 May 2018 20:51:57 +0000 (22:51 +0200)]
qemu_capabilities: Introduce virQEMUCapsCacheLookupDefault

virConnectGetDomainCapabilities needs to lookup QEMU capabilities
matching a specified binary, architecture, virt type, and machine type
while using default values when any of the parameters are not provided
by the user. Let's extract the lookup code into
virQEMUCapsCacheLookupDefault to make it reusable.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovshExtractCPUDefXML: Accept domain capabilities XML
Jiri Denemark [Fri, 4 May 2018 21:46:55 +0000 (23:46 +0200)]
vshExtractCPUDefXML: Accept domain capabilities XML

The domain capabilities XML contains host CPU model tailored to a
specific hypervisor and since it's enclosed in <mode name='host-model'>
element rather then the required <cpu> it's impossible to directly use
the host CPU model as an input to, e.g., cpu-compare command. To make
this more convenient, vshExtractCPUDefXML now accepts full domain
capabilities XML and automatically transforms the host CPU models into
the form accepted by libvirt APIs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoImprove documentation of virConnectGetCPUModelNames
Jiri Denemark [Fri, 11 May 2018 14:24:44 +0000 (16:24 +0200)]
Improve documentation of virConnectGetCPUModelNames

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Enhance documentation of cpu-models command
Jiri Denemark [Mon, 14 May 2018 12:10:48 +0000 (14:10 +0200)]
virsh: Enhance documentation of cpu-models command

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
6 years agovirsh: Enhance documentation of cpu-compare command
Jiri Denemark [Mon, 14 May 2018 11:58:28 +0000 (13:58 +0200)]
virsh: Enhance documentation of cpu-compare command

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Kashyap Chamarthy <kchamart@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Extract common code from cmdCPU{Compare,Baseline}
Jiri Denemark [Mon, 30 Apr 2018 12:47:54 +0000 (14:47 +0200)]
virsh: Extract common code from cmdCPU{Compare,Baseline}

Both cpu-compare and cpu-baseline commands accept more that just CPU
definition XML(s). For users' convenience they are able to extract the
CPU definition(s) even from domain XML or capabilities XML. The main
differences between the two commands is in the number of CPU definitions
they expect: cpu-compare wants only one CPU definition while
cpu-baseline expects one or more CPUs.

The extracted code forms a new vshExtractCPUDefXML function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Move cpu-{baseline,compare} commands
Jiri Denemark [Thu, 26 Apr 2018 08:35:51 +0000 (10:35 +0200)]
virsh: Move cpu-{baseline,compare} commands

Similarly to cpu-models these two commands do not operate on a domain
and should be listed in the "Host and Hypervisor" commands section.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agonews: Document new API introduction
Michal Privoznik [Thu, 24 May 2018 06:55:14 +0000 (08:55 +0200)]
news: Document new API introduction

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: Implement virDomainDetachDeviceAlias
Michal Privoznik [Wed, 23 May 2018 13:09:23 +0000 (15:09 +0200)]
qemu: Implement virDomainDetachDeviceAlias

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_hotplug: Allow asynchronous detach
Michal Privoznik [Wed, 23 May 2018 16:01:16 +0000 (18:01 +0200)]
qemu_hotplug: Allow asynchronous detach

The virDomainDetachDeviceAlias API is designed so that it only
sends detach request to qemu. It's user's responsibility to wait
for DEVICE_DELETED event, not libvirt's. Add @async flag to
qemuDomainDetach*Device() functions so that caller can chose if
detach is semi-synchronous (old virDomainDetachDeviceFlags()) or
fully asynchronous (new virDomainDetachDeviceFlags()).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuDomainDetachDeviceLiveAndConfig: Avoid overwriting @ret
Michal Privoznik [Wed, 23 May 2018 13:59:55 +0000 (15:59 +0200)]
qemuDomainDetachDeviceLiveAndConfig: Avoid overwriting @ret

The fact that we are overwriting @ret multiple times makes it
difficult to see what is actually happening here. Follow our
traditional pattern where @ret is initialized to -1, and set to 0
only in case we know we succeeded.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuDomainDetachDeviceLiveAndConfig: Don't use driver->caps directly
Michal Privoznik [Wed, 23 May 2018 13:06:11 +0000 (15:06 +0200)]
qemuDomainDetachDeviceLiveAndConfig: Don't use driver->caps directly

Funny, we obtain driver caps at the beginning of the function,
but then for unknown reason access driver->caps directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu_hotplug: Use more gotos in qemuDomainDetach*Device
Michal Privoznik [Wed, 23 May 2018 16:36:57 +0000 (18:36 +0200)]
qemu_hotplug: Use more gotos in qemuDomainDetach*Device

We are overwriting @ret a lot. It makes hard to see what is
actually going on. Use more gotos. Two functions are fixed here:
qemuDomainDetachShmemDevice() and qemuDomainDetachWatchdog().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuDomainDetachWatchdog: Don't release watchdog address twice
Michal Privoznik [Wed, 23 May 2018 16:35:52 +0000 (18:35 +0200)]
qemuDomainDetachWatchdog: Don't release watchdog address twice

On watchdog unplug, when qemu doesn't support DEVICE_DELETED event
(or couple of other reasons) we do two things:

1) release watchdog device address,
2) call qemuDomainRemoveWatchdog() which does 1) again.

This is potentially dangerous.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuDomainDetachShmemDevice: Don't release shmem address twice
Michal Privoznik [Wed, 23 May 2018 16:19:16 +0000 (18:19 +0200)]
qemuDomainDetachShmemDevice: Don't release shmem address twice

On shmem unplug, when qemu doesn't support DEVICE_DELETED event
(or couple of other reasons) we do two things:

1) release shmem device address,
2) call qemuDomainRemoveShmemDevice() which does 1) again.

This is potentially dangerous.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemuDomainRemoveChrDevice: Release device address
Michal Privoznik [Wed, 23 May 2018 16:32:26 +0000 (18:32 +0200)]
qemuDomainRemoveChrDevice: Release device address

Instead of releasing address only sometimes in
qemuDomainDetachChrDevice() let's release it whenever the device
is actually removed from the domain definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agovirsh: Expose virDomainDetachDeviceAlias
Michal Privoznik [Mon, 21 May 2018 14:25:13 +0000 (16:25 +0200)]
virsh: Expose virDomainDetachDeviceAlias

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoremote: Implement virDomainDetachDeviceAlias
Michal Privoznik [Mon, 21 May 2018 11:24:23 +0000 (13:24 +0200)]
remote: Implement virDomainDetachDeviceAlias

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoIntroduce virDomainDetachDeviceAlias API
Michal Privoznik [Mon, 21 May 2018 11:15:21 +0000 (13:15 +0200)]
Introduce virDomainDetachDeviceAlias API

When detaching a device it can be uniquely identified by its
alias. Instead of misusing virDomainDetachDeviceFlags which has
the same signature introduce new function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoschema: Add missing block data for nodedev
John Ferlan [Sat, 19 May 2018 12:00:58 +0000 (08:00 -0400)]
schema: Add missing block data for nodedev

https://bugzilla.redhat.com/show_bug.cgi?id=1566416

Commit id 'fe2af45b' added output for logical_block_size and
num_blocks for both removeable and fixed storage, but did not
update the nodedev capability causing virt-xml-validate to fail.
It's listed as optional only because it only prints if the
sizes are > 0. For a CDROM drive the values won't be formatted.

Update the nodedevxml2xmltest in order to output the values
for storage based on the logic from udevProcessRemoveableMedia
and udevProcessSD with respect to the logical_blocksize and
num_blocks calculations.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema: Fix capability grammar for pagesElem
John Ferlan [Sat, 19 May 2018 11:02:47 +0000 (07:02 -0400)]
schema: Fix capability grammar for pagesElem

https://bugzilla.redhat.com/show_bug.cgi?id=1572491

Commit id '02129b7c0' added a single pagesElem for slightly
different purposes. One usage was an output for host page size
listing and the other for NUMA supported page sizes. For the
former, only the pages unit and size are formatted, while for
the latter the pages unit, size, and availability data is formatted.

The virt-xml-validate would fail because it expected something
extra in the host page size output. So split up pagesElem a bit
and create pagesHost and pagesNuma for the differences.

Modify some capabilityschemadata output to have the output - even
though the results may not be realistic with respect to the
original incarnation of the data.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema: Add microcode element to capability grammar
John Ferlan [Sat, 19 May 2018 10:47:27 +0000 (06:47 -0400)]
schema: Add microcode element to capability grammar

https://bugzilla.redhat.com/show_bug.cgi?id=1572491

Commit id 'd2440f3b5' added printing the <microcode> for the
capabilities, but didn't update the capabilities schema.

While at it, update capabilityschemadata for caps-test2
and caps-test3 to output some value for validation.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema: Add vzmigr for host migrate transport capability
John Ferlan [Fri, 18 May 2018 22:25:54 +0000 (18:25 -0400)]
schema: Add vzmigr for host migrate transport capability

Commit id '0eced74f3' added vzmigr as a valid option for
virCapabilitiesAddHostMigrateTransport, but didn't update
the capabilities schema resulting in possible virt-xml-validate
failure.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema: Add rdma for host migrate transport capability
John Ferlan [Fri, 18 May 2018 22:00:23 +0000 (18:00 -0400)]
schema: Add rdma for host migrate transport capability

https://bugzilla.redhat.com/show_bug.cgi?id=1572491

Commit id 'b3fd95e36' added rdma as a valid option for
virCapabilitiesAddHostMigrateTransport, but didn't update
the capabilities schema resulting in possible virt-xml-validate
failure.

While at it, update the capabilityschemadata for caps-qemu-kvm

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema,tests: Use vpxmigr for host migrate transport capability
John Ferlan [Fri, 18 May 2018 21:47:08 +0000 (17:47 -0400)]
schema,tests: Use vpxmigr for host migrate transport capability

Commit id 'e4938ce2f' changed the esx_driver to use 'vpxmigr'
instead of esx for virCapabilitiesAddHostMigrateTransport, so
update the capabilities to allow virt-xml-validate to pass and
update the test to use the newer name.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema: Remove xenmigr from host migrate transport capability
John Ferlan [Fri, 18 May 2018 22:05:07 +0000 (18:05 -0400)]
schema: Remove xenmigr from host migrate transport capability

Commit id '1dac5fbb' removed xenmigr as a capability option
for virCapabilitiesAddHostMigrateTransport but didn't update
the schema resulting in possible failure for virt-xml-validate.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agoschema: Add physical sizing element for storagevol grammar
John Ferlan [Fri, 18 May 2018 21:25:01 +0000 (17:25 -0400)]
schema: Add physical sizing element for storagevol grammar

https://bugzilla.redhat.com/show_bug.cgi?id=1572491

Commit id '78661cb' added a physical output, but failed to update
the schema resulting in a failure from virt-xml-validate.

While at it - update the storagevolschemadata for the output.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by Michal Privoznik <mprivozn@redhat.com>

6 years agodisk: Allow settling to occur after reading partitions
John Ferlan [Thu, 24 May 2018 15:10:57 +0000 (11:10 -0400)]
disk: Allow settling to occur after reading partitions

https://bugzilla.redhat.com/show_bug.cgi?id=1400475

In order to avoid a possible error as a result of kernel interactions
with the partition helper, let's use virWaitForDevices to force things
to settle down before attempting to open and read the partition. This
is related to https://bugzilla.redhat.com/show_bug.cgi?id=1264719.

Although perhaps overkill to have too many places to settle, since
we know that the act of reading the partitions via libvirt_parthelper
will cause udev activity/events - we just need to ensure udev has
been settled before proceding with usage of the device.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agodocs: Add news article for VM Generation ID
John Ferlan [Wed, 11 Apr 2018 20:01:54 +0000 (16:01 -0400)]
docs: Add news article for VM Generation ID

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agodomcaps: Add 'genid' to domain capabilities
John Ferlan [Fri, 27 Apr 2018 12:16:40 +0000 (08:16 -0400)]
domcaps: Add 'genid' to domain capabilities

Report domaincaps <features><genid supported='yes'/> if the guest
config accepts <genid/> or <genid>$GUID</genid>.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu: Add VM Generation ID to qemu command line
John Ferlan [Tue, 20 Mar 2018 22:29:46 +0000 (18:29 -0400)]
qemu: Add VM Generation ID to qemu command line

https://bugzilla.redhat.com/show_bug.cgi?id=1149445

If the domain requests usage of the genid functionality,
then add the QEMU '-device vmgenid' to the command line
providing either the supplied or generated GUID value.

Add tests for both a generated and supplied GUID value.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu: Alter VM Generation ID for specific startup/launch transitions
John Ferlan [Mon, 9 Apr 2018 14:31:17 +0000 (10:31 -0400)]
qemu: Alter VM Generation ID for specific startup/launch transitions

Before we generate the command line for qemu, if the domain about to
be launched desires to utilize the VM Generation ID functionality, then
handle both the regenerating the GUID value for backup recovery (restore
operation) and the startup after snapshot as both require a new GUID to
be generated to allow the guest operating system to recognize the VM
is re-executing something that has already executed before.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoqemu: Add VM Generation ID device capability
John Ferlan [Fri, 16 Mar 2018 21:23:05 +0000 (17:23 -0400)]
qemu: Add VM Generation ID device capability

Add the query of the device objects for the vmgenid device

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agoconf: Add VM Generation ID parse/format support
John Ferlan [Mon, 9 Apr 2018 16:10:02 +0000 (12:10 -0400)]
conf: Add VM Generation ID parse/format support

The VM Generation ID is a mechanism to provide a unique 128-bit,
cryptographically random, and integer value identifier known as
the GUID (Globally Unique Identifier) to the guest OS. The value
is used to help notify the guest operating system when the virtual
machine is executed with a different configuration.

This patch adds support for a new "genid" XML element similar to
the "uuid" element. The "genid" element can have two forms "<genid/>"
or "<genid>$GUID</genid>". If the $GUID is not provided, libvirt
will generate one and save it in the XML.

Since adding support for a generated GUID (or UUID like) value to
be displayed modifying the xml2xml test to include virrandommock.so
is necessary since it will generate a "known" value.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
6 years agotools: virsh: Add virshCellnoCompleter.
Roland Schulz [Fri, 25 May 2018 07:12:37 +0000 (09:12 +0200)]
tools: virsh: Add virshCellnoCompleter.

Signed-off-by: Roland Schulz <schullzroll@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agospec: Enable libssh on future RHEL
Jiri Denemark [Fri, 25 May 2018 07:45:15 +0000 (09:45 +0200)]
spec: Enable libssh on future RHEL

Future RHEL will certainly be modern enough to support libssh.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
6 years agonews: Add the event name completion
Lin Ma [Fri, 25 May 2018 05:41:12 +0000 (13:41 +0800)]
news: Add the event name completion

Signed-off-by: Lin Ma <lma@suse.com>
6 years agoqemu: domain: Use typecasted enum in qemuDomainDeviceDefPostParse
Peter Krempa [Thu, 24 May 2018 15:18:50 +0000 (17:18 +0200)]
qemu: domain: Use typecasted enum in qemuDomainDeviceDefPostParse

Rather than a lot of checks use a switch statement. This optimizes the
code as if one device is matched the rest will certainly not match.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: domain: Extract panic device def post parse code
Peter Krempa [Thu, 24 May 2018 15:01:55 +0000 (17:01 +0200)]
qemu: domain: Extract panic device def post parse code

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: domain: Extract video device def post parse code
Peter Krempa [Thu, 24 May 2018 15:01:55 +0000 (17:01 +0200)]
qemu: domain: Extract video device def post parse code

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: domain: Extract network device def post parse code
Peter Krempa [Thu, 24 May 2018 15:01:55 +0000 (17:01 +0200)]
qemu: domain: Extract network device def post parse code

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: domain: Extract disk post parse code into a function
Peter Krempa [Thu, 24 May 2018 14:55:20 +0000 (16:55 +0200)]
qemu: domain: Extract disk post parse code into a function

Later on, more stuff will be added so prevent the main function growing
out of control.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoFix indentation of virshAllocpagesPagesizeCompleter arguments.
Roland Schulz [Thu, 24 May 2018 09:04:33 +0000 (11:04 +0200)]
Fix indentation of virshAllocpagesPagesizeCompleter arguments.

Signed-off-by: Roland Schulz <schullzroll@gmail.com>
6 years agoAdd virshAllocpagesPagesizeCompleter to opts_freepages.
Roland Schulz [Thu, 24 May 2018 13:11:12 +0000 (15:11 +0200)]
Add virshAllocpagesPagesizeCompleter to opts_freepages.

Signed-off-by: Roland Schulz <schullzroll@gmail.com>
6 years agovirsh: Add event name completion to 'nodedev-event' command
Lin Ma [Wed, 23 May 2018 06:32:46 +0000 (14:32 +0800)]
virsh: Add event name completion to 'nodedev-event' command

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh-nodedev: Rename and move vshEventCallback to virshNodedevEventCallback
Lin Ma [Wed, 23 May 2018 06:32:45 +0000 (14:32 +0800)]
virsh-nodedev: Rename and move vshEventCallback to virshNodedevEventCallback

The next patch will use it in virsh-completer.c for returning the name
list of nodedev events.

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Add event name completion to 'pool-event' command
Lin Ma [Thu, 24 May 2018 13:16:26 +0000 (15:16 +0200)]
virsh: Add event name completion to 'pool-event' command

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh-pool: Rename and move vshEventCallback to virshPoolEventCallback
Lin Ma [Thu, 24 May 2018 13:19:29 +0000 (15:19 +0200)]
virsh-pool: Rename and move vshEventCallback to virshPoolEventCallback

The next patch will use it in virsh-completer.c for returning the name
list of pool events.

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Add event name completion to 'event' command
Lin Ma [Wed, 23 May 2018 06:32:42 +0000 (14:32 +0800)]
virsh: Add event name completion to 'event' command

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Move vshEventCallback structure definition to virsh-domain.h
Lin Ma [Wed, 23 May 2018 06:32:41 +0000 (14:32 +0800)]
virsh: Move vshEventCallback structure definition to virsh-domain.h

The next patch will use it in virsh-completer.c for returning the
strings of domain event name. At the same time, rename it to
avoid possible name clashing.

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh: Add event name completion to 'secret-event' command
Lin Ma [Wed, 23 May 2018 06:32:40 +0000 (14:32 +0800)]
virsh: Add event name completion to 'secret-event' command

The patch code originally authored by Michal Privoznik, Please refer to
https://www.redhat.com/archives/libvir-list/2018-May/msg01022.html

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agovirsh-secret: Rename vshEventCallback to virshSecretEventCallback
Lin Ma [Wed, 23 May 2018 06:32:39 +0000 (14:32 +0800)]
virsh-secret: Rename vshEventCallback to virshSecretEventCallback

The next patch will use it in virsh-completer.c for returning the name
list of secret events.

The patch code originally authored by Michal Privoznik, Please refer to
https://www.redhat.com/archives/libvir-list/2018-May/msg01022.html

I splitted it to 2 patches with tiny change.

Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
6 years agonews: Add TLS non-shared storage migration
Peter Krempa [Wed, 23 May 2018 14:55:50 +0000 (16:55 +0200)]
news: Add TLS non-shared storage migration

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
6 years agoqemu: monitor: Remove diskSecretLookup monitor event
Peter Krempa [Tue, 22 May 2018 13:43:28 +0000 (15:43 +0200)]
qemu: monitor: Remove diskSecretLookup monitor event

After the text monitor was deleted this event can't be triggered.
Remove it and all the unnecessary code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: monitor: Remove dead code from text monitor
Peter Krempa [Tue, 22 May 2018 12:15:36 +0000 (14:15 +0200)]
qemu: monitor: Remove dead code from text monitor

Remove all unused functions and cleanup headers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: monitor: Drop calls to text monitor impl where possible
Peter Krempa [Tue, 22 May 2018 11:51:36 +0000 (13:51 +0200)]
qemu: monitor: Drop calls to text monitor impl where possible

Drop all conditional calls which have JSON variants, now that we
guarantee JSON monitor.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: monitor: Drop JSON versions of savevm/delvm/loadvm
Peter Krempa [Tue, 22 May 2018 11:46:05 +0000 (13:46 +0200)]
qemu: monitor: Drop JSON versions of savevm/delvm/loadvm

qemu did not QAPIfy these and the design and name will most probably
change. The replacements will not be compatible. Drop the JSON stubs and
annotate that there won't be a replacement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
6 years agoqemu: monitor: Drop QEMU_CHECK_MONITOR_JSON... macros
Peter Krempa [Tue, 22 May 2018 11:23:34 +0000 (13:23 +0200)]
qemu: monitor: Drop QEMU_CHECK_MONITOR_JSON... macros

Monitor is now JSON only. Drop the old cruft.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>