[libvirt] [PATCH] qemu: Do not unlink managedsave image if restoring fails.

Osier Yang jyang at redhat.com
Tue Apr 5 13:24:39 UTC 2011


于 2011年04月05日 21:20, Jiri Denemark 写道:
> On Tue, Apr 05, 2011 at 14:47:22 +0800, Osier Yang wrote:
>> Both "qemuDomainStartWithFlags" and "qemuAutostartDomain" try to
>> restore the domain from managedsave'ed image if it exists (by
>> invoking "qemuDomainObjRestore"), but it unlinks the image even
>> if restoring fails, which causes data loss.
>>
>> However, I'm not sure if it's the very correct way to fix it,
>> if restoring fails, and we didn't remove the image, it will
>> trys to restore from the image again next time, if that's
>> not the user expected (e.g. the user made quite many changes
>> on the guest), then it's a new problem.
>
> I think this patch is risky. You should either remove the state on error
> (which is the current state) or fail domain start if managed state is present
> but resuming from it fails. If you do something in the middle (your patch) you
> will certainly end up corrupting domain's disks.
>
> Jirka

Hum, it makes sense, that's what I was worried about, I think
failing domain start will be better than data loss anyway, so
will update with that.

Thanks for the reviewing

Regards
Osier





More information about the libvir-list mailing list