]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
3 years agoch_process: Handle enabled console devices
William Douglas [Wed, 8 Sep 2021 18:01:20 +0000 (11:01 -0700)] 
ch_process: Handle enabled console devices

Add functionality to allow libvirt console to connect to the
cloud-hypervisor created PTY associated with a VM by updating the
domain with console path information. This has to be run after the VM
is created by cloud-hypervisor.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Add pty json builder function
William Douglas [Wed, 8 Sep 2021 18:01:19 +0000 (11:01 -0700)] 
ch_monitor: Add pty json builder function

Add function to build the the json structure to configure a PTY in
cloud-hypervisor.

The devices themselves still aren't allowed in configurations yet
though.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Make virCHMonitorGet function static
William Douglas [Wed, 8 Sep 2021 18:01:16 +0000 (11:01 -0700)] 
ch_monitor: Make virCHMonitorGet function static

The virCHMonitorGet function isn't going to be used outside of the
monitor, so remove the initial declaration and define the function
to be static.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Use virCHMonitorGet to access cloud-hypervisor API
William Douglas [Wed, 8 Sep 2021 18:01:18 +0000 (11:01 -0700)] 
ch_monitor: Use virCHMonitorGet to access cloud-hypervisor API

Now that virCHMonitorGet is capable of handling data returned by the
cloud-hypervisor API, make use of this via virCHMonitorGetInfo to call
into the vm.info endpoint.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_monitor: Update virCHMonitorGet to handle accept a response
William Douglas [Wed, 8 Sep 2021 18:01:17 +0000 (11:01 -0700)] 
ch_monitor: Update virCHMonitorGet to handle accept a response

The virCHMonitorGet function needed to be able to return data from the
hypervisor. This functionality is needed in order for the driver to
support PTY enablement and getting details about the VM state.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agoch_domain: Add virChrdevs for console support
William Douglas [Wed, 8 Sep 2021 18:01:15 +0000 (11:01 -0700)] 
ch_domain: Add virChrdevs for console support

Add and initialize a virChrdevs to the _virCHDomainObjPrivate
structure in order to eventually track the consoles in use by a domain.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: William Douglas <william.douglas@intel.com>
3 years agovirstoragetest: Reinstate testing of images without 'backing_fmt'
Peter Krempa [Wed, 8 Sep 2021 15:57:30 +0000 (17:57 +0200)] 
virstoragetest: Reinstate testing of images without 'backing_fmt'

There are important security implications when we'd misprobe those
images. This commit reinstates the tests removed by commit 979d1ba3ae13
since 'qemu-img' refused to format them.

With the new testing approach with stored images we won't run into that
problem.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Remove pointless goto from mymain
Peter Krempa [Thu, 9 Sep 2021 07:53:30 +0000 (09:53 +0200)] 
virstoragetest: Remove pointless goto from mymain

Improve the error message and abort the test. Continuing here is not
desired as without chdiring into the appropriate directory the test
would fail anyways and worse could attempt stat-ing random files on the
host.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Don't skip the whole test when qemu-img fails to format images
Peter Krempa [Wed, 8 Sep 2021 15:28:51 +0000 (17:28 +0200)] 
virstoragetest: Don't skip the whole test when qemu-img fails to format images

We have plenty of other work to do in this test. Skip only the real
image testing case when we can't find qemu-img or it failed to format
the image.

This allows us to also remove the last global variable in the test and
move the creation and cleanup of the images closer to the actual test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: testStorageChain: Skip test if filename is NULL
Peter Krempa [Wed, 8 Sep 2021 12:10:51 +0000 (14:10 +0200)] 
virstoragetest: testStorageChain: Skip test if filename is NULL

Prepare the test runner for skipping individual tests if images can't be
formatted rather than the whole virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: testPrepImages: Use 'qemu-img' to format 'raw' image
Peter Krempa [Wed, 8 Sep 2021 15:14:29 +0000 (17:14 +0200)] 
virstoragetest: testPrepImages: Use 'qemu-img' to format 'raw' image

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: testPrepImages: Don't reuse 'cmd' pointer
Peter Krempa [Wed, 8 Sep 2021 15:13:04 +0000 (17:13 +0200)] 
virstoragetest: testPrepImages: Don't reuse 'cmd' pointer

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Assume that 'qemu-img' supports '-o compat='
Peter Krempa [Wed, 8 Sep 2021 15:11:00 +0000 (17:11 +0200)] 
virstoragetest: Assume that 'qemu-img' supports '-o compat='

