[libvirt] [PATCH] [3/4] Implement managed save operations for qemu driver

Laine Stump laine at laine.org
Fri Apr 2 15:54:59 UTC 2010


On 04/01/2010 12:22 PM, Daniel Veillard wrote:
> @@ -5928,6 +6096,29 @@ static int qemudDomainStart(virDomainPtr dom) {
>           goto endjob;
>       }
>
> +    /*
> +     * If there is a managed saved state restore it instead of starting
> +     * from scratch. In any case the old state is removed.
> +     */
> +    managed_save = qemuDomainManagedSavePath(driver, vm);
> +    if ((managed_save)&&  (virFileExists(managed_save))) {
> +        virDomainObjUnlock(vm);
> +        qemuDriverUnlock(driver);
> +        ret = qemudDomainRestore(dom->conn, managed_save);
>    

There is problem here.

qemudDomainRestore will call qemuDomainObjBeginJobWithDriver, which was 
already called just above this bit of code in qemudDomainStart. The 
result will be a temporary deadlock, while the semaphore wait times out, 
followed by failure.

Either qemudDomainStart needs to call that function later, or else it 
needs to call qemuDomainObjEndJob before calling qemudDomainRestore.

(Unfortunately, I haven't yet had the time to do any more of a review 
other than build and try running the code.)




More information about the libvir-list mailing list