提交 b880ff42 编写于 作者: O Olga Krishtal 提交者: Maxim Nestratov

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: NOlga Krishtal <okrishtal@virtuozzo.com>
上级 0970a066
......@@ -1193,6 +1193,9 @@ static int vzDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
if (prlsdkAttachDevice(driver, dom, dev) < 0)
goto cleanup;
if (prlsdkUpdateDomain(driver, dom) < 0)
goto cleanup;
ret = 0;
cleanup:
virDomainDeviceDefFree(dev);
......@@ -1245,6 +1248,9 @@ static int vzDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (prlsdkDetachDevice(driver, dom, dev) < 0)
goto cleanup;
if (prlsdkUpdateDomain(driver, dom) < 0)
goto cleanup;
ret = 0;
cleanup:
virDomainDeviceDefFree(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册