Commit Graph

44898 Commits

Author SHA1 Message Date
Michal Privoznik
89e3386670 qemu: Use virDomainObjCheckActive() more
Using the following spatch, I've identified two places which
could be switched from explicit virDomainObjIsActive() +
virReportError() to virDomainObjCheckActive():

  @@
  expression dom;
  @@
      if (
  -        !virDomainObjIsActive(dom)
  +        virDomainObjCheckActive(dom) < 0
      ) {
  -        virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("domain is not running"));
          ...
      }

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-21 15:25:32 +01:00
Hyman Huang(黄勇)
42d36b65a3 qemu_driver: Add calc_mode for dirtyrate statistics
Add calc_mode for dirtyrate statistics retured by
virsh domstats --dirtyrate api, also add vcpu dirtyrate
if dirty-ring mode was used in last measurement.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:16 +01:00
Hyman Huang(黄勇)
72e60ddf1b virsh: Add mode option to domdirtyrate-calc virsh api
Extend domdirtyrate-calc virsh api with mode option, either
of these three options "page-sampling,dirty-bitmap,dirty-ring"
can be specified when calculating dirty page rate.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:16 +01:00
Hyman Huang(黄勇)
b4b1ec6f73 qemu_driver: Extend flags parameter of virDomainStartDirtyRateCalc
Extend flags parameter of virDomainStartDirtyRateCalc as a
superset of virDomainDirtyRateCalcFlags, parse the flags and
handle it correspondingly in qemuDomainStartDirtyRateCalc.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:16 +01:00
Hyman Huang(黄勇)
de4a066bfd qemu_driver: Add mode parameter to qemuDomainStartDirtyRateCalc
Add mode parameter to qemuDomainStartDirtyRateCalc API, 'mode'
option of 'calc-dirty-rate' command was introduced since
qemu >= 6.2.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:16 +01:00
Hyman Huang(黄勇)
e7a8bd2173 include: Introduce virDomainDirtyRateCalcFlags
Introduce virDomainDirtyRateCalcFlags to get ready for
adding mode parameter to qemuDomainStartDirtyRateCalc.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:16 +01:00
Hyman Huang(黄勇)
f8dc72f0ca qemu_capabilities: Introduce QEMU_CAPS_DIRTYRATE_MODE capability
mode option of calc-dirty-rate command since qemu >=6.2.0.
Introduce QEMU_CAPS_DIRTYRATE_MODE capability definition.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:16 +01:00
Hyman Huang(黄勇)
f78b804b46 qemu_driver: Probe capability before calculating dirty page rate
Probing QEMU_CAPS_CALC_DIRTY_RATE capability in advance
in case of failure when calculating dirty page rate.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:34:04 +01:00
Hyman Huang(黄勇)
b207f84901 qemu_capabilities: Introduce QEMU_CAPS_CALC_DIRTY_RATE capability
calc-dirty-rate command was introduced since qemu >=5.2.0.
Introduce QEMU_CAPS_CALC_DIRTY_RATE capability definition.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-02-21 13:24:50 +01:00
Jim Fehlig
454b927d1e libxl: Fix libvirtd crash on domain restore
Commit cc2a3c2a94 missed one case in the libxl driver where virDomainDef
is returned from libxlDomainSaveImageOpen and a g_steal_pointer is needed.
Without it, the virDomainDef object is freed and the driver crashes later
in the restore process when accessing the object.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-18 11:20:21 -07:00
Peter Krempa
d2bc5a04c0 virsh-domain: Move and rename cmdStartGetFDs to virshFetchPassFdsList
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-17 15:53:58 +01:00
Peter Krempa
b0015df263 cmdStartGetFDs: Modernize
Calculate the length of the FD list beforehand to avoid multiple
expansions and mainly simplify the code and use automatic freeing to
remove the error code path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-17 15:53:58 +01:00
Peter Krempa
c98432784a virsystemdtest: remove unused 'demo_socket_path'
Commit b56a833243 removed bunch of old code after which
'demo_socket_path' in 'testActivationFDNames' is no longer used

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-02-17 14:17:04 +01:00
Daniel P. Berrangé
b56a833243 util: drop support for obsolete systemd in RHEL-7
The systemd version in RHEL-7 lacked support for the LISTEN_FDNAMES env
variable with socket activation. Since we stopped targetting RHEL-7 we
can drop some considerable amount of compatibility code.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-02-17 12:35:42 +00:00
Peter Krempa
1c71e06619 virDomainCreate(XML)WithFiles: Add check for VIR_DRV_FEATURE_FD_PASSING
All APIs using FD passing have this check to prevent sending a
'VIR_NET_CALL_WITH_FDS' to an older daemon but
virDomainCreateXMLWithFiles was missing it.

