From: Michal Privoznik Date: Wed, 17 Jun 2020 09:01:05 +0000 (+0200) Subject: qemu: Use qemuSecurityDomainSetPathLabel() to set seclabes on not saved state files X-Git-Tag: v6.5.0-rc1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c6257942425c36e6f6d96629d334fb09a94da28;p=thirdparty%2Flibvirt.git qemu: Use qemuSecurityDomainSetPathLabel() to set seclabes on not saved state files There are two places within qemu driver that misuse qemuSecuritySetSavedStateLabel() to set seclabels on tempfiles that are not state files: qemuDomainScreenshot() and qemuDomainMemoryPeek(). They are doing so because of lack of qemuSecurityDomainSetPathLabel() at the time of their introduction. In all three secdrivers (well, four if you count NOP driver) the implementation of .domainSetSavedStateLabel and .domainSetPathLabel callbacks is the same anyway. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0424f0785f..20444eb157 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4064,7 +4064,7 @@ qemuDomainScreenshot(virDomainPtr dom, } unlink_tmp = true; - qemuSecuritySetSavedStateLabel(driver, vm, tmp); + qemuSecurityDomainSetPathLabel(driver, vm, tmp, false); qemuDomainObjEnterMonitor(driver, vm); if (qemuMonitorScreendump(priv->mon, videoAlias, screen, tmp) < 0) { @@ -11671,7 +11671,7 @@ qemuDomainMemoryPeek(virDomainPtr dom, goto endjob; } - qemuSecuritySetSavedStateLabel(driver, vm, tmp); + qemuSecurityDomainSetPathLabel(driver, vm, tmp, false); priv = vm->privateData; qemuDomainObjEnterMonitor(driver, vm);