All supported qemu versions have the parameter, so we don't need to
check. This allows us to simplify the code used for formating real
images for virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Don't rewrite the 'qcow2' image
Peter Krempa [Wed, 8 Sep 2021 15:07:31 +0000 (17:07 +0200)] 
virstoragetest: Don't rewrite the 'qcow2' image

Create it with the appropriate backing file path rather than using
another instance of 'qemu-img rebase'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Stop rewriting images in 'mymain'
Peter Krempa [Wed, 8 Sep 2021 14:49:03 +0000 (16:49 +0200)] 
virstoragetest: Stop rewriting images in 'mymain'

For testing of real images formatted by 'qemu-img' it's now sufficient
to format them once without the need to rewrtie them since we use the
real images only for testing of one scenario.

This allows us to also remove most of the global variables holding the
path to the images which was necessary when they were being rewritten.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Unify testing of QCOW2 images with absolute backing
Peter Krempa [Wed, 8 Sep 2021 14:44:13 +0000 (16:44 +0200)] 
virstoragetest: Unify testing of QCOW2 images with absolute backing

We have 3 test cases for this currently:

1) "qcow2->raw"
 1.1) VIR_STORAGE_FILE_QCOW2 as top level format
 1.2) VIR_STORAGE_FILE_AUTO as top level format
2) "wrap->qcow2->raw" whith just VIR_STORAGE_FILE_QCOW2

This patch adds also testing of VIR_STORAGE_FILE_AUTO for case 2) and
removes both 1) subcases as they are being actually tested as part of
2).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use preformatted qcow2 image for testing relative paths
Peter Krempa [Wed, 8 Sep 2021 12:08:47 +0000 (14:08 +0200)] 
virstoragetest: Use preformatted qcow2 image for testing relative paths

More preparation for eliminating image rewriting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Convert symlink and relative image testing use preformatted images
Peter Krempa [Wed, 8 Sep 2021 14:30:52 +0000 (16:30 +0200)] 
virstoragetest: Convert symlink and relative image testing use preformatted images

Use prepared test images instead to simplify and clarify the code
instead of rewriting existing images multiple times.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use existing file for testing 'raw' image lookup
Peter Krempa [Wed, 8 Sep 2021 12:01:42 +0000 (14:01 +0200)] 
virstoragetest: Use existing file for testing 'raw' image lookup

We've already added a 'raw' file to the example image directory so we
can use that instead of formatting one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use preformatted file for testing missing backing store
Peter Krempa [Wed, 8 Sep 2021 07:18:03 +0000 (09:18 +0200)] 
virstoragetest: Use preformatted file for testing missing backing store

Similarly to previous ones, this one doesn't need to be created by
qemu-img in order for the test to make sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use pre-formatted file for non-path extraction test
Peter Krempa [Wed, 8 Sep 2021 07:11:54 +0000 (09:11 +0200)] 
virstoragetest: Use pre-formatted file for non-path extraction test

This one doesn't require using qemu-img either.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use a pre-formatted QED file for testing backing store extraction
Peter Krempa [Wed, 8 Sep 2021 07:06:08 +0000 (09:06 +0200)] 
virstoragetest: Use a pre-formatted QED file for testing backing store extraction

The QED format isn't really being developed any more. Use a
pre-formatted image to test the existing code. In this instance we
switch to using a relative backing path for simplicity.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Use existing directory in the source tree for 'directory' probing...
Peter Krempa [Wed, 8 Sep 2021 07:03:06 +0000 (09:03 +0200)] 
virstoragetest: Use existing directory in the source tree for 'directory' probing tests

We don't need a special directory for the tests. Reuse the directory
holding the data for the virstoragetest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Test backing chain loops with hardcoded images
Peter Krempa [Mon, 6 Sep 2021 14:56:19 +0000 (16:56 +0200)] 
virstoragetest: Test backing chain loops with hardcoded images

Provide the images for the self and mutual backing image loop cases in
the repository rather than formatting them with qemu-img.

