Re: [PATCH] qemuProcessStop: Reattach NVMe disks a domain is mirroring into

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 06, 2020 at 14:41:36 +0200, Michal Privoznik wrote:
> In v5.10.0-rc1~42 (which was later fixed in v6.0.0-rc1~487) I am
> removing XATTRs for a file that QEMU is mirroring a disk into but
> it is killed meanwhile. Well, if we call
> qemuDomainStorageSourceAccessRevoke() instead of
> qemuBlockRemoveImageMetadata() then not only the file will have
> perms fixed (instead of left accessible to qemu) but if the
> mirror destination is not a file but a NVMe disk, then the disk
> will be reattached back to the host.
> 
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1825785
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/qemu/qemu_process.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 8ea470f75f..70c71e069c 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -7605,7 +7605,7 @@ void qemuProcessStop(virQEMUDriverPtr driver,
>              virDomainDiskDefPtr disk = def->disks[i];
>  
>              if (disk->mirror)
> -                qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->mirror);
> +                qemuDomainStorageSourceAccessRevoke(driver, vm, disk->mirror);

IMO this function is not designed to be called after the VM is dead.

Specifically this would try to tear down cgroup access which was removed
previously and would try to set memory locking limits using 'prlimit'
with -1 'pid'.

image locks are also lifted because of the qemu process has already
exitted.





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux