[libvirt] [PATCH 2/2] qemuProcessStop: Simulate blockjob --abort on destroy

Michal Privoznik mprivozn at redhat.com
Tue Nov 19 12:54:25 UTC 2019

On 11/19/19 10:31 AM, Peter Krempa wrote:
> On Tue, Nov 19, 2019 at 10:14:09 +0100, Michal Privoznik wrote:
> In subject, please remove 'Simulate blockjob --abort' and replace it
> e.g. with: 'remove image metadata for running mirror jobs' or something
> similar, because this patch does not really do anything with the job
> itself.
>> If user starts a blockcommit without --pivot then we modify
>> access for qemu on both images and leave it like that until
>> pivot is executed. So far so good. Problem is, if user instead
>> of issuing pivot calls destroy on the domain. In this case we
>> don't ever clear the access we granted at the beginning.
> This applies any time a job is still running. --pivot makes sure that it
> finishes after qemu reaches the correct point, but the intermediate
> state is still potentially long-running.

Right, point is, at the time we're doing qemuProcessStop(), qemu is no 
longer running -> we are restoring seclabels. No XATTR should be left 

> Also note that disk->mirror is only present for an active layer commit
> job but not for regular commit jobs. Does this bug apply to those as
> well?

Interesting question. Let me test. (testing, testing, testing). Oh yeah 
it does. Looks like I'm going to need mimic the else branch from 
qemuBlockJobEventProcessLegacyCompleted(). That is, I'll need 
qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src); too.

> It's harder to simulate that job though, but if qemu crashes
> during the job exactly the same semantics as if --pivot was not used and
> the VM was destroyed instead apply. We still relabelled some images.

Oh right. But that's basically the same thing. The only difference is 
whether libvirt initiated qemu shutdown or not.

> Also disk->mirror is present also for virDomainBlockCopy which this
> commit message omits completely.

Okay, will mention it in v2.

> You'll have to reformulate the commit message for this patch given that
> you persuade me that checking disk->mirror is enough given the existence
> of non-active jobs which don't populate disk->mirror.
>> https://bugzilla.redhat.com/show_bug.cgi?id=1741456#c19
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>>   src/qemu/qemu_process.c | 9 +++++++++
>>   1 file changed, 9 insertions(+)


More information about the libvir-list mailing list