Now the LXC driver was historically not exposing
VIR_DRV_FEATURE_FD_PASSING, but that is not a problem as LXC always goes
through the remote driver which intercepts it and injects
VIR_DRV_FEATURE_FD_PASSING when it was implemented.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
ef476708f3 virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_FD_PASSING
The feature implies that fd passing works with RPC. Non-remote impls
thus should always report support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
5c95340100 virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_NETWORK_UPDATE_HAS_CORRECT_ORDER
The fix was on RPC level so everything should advertise it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
963ac787c4 virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_TYPED_PARAM_STRING
This was a lockout to make strings in typed parameters compatible with
versions which didn't have them. Now all drivers need to expose this
capability.

This namely enables it for 'esx' and 'vz' drivers, while they don't seem
to be implementing any parameters for now, they might later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
0a6335cd22 virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_REMOTE_(CLOSE|EVENT)_CALLBACK
They are features of the RPC; drivers must say that it's not supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
d56f6360b6 virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_PROGRAM_KEEPALIVE
keepalive is a RPC feature, drivers must say that it's not supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
c7f2d0e7b1 virDriverFeatureIsGlobal: Handle VIR_DRV_FEATURE_REMOTE
VIR_DRV_FEATURE_REMOTE is a special flag which is asserted only when the
connection is remote. All drivers implementing it must return 0 for it
to work. Handle it in the global handler and add a comment why.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Peter Krempa
f24a22315b driver: Introduce global driver feature flag handling function
The 'virDrvFeature' has a combination of features which are asserted by
the specific driver and features which are actually global.

In many cases the implementation was cargo-culted into newer drivers
without re-assesing whether it makes sense.

