]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: fix EFI nvram removal on domain undefine
authorPavel Mores <pmores@redhat.com>
Tue, 15 Oct 2019 08:31:22 +0000 (10:31 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 15 Oct 2019 11:39:54 +0000 (13:39 +0200)
commitb5308a12054255c80232f0c79c0b439994be2da0
treeae8702b43072cf32d12913b25642b4208ec52f75
parenta4f979c06e878fbbf7690070540dec9cd8661717
qemu: fix EFI nvram removal on domain undefine

When undefining a UEFI domain its nvram file has to be properly handled as
well.  It's mandatory to use one of --nvram and --keep-nvram options when
'virsh undefine <domain>' is issued for a UEFI domain.  To fix the bug as
reported, virsh should return an error message if neither option is used
and the nvram file should be removed when --nvram is given.

The cause of the problem is that when qemuDomainUndefineFlags() is invoked
on an inactive domain the path to its nvram file is empty.  This commit
aims to fix this by formatting and filling in the path in time for the
nvram removal code to run properly.

https://bugzilla.redhat.com/show_bug.cgi?id=1751596

Signed-off-by: Pavel Mores <pmores@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h
src/qemu/qemu_driver.c