mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-31 09:50:07 +03: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:
committed by
Maxim Nestratov
parent
0970a066d1
commit
b880ff42dd
@ -1193,6 +1193,9 @@ static int vzDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
|
|||||||
if (prlsdkAttachDevice(driver, dom, dev) < 0)
|
if (prlsdkAttachDevice(driver, dom, dev) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (prlsdkUpdateDomain(driver, dom) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virDomainDeviceDefFree(dev);
|
virDomainDeviceDefFree(dev);
|
||||||
@ -1245,6 +1248,9 @@ static int vzDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
|
|||||||
if (prlsdkDetachDevice(driver, dom, dev) < 0)
|
if (prlsdkDetachDevice(driver, dom, dev) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (prlsdkUpdateDomain(driver, dom) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
virDomainDeviceDefFree(dev);
|
virDomainDeviceDefFree(dev);
|
||||||
|
Reference in New Issue
Block a user