diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3d944d2713..daa3cb397d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -249,10 +249,6 @@ qemuSecurityChownCallback(const virStorageSource *src, int rv; g_autoptr(virStorageSource) cpy = NULL; - rv = virStorageFileSupportsSecurityDriver(src); - if (rv <= 0) - return rv; - if (virStorageSourceIsLocalStorage(src)) { /* use direct chown for local files so that the file doesn't * need to be initialized */ @@ -273,6 +269,9 @@ qemuSecurityChownCallback(const virStorageSource *src, return 0; } + if ((rv = virStorageFileSupportsSecurityDriver(src)) <= 0) + return rv; + if (!(cpy = virStorageSourceCopy(src, false))) return -1;