This patch introduces a global function which will specifically handle
these global flags and defer the rest to the driver.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-17 13:15:46 +01:00
Jiri Denemark
f3c2b321e0 qemu: Fix crash at the end of migration
The destination daemon would crash in Finish phase due to NULL
dereference which I missed in my review of commit
v8.0.0-428-g0301db44e2

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-17 10:17:19 +01:00
Nikolay Shirokovskiy
096e3c72ec qemu: fix excluding disk from internal inactive snapshot
'qemuDomainSnapshotForEachQcow2Raw' doesn't properly handle the
'VIR_DOMAIN_SNAPSHOT_LOCATION_NONE' setting and thus doesn't skip disks
which were excluded from the snapshot due to being read-only.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-02-16 16:28:20 +03:00
Göran Uddeborg
540df80d99 Translated using Weblate (Swedish)
Currently translated at 32.8% (3434 of 10455 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-02-16 10:10:19 +01:00
Piotr Drąg
34c43dedac Translated using Weblate (Polish)
Currently translated at 22.4% (2345 of 10455 strings)

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

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2022-02-16 10:10:19 +01:00
Michal Privoznik
4b6240adc2 openrc: Make init scripts executable on install
When installing openrc init scripts, we take whatever mode the
generated files are in an copy them under /etc/init.d/. This is
not ideal, because those files are not executable and they should
be.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/250
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-02-16 10:09:39 +01:00
Michal Privoznik
5cba53db57 tests: Drop domcaps test data for qemu < 2.11
The minimal supported version of QEMU is 2.11. And after capabilities
for older QEMUs were dropped in v7.3.0-17-g184de10c1d we have some
domaincapsdata/ files that are never read. This is because
domaincapstest uses testQemuCapsIterate() which iterates over
qemucapabilitiesdata/caps_*.xml files.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-02-15 16:33:45 +01:00
Kristina Hanicova
65312001bd libxl: use virDomainJobData instead of virDomainJobInfo
This transition will make it easier for me to generalize jobs in
the future as they will always use virDomainJobData and
virDomainJobInfo will be only used in the public api..

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-02-15 12:20:45 +01:00
Kristina Hanicova
0301db44e2 qemu: make separate function for setting statsType of privateData
We only need to set statsType in almost every case of setting
something from private data, so it seems unnecessary to pull
privateData out of current / completed job for just this one
thing every time. I think this patch keeps the code cleaner
without variables used just once.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-02-15 12:20:45 +01:00
Kristina Hanicova
f304de0df6 qemu: use generalized virDomainJobData instead of qemuDomainJobInfo
This patch includes:
* introducing new files: src/hypervisor/domain_job.c and src/hypervisor/domain_job.h
* new struct virDomainJobData, which is almost the same as
  qemuDomainJobInfo - the only differences are moving qemu specific
  job stats into the qemuDomainJobDataPrivate and adding jobType
  (possibly more attributes in the future if needed).
* moving qemuDomainJobStatus to the domain_job.h and renaming it
  as virDomainJobStatus
* moving and renaming qemuDomainJobStatusToType
* adding callback struct virDomainJobDataPrivateDataCallbacks
  taking care of allocation, copying and freeing of private data
  of virDomainJobData
* adding functions for virDomainJobDataPrivateDataCallbacks for
  qemu hypervisor
* adding 'public' (public between the different hypervisors) functions
  taking care of init, copy, free of virDomainJobData
* renaming every occurrence of qemuDomainJobInfo *info to
  virDomainJobData *data

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-02-15 12:20:45 +01:00
Peter Krempa
79c4e4e5c4 ci: Regenerate with new lcitool
Regenerate with lcitool as of:

  commit f83b916d5efa4bd33fbf4b7ea41bf6d535cc63fb
  Author: Alex Bennée <alex.bennee@linaro.org>
  Date:   Fri Feb 11 09:39:30 2022 +0000

      mappings: skip multipath-tools for cross Debian

      This package is both a mix of library files, headers and native
      binaries so cannot be installed in a cross environment. For now skip
      it for cross targets.

      See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005323

      Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-02-15 09:33:03 +01:00
Peter Krempa
9a21d6848c ci: Move from 'centos-8' to 'almalinux-8'
Upstream lcitool suggests that as a solution to 'centos-8' being
removed.

Move also the website and other jobs to depend on
'x86_64-almalinux-8-container'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-02-15 09:33:03 +01:00
Peter Krempa
eca3daaf5b ci: Regenerate with new lcitool
Re-generate our CI infra with 'lcitool' as of:

  commit b346752e98bd12395233ebba8c9312e08212b639 (HEAD)
  Author: Erik Skultety <eskultet@redhat.com>
  Date:   Tue Feb 1 10:48:53 2022 +0100

      tests: Replace CentOS 8 with AlmaLinux 8 in test scenarios

      Switch the test target before actually dropping CentOS 8.

      Signed-off-by: Erik Skultety <eskultet@redhat.com>

This is prior to upstream lcitool dropping 'centos-8' support to
minimize the differences.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-02-15 09:33:03 +01:00
Peter Krempa
874b00f750 qemuhotplugtest: Assume QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE
All modern QEMU versions use FD passing for listening unix sockets so
the test should reflect this. This will later help when removing the
legacy code paths when we drop support for old QEMUs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:32:23 +01:00
Peter Krempa
5b5162072c qemuhotplugmock: Mock fd passing to qemu via 'SCM_RIGHTS'
We don't want to be dealing with real FDs thus we mock
'qemuMonitorIOWriteWithFD' to do the same thing as when no FD is being
passed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:32:23 +01:00
Peter Krempa
654486bd57 syntax-check: sc_avoid_write: Don't use blanket file exceptions
Adding an exception for the whole file usually defeats the purpose of a
syntax check and is also likely to get forgotten once the file is
removed.

In case of the suggestion of using 'safewrite' instead of write even the
comment for safewrite states that the function needs to be used only in
certain cases.

Remove the blanket exceptions for files and use an exclude string
instead. The only instance where we keep the full file exception is for
src/libvirt-stream.c as there are multiple uses in example code in
comments where I couldn't find a nicer targetted wapproach.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:32:23 +01:00
Peter Krempa
7c35c483ea qemu: monitor: Move declaration of struct _qemuMonitor to qemu_monitor_priv.h
In order to mock the SCM_RIGHTS sendmsg to simulate sending
filedescriptors to fake qemu in tests we need access to some fields of
'struct _qemuMonitor'. Move its declaration to the private header file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:32:23 +01:00
Peter Krempa
f9ae469a6e qemu: Make 'struct _qemuMonitorMessage' private
Move the declaration of the struct into 'qemu_monitor_priv.h' as other
code has no business in peeking into the monitor messages.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:32:23 +01:00
Peter Krempa
c5eb99a9d9 qemu: monitor: Drop old monitor fields from 'struct _qemuMonitorMessage'
The fields are no longer used since we've deleted support for HMP-only
qemus. The HMP command pass-through works via a QMP command.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:32:23 +01:00
Peter Krempa
c82887a323 qemuxml2argvtest: Add newer variant of 'launch-security-sev-missing-platform-info'
Upcoming patches will remove support for qemu-2.12. Since tests of
'sev' use hacked data we need to use our capability dump of qemu-6.0 as
it has the required fields.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:30:40 +01:00
Peter Krempa
4392617724 qemuxml2argvtest: Bump versioned test variants for pre-blockdev disk tests to 4.1.0
Originally when I started working on '-blockdev' support I added version
locked variants of all the relevant disk tests locked to qemu-2.12, but
blockdev was finally enabled with qemu-4.2.

This patch bumps the rest of the test cases with no functional changes
related to disks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:29:39 +01:00
Peter Krempa
94f8c8873f qemuxml2argvtest: Update disk test cases having 'device_id' argument of SCSI disk
The 'device_id' property was added in qemu-4.0. Since upcoming patch
will be modernizing all disk test cases we specifically want to preserve
the instance of 'device_id' not being used with qemu-3.1 and earlier.

Change the 'disk-cache' and 'disk-shared' cases to have a qemu-3.1 and a
qemu-4.1 version for testing pre-'device_id' and pre-blockdev scenarios.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:29:17 +01:00
Peter Krempa
2fd1262bf1 qemuxml2argvtest: Add pre-blockdev post-werror-move version of 'disk-error-policy'
Starting with qemu-3.0 release we use the 'werror' and 'rerror'
properties with the frontend (device) rather than the storage backend
(with a minor caveat of s390, where we use it earlier as it doesn't
 support USB disks, and other disk types supported it earlier).

Add specific test cases after the change, but before '-blockdev' was
enabled.

This is done separately from the changes in the next commit which simply
moves all other disk tests to the last pre-blockdev qemu as we have a
semantic change happening after 2.12.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:28:57 +01:00
Peter Krempa
a572a285ab qemu: command: Inline qemuBuildDiskFrontendAttributeErrorPolicy
Commit dc481f11a6 which converted the function generating properties
for disk '-device' argument to JSON removed the only other use of
qemuBuildDiskFrontendAttributeErrorPolicy, so we can now inline it into
qemuBuildDriveStr.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-15 09:28:57 +01:00
Peter Krempa
f923620031 qemuBuildTPMCommandLine: Use 'qemuPassFD' infrastructure
Remove the last code path using hardcoded fdsets.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-14 13:14:00 +01:00
Peter Krempa
4225de7c73 qemuBuildTPMOpenBackendFDs: Construct 'cancel_path' internally
Since 'cancel_path' is constructed from the 'tpmdev' argument, we can
push it down into the function opening the FDs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-14 13:14:00 +01:00
Peter Krempa
d42be77208 virTPMCreateCancelPath: Refactor value returning
Automatically free 'path' inside the loop which fills it and return the
values directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-14 13:14:00 +01:00
Peter Krempa
ad81aa8ad0 qemu: Honour 'virtlogd' use when hotplugging chardevs
Setup the chardev similarly to how we do it on startup so that virtlogd
is properly used with chardevs which are hotplugged to a VM.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-14 13:14:00 +01:00
Peter Krempa
d86bfa631e qemu: process: Add a hotplug version of qemuProcessPrepareHostBackendChardev
When hotplugging a chardev we need the same form of setup for the
character device. Export a version which takes a 'virDomainDeviceDef'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-02-14 13:14:00 +01:00