[libvirt] [PATCH v2 2/2] qemuDomainUndefineFlags: Forbid undefine of active domain with NVRAM

Michal Privoznik mprivozn at redhat.com
Wed Aug 9 13:20:16 UTC 2017


On 08/09/2017 03:02 PM, Daniel P. Berrange wrote:
> On Wed, Aug 09, 2017 at 02:55:36PM +0200, Michal Privoznik wrote:
>> On 08/09/2017 02:14 PM, Daniel P. Berrange wrote:
>>> On Wed, Aug 09, 2017 at 02:00:06PM +0200, Michal Privoznik wrote:
>>>> https://bugzilla.redhat.com/show_bug.cgi?id=1467245
>>>>
>>>> Currently, there's a bug when undefining a domain with NVRAM
>>>> store. Basically, the unlink() of the NVRAM store file happens
>>>> during the undefine procedure iff domain is inactive. So, if
>>>> domain is running and undefine is called the file is left behind.
>>>> It won't be removed in the domain cleanup process either
>>>> (qemuProcessStop). To avoid this forbid undefining domain with
>>>> NVRAM file.
>>>
>>> Why do we need to forbid it ? Even if QEMU still has an open
>>> file handle, it can continue to write to it after we unlink
>>> it.
>>>
>>>
>>
>> That's what my v1 does. Anyway, there's third option: just recently
>> Jirka added possibility to do some actions when domain is destroyed. He
>> needed it for some migration work, but the design is broad enough to fit
>> this problem too. What we can do is:
>>
>> if (flags & VIR_DOMAIN_UNDEFINE_NVRAM):
>>   if domain is running:
>>     register the callback /* that merely just unlinks the file */
>>   else:
>>     unlink
>> else:
>>   if (!(flags & VIR_DOMAIN_UNDEFINE_KEEP_NVRAM)):
>>     error
>>
>>
>> What do you guys think of this one?
> 
> The callback will be lost if libvirtd restarts.

Ah, good point. In that case all I need is an ACK to v1 then ;-)

Michal




More information about the libvir-list mailing list