This makes the code more readable and also decouples the backing chain
tests from each other.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Rework TEST_LOOKUP* cases to work on fake backing chain
Peter Krempa [Tue, 7 Sep 2021 16:58:32 +0000 (18:58 +0200)] 
virstoragetest: Rework TEST_LOOKUP* cases to work on fake backing chain

Rather than using 'qemu-img' and rewriting the chain we can use fake
data and few empty files to ensure the same level of coverage. This is
possible since we've already tested that the metadata parsing from files
works properly and the only thing we are testing here is that the
symlink resolution works properly.

Additionally after the refactor of 'virstoragetest' is complete
additional tests on real data will be added.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Remove redundant arguments for chain lookup tests
Peter Krempa [Tue, 7 Sep 2021 15:32:22 +0000 (17:32 +0200)] 
virstoragetest: Remove redundant arguments for chain lookup tests

Passing in both "chain*" and "chain*->path" is pointless. Use only the
full struct which we can use to infer the rest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Store output of TEST_CHAIN in output files
Peter Krempa [Mon, 6 Sep 2021 12:13:29 +0000 (14:13 +0200)] 
virstoragetest: Store output of TEST_CHAIN in output files

The TEST_CHAIN cases were storing the expected output (or rather data
to generate the expected output) in code. This made the code really hard
to follow and even harder to modify to add new cases.

