mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
vz: fixed race in vzDomainAttach/DettachDevice
While dettaching/attaching device in OpenStack, nova calls vzDomainDettachDevice twice, because the update of the internal configuration of the ct comes a bit latter than the update event. As the result, we suffer from the second call to dettach the same device. Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
This commit is contained in:
parent
2354266acf
commit
3a6cf6fc16
@ -3600,6 +3600,12 @@ prlsdkAttachDevice(vzDriverPtr driver,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (prlsdkUpdateDomain(driver, dom) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Failed to save new config"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE);
|
||||
if (PRL_FAILED(waitDomainJob(job, dom)))
|
||||
return -1;
|
||||
@ -3667,6 +3673,12 @@ prlsdkDetachDevice(vzDriverPtr driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (prlsdkUpdateDomain(driver, dom) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Failed to save new config"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE);
|
||||
if (PRL_FAILED(waitDomainJob(job, dom)))
|
||||
goto cleanup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user