From 3decae00e909f8619ca835dcce50b8900d6e867f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 18 Apr 2019 14:40:27 +0200 Subject: [PATCH] qemu: Refactor/simplify qemuDomainStorageSourceAccessRevoke MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use qemuDomainStorageSourceAccessModify instead of the individual calls. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9431e4d02e..4a0f427de8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9332,18 +9332,9 @@ qemuDomainStorageSourceAccessRevoke(virQEMUDriverPtr driver, virDomainObjPtr vm, virStorageSourcePtr elem) { - if (qemuTeardownImageCgroup(vm, elem) < 0) - VIR_WARN("Failed to teardown cgroup for disk path %s", - NULLSTR(elem->path)); + qemuDomainStorageSourceAccessFlags flags = QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE; - if (qemuSecurityRestoreImageLabel(driver, vm, elem, false) < 0) - VIR_WARN("Unable to restore security label on %s", NULLSTR(elem->path)); - - if (qemuDomainNamespaceTeardownDisk(vm, elem) < 0) - VIR_WARN("Unable to remove /dev entry for %s", NULLSTR(elem->path)); - - if (virDomainLockImageDetach(driver->lockManager, vm, elem) < 0) - VIR_WARN("Unable to release lock on %s", NULLSTR(elem->path)); + ignore_value(qemuDomainStorageSourceAccessModify(driver, vm, elem, flags)); }