This patch modifies the code to store the expected output in text files
(using the same generator as we've used to) and uses
'virTestCompareToFile' to check the outputs.

The result is that the code is way simpler and doesn't require fiddling
with 'testFileData' structs when adding new cases. Additionally this
removes mixing of code and declaration so we can stop disabling the
warning for this file.

Another advantage is that the tests are now named so it's easier to
figure out if one of them breaks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotestutils: Introduce helper for stripping bulilddir/srcdir from test outputs
Peter Krempa [Tue, 7 Sep 2021 13:31:42 +0000 (15:31 +0200)] 
testutils: Introduce helper for stripping bulilddir/srcdir from test outputs

In certain cases we want to be able to compare test output containing
real paths against a static output file and thus we need a helper which
strips srcdir/builddir from given path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Drop testing of NBD backends via parsing real images
Peter Krempa [Mon, 6 Sep 2021 11:35:09 +0000 (13:35 +0200)] 
virstoragetest: Drop testing of NBD backends via parsing real images

We now have specific tests for the backing store parser and previous
tests cover the extraction of the backing store string so there's no
need for these particular tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirstoragetest: Drop testing of RBD backends via parsing real images
Peter Krempa [Mon, 6 Sep 2021 11:35:09 +0000 (13:35 +0200)] 
virstoragetest: Drop testing of RBD backends via parsing real images

We now have specific tests for the backing store parser and previous
tests cover the extraction of the backing store string so there's no
need for these particular tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: Display vhostuser socket path in domblklist
dinglimin [Fri, 3 Sep 2021 08:54:53 +0000 (16:54 +0800)] 
virsh: Display vhostuser socket path in domblklist

The domblklist command is designed to show a brief information
about the blocks of a domain. One piece of information that is
shows is "Target "and "Source". Before the modification, the
Vhost disk of SPDK is displayed as "-". After the modification,
the socket associated with it can be displayed.

Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuxml2argvtest: Add test case for missing disk '<target>'
Peter Krempa [Tue, 7 Sep 2021 07:28:51 +0000 (09:28 +0200)] 
qemuxml2argvtest: Add test case for missing disk '<target>'

Cover the case of missing disk target to cover the case fixed by
previous commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirDomainDiskDefValidate: Move validation of disk target
Peter Krempa [Tue, 7 Sep 2021 08:01:39 +0000 (10:01 +0200)] 
virDomainDiskDefValidate: Move validation of disk target

The disk target is mandatory and used as a designator in error messages
of other validation steps, so we must validate it first.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is NULL
Peter Krempa [Tue, 7 Sep 2021 07:22:42 +0000 (09:22 +0200)] 
conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is NULL

The code rejecting a XML when the disk target is missing was moved to
the validation code which goes after post parse. One of the cases in the
disk post parse code didn't check whether 'disk->dst' is set which at
that point isn't guaranteed.

Fixes: 61fd7174c2afbe128ef1896198919429bcaca3d7
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2001627
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: validate: Run global device definition validation before callbacks
Peter Krempa [Tue, 7 Sep 2021 08:55:06 +0000 (10:55 +0200)] 
conf: validate: Run global device definition validation before callbacks

The validation infrastructure doesn't modify the definition and
additionally it makes sense to run the global code first as it's
validating certain corner cases.

The changed error messages from qemuxml2argvtest show that this is
indeed the proper ordering as all changed messages are actually better
describing the error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: validate: Move qemu-specific LUN disk validation to global validation
Peter Krempa [Tue, 7 Sep 2021 12:01:26 +0000 (14:01 +0200)] 
conf: validate: Move qemu-specific LUN disk validation to global validation

LUN disks are supported only by VMX and QEMU drivers and the VMX
implementation is a subset of qemu's implementation, thus we can move
the qemu-specific validator to the global validation code providing that
we allow the format to be 'none' (qemu driver always sets 'raw' if it's
not set) and allow disk type 'volume' as a source (qemu always
translates the source, and VMX doesn't implement 'volume' at all).

Moving the code to the global validation allows us to stop calling it
from the qemu specific validation and also deduplicates the checks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuDomainDefValidateDiskLunSource: Unbreak error messages
Peter Krempa [Tue, 7 Sep 2021 09:15:45 +0000 (11:15 +0200)] 
qemuDomainDefValidateDiskLunSource: Unbreak error messages

Simplify looking for the error messages.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agolibxl: use g_auto in libxlDomainGetEmulatorType
Ján Tomko [Sun, 5 Sep 2021 19:25:07 +0000 (21:25 +0200)] 
libxl: use g_auto in libxlDomainGetEmulatorType

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agolibxl: use g_auto in libxlCapsNodeData
Ján Tomko [Sun, 5 Sep 2021 19:22:51 +0000 (21:22 +0200)] 
libxl: use g_auto in libxlCapsNodeData

Also remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agolibxl: refactor libxlCapsInitCPU
Ján Tomko [Sun, 5 Sep 2021 19:08:24 +0000 (21:08 +0200)] 
libxl: refactor libxlCapsInitCPU

Use g_auto, g_steal_pointer and remove unnecessary labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agolibxl: capsInitCPU: fail if we can't initialize host features
Ján Tomko [Sun, 5 Sep 2021 18:59:27 +0000 (20:59 +0200)] 
libxl: capsInitCPU: fail if we can't initialize host features

Introduced by:
  commit 17322e551861a5bc4dd464a7c5399204dc8c7caa
      libxl: describe host cpu features based on hwcaps
with the justification that libxl_hwcaps does not have a stable
format across all version.

Even though the code would return '0' in the case of such failure,
it frees the 'cpu' pointer, while keeping it in caps->host.
Based on that, assume it does not happen in current usage.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agolibxl: remove enum libxlHwcapVersion
Ján Tomko [Sun, 5 Sep 2021 18:56:01 +0000 (20:56 +0200)] 
libxl: remove enum libxlHwcapVersion

As well as the code probing for the version in libxlCapsInitHost.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agolibxl: capabilities: assume Xen version >= 4.7
Ján Tomko [Sun, 5 Sep 2021 18:48:26 +0000 (20:48 +0200)] 
libxl: capabilities: assume Xen version >= 4.7

Remove the code handling old Xen's hwcap words,
as well as the comment describing it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
3 years agoRevert "meson: avoid bogus warnings from clang and g_autoptr"
Ján Tomko [Fri, 3 Sep 2021 14:39:36 +0000 (16:39 +0200)] 
Revert "meson: avoid bogus warnings from clang and g_autoptr"

Commit 345996c6208b281233074362a8d81295e2e711d4 disabled the
-Wunused-but-set-variable warning on CLang, beacuse it warned
on variables that were unread, but we relied on the side effects
of their destructors.

Reinstate the warning now that all the occurrences have been fixed.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agorpc: mark source returned by virEventGLibAddSocketWatch as unused
Ján Tomko [Fri, 3 Sep 2021 14:36:54 +0000 (16:36 +0200)] 
rpc: mark source returned by virEventGLibAddSocketWatch as unused

Two users of virEventGLibAddSocketWatch care about the GSource
it returns.

The other three free it by assigning it to an autofreed variable.

Mark them with G_GNUC_UNUSED to make this obvious to the reader
and the compiler.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: virIdentitySetCurrent: only unref the old identity on success
Ján Tomko [Fri, 3 Sep 2021 14:04:44 +0000 (16:04 +0200)] 
util: virIdentitySetCurrent: only unref the old identity on success

In the unlikely case that we were unable to set the new
identity, we would unref the old one even though it still
could be in the thread-local storage.

Fixes: c6825d88137cb8e4debdf4310e45ee23cb5698c0
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: remove unused 'cfg' variables
Ján Tomko [Fri, 3 Sep 2021 14:00:17 +0000 (16:00 +0200)] 
qemu: remove unused 'cfg' variables

Unused as of:
  commit effeee5c2fcec19fcaad627690a6a0ba0025e35f
      qemu: driver: Use 'qemuDomainSaveStatus' for saving status XML

This function extracts the config from the vm object, so the caller
no longer needs to do it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirnetsockettest: refactor checkProtocols
Ján Tomko [Sat, 4 Sep 2021 18:45:33 +0000 (20:45 +0200)] 
virnetsockettest: refactor checkProtocols

Reduce variable scope, use g_auto and remove pointless labels.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: reduce variable scope in testSELinuxCheckLabels
Ján Tomko [Fri, 3 Sep 2021 19:16:41 +0000 (21:16 +0200)] 
tests: reduce variable scope in testSELinuxCheckLabels

And use g_auto.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: esxutils: reduce variable scope in testConvertWindows1252ToUTF8
Ján Tomko [Fri, 3 Sep 2021 18:17:09 +0000 (20:17 +0200)] 
tests: esxutils: reduce variable scope in testConvertWindows1252ToUTF8

Also use g_auto.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: esxutils: reduce variable scope in testEscapeDatastoreItem
Ján Tomko [Fri, 3 Sep 2021 18:16:15 +0000 (20:16 +0200)] 
tests: esxutils: reduce variable scope in testEscapeDatastoreItem

Also use g_auto.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: esxutils: refactor testParseDatastorePath
Ján Tomko [Fri, 3 Sep 2021 18:15:46 +0000 (20:15 +0200)] 
tests: esxutils: refactor testParseDatastorePath

Reduce variable scope to match their lifetime,
use g_auto and remove now pointless labels in favor
of direct returns.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agosecretxml2xmltest: refactor testCompareXMLToXMLFiles
Ján Tomko [Sat, 4 Sep 2021 18:34:55 +0000 (20:34 +0200)] 
secretxml2xmltest: refactor testCompareXMLToXMLFiles

Use g_auto where possible and remove the pointless label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agotests: bhyve: use bitwise shift when defining flags
Ján Tomko [Tue, 24 Nov 2020 14:25:27 +0000 (15:25 +0100)] 
tests: bhyve: use bitwise shift when defining flags

Although I'm sure we all know the powers of two by heart now,
this is the prevalent style for flag defition.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agotests: bhyve: remove magic constants
Ján Tomko [Tue, 24 Nov 2020 14:24:26 +0000 (15:24 +0100)] 
tests: bhyve: remove magic constants

Refer to flags by their identifier, not value.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agovirsh: add support for '--validate' option in create nwfilter-binding
Kristina Hanicova [Thu, 26 Aug 2021 12:32:35 +0000 (14:32 +0200)] 
virsh: add support for '--validate' option in create nwfilter-binding

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agonwfilter_driver: allow VIR_NWFILTER_BINDING_CREATE_VALIDATE flag
Kristina Hanicova [Thu, 26 Aug 2021 12:32:34 +0000 (14:32 +0200)] 
nwfilter_driver: allow VIR_NWFILTER_BINDING_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: virnwfilterbindingdef: add validation against schema in create
Kristina Hanicova [Thu, 26 Aug 2021 12:32:33 +0000 (14:32 +0200)] 
conf: virnwfilterbindingdef: add validation against schema in create

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virNWFilterBindingDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoapi: add virNWFilterBindingCreateFlags
Kristina Hanicova [Thu, 26 Aug 2021 12:32:32 +0000 (14:32 +0200)] 
api: add virNWFilterBindingCreateFlags

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agovirsh: add support for '--validate' option in create network port
Kristina Hanicova [Thu, 26 Aug 2021 12:23:57 +0000 (14:23 +0200)] 
virsh: add support for '--validate' option in create network port

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agobridge_driver: allow VIR_NETWORK_PORT_CREATE_VALIDATE flag
Kristina Hanicova [Thu, 26 Aug 2021 12:23:56 +0000 (14:23 +0200)] 
bridge_driver: allow VIR_NETWORK_PORT_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoconf: virnetworkportdef: add validation against schema in network port create
Kristina Hanicova [Thu, 26 Aug 2021 12:23:55 +0000 (14:23 +0200)] 
conf: virnetworkportdef: add validation against schema in network port create

We need to validate the XML against schema if option '--validate'
was passed to the virsh command. This patch also includes
propagation of flags into the virNetworkPortDefParse().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoapi: add VIR_NETWORK_PORT_CREATE_VALIDATE flag
Kristina Hanicova [Thu, 26 Aug 2021 12:23:54 +0000 (14:23 +0200)] 
api: add VIR_NETWORK_PORT_CREATE_VALIDATE flag

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu_driver: Don't check for g_strdup_printf() retval
Michal Privoznik [Mon, 6 Sep 2021 12:00:41 +0000 (14:00 +0200)] 
qemu_driver: Don't check for g_strdup_printf() retval

The g_strdup_printf() function can't fail really. There's no need
to check for its return value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemu_driver.c: Fix file mode
Michal Privoznik [Mon, 6 Sep 2021 11:44:17 +0000 (13:44 +0200)] 
qemu_driver.c: Fix file mode

In the previous commit I accidentally changed the mode of
qemu_driver.c file. Restore the original mode.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemu: fix iothread residual when qemuProcessSetupIOThread failed
Lei Yang [Mon, 30 Aug 2021 08:02:50 +0000 (16:02 +0800)] 
qemu: fix iothread residual when qemuProcessSetupIOThread failed

In process of iothread hotplug, qemuDomainHotplugAddIOThread() calls
qemuProcessSetupIOThread(). When qemuProcessSetupIOThread() returned
a failure, only the cgroup directory 'iothread' was cleaned up within
the function. Right after that qemuDomainHotplugAddIOThread() would
return failure directly without rolling back the livedef and iothread
process that created previously.

Further, when 'virsh schedinfo domain --live' requires schedinfo of
such machine, the interface will always return a failure print as
follows: 'Failed to create v1 controller cpu for group: No such file
or directory'. The reason is qemuGetIOThreadsBWLive() using member
vm->def->iothreadids[0]->iothread_id to findout the corresponding
cgroup dircetory. In case mentioned previously, iothreadids[0] was not
been cleaned up while whose cgroup directroy has already been removed.

This patch rolls back the livedef and iothread process after
qemuProcessSetupIOThread() returned a failure. Of course we are not
limited to this function, we also perform the same rolling back after
any exception proecss in qemuDomainHotplugAddIOThread().

Signed-off-by: Lei Yang <yanglei209@huawei.com>
Signed-off-by: Wang Xin <wangxinxin.wang@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoqemuValidateDomainDeviceDefDiskTransient: Validate that qemu doesn't terminate early
Masayoshi Mizuma [Mon, 30 Aug 2021 04:30:43 +0000 (00:30 -0400)] 
qemuValidateDomainDeviceDefDiskTransient: Validate that qemu doesn't terminate early

Setup of a disk with <transient shareBacking='yes'/> option issues a
reset of qemu. In cases when QEMU didn't yet support the 'set-action'
QMP libvirt would in certain cases setup the commandline without
'-no-shutdown' which caused qemu to exit during startup. Forbid this
specific scenario.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: process: Split out logic for setting the 'allowReboot' internal flag
Masayoshi Mizuma [Mon, 30 Aug 2021 04:30:42 +0000 (00:30 -0400)] 
qemu: process: Split out logic for setting the 'allowReboot' internal flag

Split out the logic which was used to determine whether qemu should
allow the guest OS to reboot for QEMU versions which don't support the
'set-action' QMP command.

Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Fri, 3 Sep 2021 17:08:41 +0000 (19:08 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.7% (4943 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Fri, 3 Sep 2021 17:08:41 +0000 (19:08 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.7% (4943 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:16 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.3% (4900 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 47.3% (4900 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Tue, 31 Aug 2021 12:42:15 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.3% (4900 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 47.3% (4897 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:15 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 47.3% (4897 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Tue, 31 Aug 2021 12:42:14 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.9% (4865 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:12 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.5% (4820 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 46.4% (4809 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 46.3% (4795 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 46.3% (4794 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Tue, 31 Aug 2021 12:42:11 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.1% (4781 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 31 Aug 2021 12:42:10 +0000 (14:42 +0200)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10353 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/uk/

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
3 years agoUpdate translation files
Weblate [Tue, 31 Aug 2021 12:42:08 +0000 (14:42 +0200)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:04 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.0% (4770 of 10353 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 46.0% (4766 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 46.0% (4765 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 46.0% (4763 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Korean)
jason lee [Tue, 31 Aug 2021 12:42:03 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 46.0% (4763 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 45.5% (4719 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: jason lee <ppark5237@gmail.com>
Signed-off-by: jason lee <ppark5237@gmail.com>
3 years agoTranslated using Weblate (Sinhala)
Hela Basa [Tue, 31 Aug 2021 12:42:02 +0000 (14:42 +0200)] 
Translated using Weblate (Sinhala)

Currently translated at 0.1% (2 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/si/

Co-authored-by: Hela Basa <r45xveza@pm.me>
Signed-off-by: Hela Basa <r45xveza@pm.me>
3 years agoTranslated using Weblate (Finnish)
Jan Kuparinen [Tue, 31 Aug 2021 12:42:01 +0000 (14:42 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.6% (2344 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/fi/

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
3 years agoTranslated using Weblate (Korean)
simmon [Tue, 31 Aug 2021 12:42:01 +0000 (14:42 +0200)] 
Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 45.3% (4689 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 45.2% (4681 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Translated using Weblate (Korean)

Currently translated at 45.2% (4681 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/ko/

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoTranslated using Weblate (Finnish)
Ricky Tigg [Tue, 31 Aug 2021 12:41:59 +0000 (14:41 +0200)] 
Translated using Weblate (Finnish)

Currently translated at 22.5% (2338 of 10349 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/fi/

Co-authored-by: Ricky Tigg <ricky.tigg@gmail.com>
Signed-off-by: Ricky Tigg <ricky.tigg@gmail.com>
3 years agomeson: avoid bogus warnings from clang and g_autoptr
Daniel P. Berrangé [Tue, 31 Aug 2021 14:05:15 +0000 (15:05 +0100)] 
meson: avoid bogus warnings from clang and g_autoptr

Clang has previously had trouble with G_DEFINE_AUTOPTR_CLEANUP_FUNC
generated code, thinking it was unused. We turn off -Wunused-function
to avoid tripping up on that with CLang.

New Clang has started having trouble with g_autoptr now too. In usage
scenarios where the variable is set, but never again read, it thinks
it is unused not realizing the destructor has useful side effects.
For this we have to skip -Wunused-but-set-variable on CLang.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoPost-release version bump to 7.8.0
Jiri Denemark [Wed, 1 Sep 2021 11:46:34 +0000 (13:46 +0200)] 
Post-release version bump to 7.8.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoRelease of libvirt-7.7.0 v7.7.0
Jiri Denemark [Wed, 1 Sep 2021 11:44:53 +0000 (13:44 +0200)] 
Release of libvirt-7.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agonews: add FC VMID entry
Pavel Hrdina [Tue, 31 Aug 2021 12:53:17 +0000 (14:53 +0200)] 
news: add FC VMID entry

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agotests: virstoragetest: remove tests without backing type
Ján Tomko [Tue, 31 Aug 2021 09:41:55 +0000 (11:41 +0200)] 
tests: virstoragetest: remove tests without backing type

As of qemu commit:

  commit 497a30dbb065937d67f6c43af6dd78492e1d6f6d
    qemu-img: Require -F with -b backing image

creating images with backing images requires specifying the format.

Remove tests which do not pass the backing format on the command
line.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agorpm: fix typo in post transaction scriptlet name
Daniel P. Berrangé [Tue, 31 Aug 2021 10:55:13 +0000 (11:55 +0100)] 
rpm: fix typo in post transaction scriptlet name

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu, xen: add missing deps on virtlockd/virtlogd sockets
Daniel P. Berrangé [Tue, 31 Aug 2021 09:59:39 +0000 (10:59 +0100)] 
qemu, xen: add missing deps on virtlockd/virtlogd sockets

The QEMU driver uses both virtlogd and virtlockd, while the Xen driver
uses virtlockd. The libvirtd.service unit contains deps on the socket
units for these services, but these deps were missed in the modular
daemons. As a result the virtlockd/virtlogd sockets are not started
when the virtqemud/virtxend daemons are started.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoNEWS: Update with description of changes to lifecycle action handling v7.7.0-rc2
Peter Krempa [Wed, 25 Aug 2021 09:50:08 +0000 (11:50 +0200)] 
NEWS: Update with description of changes to lifecycle action handling

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Mention bug with incorrect format recorded for qcow2+luks overlays
Peter Krempa [Wed, 25 Aug 2021 09:50:07 +0000 (11:50 +0200)] 
NEWS: Mention bug with incorrect format recorded for qcow2+luks overlays

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Move my contributions to correct release
Michal Privoznik [Fri, 27 Aug 2021 14:36:15 +0000 (16:36 +0200)] 
NEWS: Move my contributions to correct release

In previous commit I've documented my contributions for upcoming
7.7.0 release. But unfortunately I've placed the lines into wrong
release (7.6.0).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Document my contributions for the upcoming release
Michal Privoznik [Thu, 26 Aug 2021 15:44:56 +0000 (17:44 +0200)] 
NEWS: Document my contributions for the upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Mention new SecurityManager APIs for labeling network devices
Jim Fehlig [Thu, 26 Aug 2021 22:53:36 +0000 (16:53 -0600)] 
NEWS: Mention new SecurityManager APIs for labeling network devices

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Document new '--validate' option for virsh define commands
Kristina Hanicova [Thu, 26 Aug 2021 16:03:40 +0000 (18:03 +0200)] 
NEWS: Document new '--validate' option for virsh define commands

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemu: Set label on vhostuser net device when hotplugging
Jim Fehlig [Wed, 28 Jul 2021 00:13:36 +0000 (18:13 -0600)] 
qemu: Set label on vhostuser net device when hotplugging

Attaching a newly created vhostuser port to a VM fails due to an
apparmor denial

internal error: unable to execute QEMU command 'chardev-add': Failed
to bind socket to /run/openvswitch/vhu838c4d29-c9: Permission denied

In the case of a net device type VIR_DOMAIN_NET_TYPE_VHOSTUSER, the
underlying chardev is not labeled in qemuDomainAttachNetDevice prior
to calling qemuMonitorAttachCharDev.

A simple fix would be to call qemuSecuritySetChardevLabel using the
embedded virDomainChrSourceDef in the virDomainNetDef vhostuser data,
but this incurs the risk of incorrectly restoring the label. E.g.
consider the DAC driver behavior with a vhostuser net device, which
uses a socket for the chardev backend. The DAC driver uses XATTRS to
store original labelling information, but XATTRS are not compatible
with sockets. Without the original labelling information, the socket
labels will be restored with root ownership, preventing other
less-privileged processes from connecting to the socket.

This patch avoids overloading chardev labelling with vhostuser net
devices by introducing virSecurityManager{Set,Restore}NetdevLabel,
which is currently only implemented for the apparmor driver. The
new APIs are then used to set and restore labels for the vhostuser
net devices.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agosrc: fix generation of default resource partition
Pavel Hrdina [Wed, 25 Aug 2021 11:01:52 +0000 (13:01 +0200)] 
src: fix generation of default resource partition

Now that resource structure can have appid as well we need to adapt code
that creates default resource partition if not provided by user.
Otherwise starting a VM with appid defined would fail with following
error:

    error: unsupported configuration: Resource partition '(null)' must start with '/'

Fixes: 38b5f4faabccf681439d99e5394954c6ef7a5a40
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodocs: formatdomain: fix typo
Ján Tomko [Thu, 26 Aug 2021 14:28:52 +0000 (16:28 +0200)] 
docs: formatdomain: fix typo

combiatnion -> combination

Fixes: 4ffc807214cb80086d57e1d3e7b60959a41d2874
Signed-off-by: Ján Tomko <jtomko@redhat.com>