libvirt/src/qemu
Michal Privoznik 25ebb45a81 qemu_tpm: Generate log file path among with storage path
When starting a guest with TPM of type='emulator' an external
process is started with it (swtpm) to emulate TPM. This external
process is passed path to a log file via --logfile. The path to
the log file is generated in qemuTPMEmulatorPrepareHost() which
works, until the daemon is restarted. The problem is that the
path is not stored in private data or anywhere inside live XML
and thus later, when qemuExtTPMStop() is called (when shutting
off the guest) the stored logpath is NULL and thus its seclabel
is not cleaned up (see virSecuritySELinuxRestoreTPMLabels()).

Fortunately, qemuExtDevicesStop() (which calls qemuExtTPMStop()
eventually) does call qemuExtDevicesInitPaths() where the log
path can be generated again.

Basically, tpm->data.emulator.storagepath is generated in
qemuExtTPMInitPaths() and its seclabels are restored properly,
and this commit move logfile onto the same level.

This means, that the log path doesn't have to be generated in
qemuExtDevicesStart() because it was already done in
qemuExtDevicesPrepareHost().

This change also renders @vmname argument of
qemuTPMEmulatorPrepareHost() unused and thus is removed.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1769196
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-03-02 09:45:49 +01:00
..
EVENTHANDLERS.txt
libvirt_qemu_probes.d
libvirtd_qemu.aug qemu: conf: Introduce "migrate_tls_force" qemu.conf option 2020-11-24 17:59:26 +01:00
meson.build build: Remove unused 'conflicts' key from virt_daemon_unit 2021-02-10 09:30:41 -07:00
MIGRATION.txt
qemu_agent.c qemuAgentSetVCPUsCommand: Refactor cleanup 2021-02-20 13:26:37 +01:00
qemu_agent.h qemu: Drop has_ccw_address from _qemuAgentDiskAddress 2021-01-04 14:53:08 +01:00
qemu_alias.c qemu_alias: introduce qemuDomainGetVhostUserAlias helper 2021-02-03 18:56:33 +01:00
qemu_alias.h qemu_alias: introduce qemuDomainGetVhostUserAlias helper 2021-02-03 18:56:33 +01:00
qemu_backup.c qemuBackupJobTerminate: Don't calculate backup job stats if VM isn't active 2021-03-01 15:44:47 +01:00
qemu_backup.h util: hash: Retire 'virHashTable' in favor of 'GHashTable' 2020-11-06 10:40:51 +01:00
qemu_block.c virJSONValueArrayAppend: Clear pointer when taking ownership of passed value 2021-02-20 13:26:37 +01:00
qemu_block.h qemu: implement vhost-user-blk support 2021-02-03 18:56:34 +01:00
qemu_blockjob.c qemu: blockjob: Use qemuMonitorBitmapRemove for single bitmap removal 2021-02-20 13:21:21 +01:00
qemu_blockjob.h
qemu_capabilities.c qemu: capabilities: Enable QEMU_CAPS_INCREMENTAL_BACKUP 2021-02-20 13:21:21 +01:00
qemu_capabilities.h qemu: capabilities: Introduce QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MAPPING 2021-02-20 13:20:32 +01:00
qemu_capspriv.h qemu: report whether a machine type is deprecated in capabilities 2021-02-03 17:30:52 +00:00
qemu_cgroup.c qemu_cgroup.c: skip absent PCI devices in qemuTeardownHostdevCgroup() 2021-03-01 12:25:33 -03:00
qemu_cgroup.h
qemu_checkpoint.c virDomainCheckpointRedefineCommit: Don't check ABI of definition in checkpoint 2020-12-04 16:15:03 +01:00
qemu_checkpoint.h qemu: rename: support renaming checkpoints directory 2020-11-13 14:49:50 +03:00
qemu_command.c virJSONValueArrayAppend: Clear pointer when taking ownership of passed value 2021-02-20 13:26:37 +01:00
qemu_command.h qemu: Do not Use canonical path for system memory 2021-02-11 08:43:14 +01:00
qemu_conf.c Replace virStringListLength by g_strv_length 2021-02-11 17:05:34 +01:00
qemu_conf.h qemu: Don't cache NUMA caps 2020-12-07 11:32:40 +01:00
qemu_dbus.c qemu: Convert 'priv->dbusVMStateIds' to a GSList 2021-02-11 17:05:32 +01:00
qemu_dbus.h qemu: Convert 'priv->dbusVMStateIds' to a GSList 2021-02-11 17:05:32 +01:00
qemu_domain_address.c qemu: Release <memory/> device address on failed hotplug 2021-02-08 20:05:08 +01:00
qemu_domain_address.h qemu: Release <memory/> device address on failed hotplug 2021-02-08 20:05:08 +01:00
qemu_domain.c qemu: domain: Store list of temporary bitmaps for migration in status XML 2021-02-20 13:21:21 +01:00
qemu_domain.h qemu: domain: Store list of temporary bitmaps for migration in status XML 2021-02-20 13:21:21 +01:00
qemu_domainjob.c qemu_domainjob: Make copy of owner API 2021-02-25 09:55:31 +01:00
qemu_domainjob.h
qemu_driver.c Use g_steal_pointer where possible 2021-03-01 15:54:42 +01:00
qemu_driver.h
qemu_extdevice.c qemu_tpm: Generate log file path among with storage path 2021-03-02 09:45:49 +01:00
qemu_extdevice.h
qemu_firmware.c virJSONValueArrayAppend: Clear pointer when taking ownership of passed value 2021-02-20 13:26:37 +01:00
qemu_firmware.h
qemu_hostdev.c hostdevmgr: remove unneeded oldStateDir 2021-02-02 00:27:58 -05:00
qemu_hostdev.h
qemu_hotplug.c qemu_hotplug: Don't dereference NULL pointer @newb in qemuDomainChangeNet() 2021-02-16 09:05:33 +01:00
qemu_hotplug.h
qemu_interface.c qemu: remove redundant code that adds "template" netdev name 2020-12-16 21:31:57 -05:00
qemu_interface.h qemu: honour fatal errors dealing with qemu slirp helper 2020-10-27 12:03:19 +00:00
qemu_interop_config.c qemuInteropFetchConfigs: Don't use 'virStringListAdd' to construct list 2021-02-11 17:05:32 +01:00
qemu_interop_config.h
qemu_migration_cookie.c virJSONValueArrayAppend: Clear pointer when taking ownership of passed value 2021-02-20 13:26:37 +01:00
qemu_migration_cookie.h qemu: migration_cookie: Add helpers for transforming the cookie into migration params 2021-02-20 13:21:21 +01:00
qemu_migration_params.c virJSONValueArrayAppend: Clear pointer when taking ownership of passed value 2021-02-20 13:26:37 +01:00
qemu_migration_params.h qemu: migration_params: Add infrastructure for 'dirty-bitmaps' migration feature 2021-02-20 13:21:21 +01:00
qemu_migration_paramspriv.h
qemu_migration.c qemu: allow migration of generic <hostdev> with <teaming> 2021-02-24 12:31:51 -05:00
qemu_migration.h
qemu_monitor_json.c Use g_steal_pointer where possible 2021-03-01 15:54:42 +01:00
qemu_monitor_json.h qemu: monitor: Introduce qemuMonitorBitmapRemove 2021-02-20 13:21:21 +01:00
qemu_monitor_priv.h
qemu_monitor_text.c
qemu_monitor_text.h
qemu_monitor.c qemu_monitor: Document qemuMonitorUnregister() 2021-02-25 10:22:10 +01:00
qemu_monitor.h qemu: monitor: Introduce qemuMonitorBitmapRemove 2021-02-20 13:21:21 +01:00
qemu_namespace.c qemu: namespace: Don't use 'virStringListAdd' inside loops 2021-02-11 17:05:32 +01:00
qemu_namespace.h qemuDomainBuildNamespace: Populate basic /dev from daemon's namespace 2020-08-03 19:40:36 +02:00
qemu_process.c qemu_domainjob: Make copy of owner API 2021-02-25 09:55:31 +01:00
qemu_process.h qemu: Prepare hostdev data which depends on the host state separately 2020-10-20 15:08:22 +02:00
qemu_processpriv.h
qemu_qapi.c Replace virStringSplit with g_strsplit 2021-02-11 17:05:34 +01:00
qemu_qapi.h util: hash: Retire 'virHashTable' in favor of 'GHashTable' 2020-11-06 10:40:51 +01:00
qemu_saveimage.c qemu: saveimage: only steal domXML on success 2021-02-18 17:14:47 +01:00
qemu_saveimage.h
qemu_security.c
qemu_security.h
qemu_shim.c qemu_shim: URI escape root directory 2021-02-12 17:59:42 +01:00
qemu_slirp.c qemu: Convert 'priv->dbusVMStateIds' to a GSList 2021-02-11 17:05:32 +01:00
qemu_slirp.h
qemu_snapshot.c qemuSnapshotFSFreeze: Don't return -2 2021-02-16 12:25:30 +01:00
qemu_snapshot.h qemu: snapshot: Introduce helpers for creating overlays on <transient/> disks 2020-10-01 09:55:02 +02:00
qemu_tpm.c qemu_tpm: Generate log file path among with storage path 2021-03-02 09:45:49 +01:00
qemu_tpm.h
qemu_validate.c qemu_validate: Allow kvm hint-dedicated on non-passthrough VMs 2021-02-19 11:11:12 +01:00
qemu_validate.h virDomainDefValidate: Add per-run 'opaque' data 2020-12-09 09:33:47 +01:00
qemu_vhost_user_gpu.c
qemu_vhost_user_gpu.h Use G_GNUC_WARN_UNUSED_RESULT instead of ATTRIBUTE_RETURN_CHECK 2019-10-15 11:25:22 +02:00
qemu_vhost_user.c Replace virStringListLength by g_strv_length 2021-02-11 17:05:34 +01:00
qemu_vhost_user.h
qemu_virtiofs.c
qemu_virtiofs.h
qemu.conf qemu: conf: Introduce "migrate_tls_force" qemu.conf option 2020-11-24 17:59:26 +01:00
test_libvirtd_qemu.aug.in qemu: conf: Introduce "migrate_tls_force" qemu.conf option 2020-11-24 17:59:26 +01:00
THREADS.txt
virtqemud.init.in
virtqemud.service.in
virtqemud.sysconf qemu: Allow audio driver override in virtqemud 2020-04-03 11:50:57 +02:00