提交 e2856d36 编写于 作者: J Jiri Denemark

xen: xenXMDomain*DeviceFlags should obey all flags

xenXMDomain*DeviceFlags() silently ignores requests to modify live
configuration of an active guest while still touching its persistent
configuration.
上级 6ab99b8a
......@@ -2935,8 +2935,13 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
if (domain->conn->flags & VIR_CONNECT_RO)
return -1;
if (domain->id != -1 && !(flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG))
if ((flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) ||
(domain->id != -1 && (flags & VIR_DOMAIN_DEVICE_MODIFY_CURRENT))) {
xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xm driver only supports modifying persistent config"));
return -1;
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
xenUnifiedLock(priv);
......@@ -3026,8 +3031,13 @@ xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
if (domain->conn->flags & VIR_CONNECT_RO)
return -1;
if (domain->id != -1 && !(flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG))
if ((flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) ||
(domain->id != -1 && (flags & VIR_DOMAIN_DEVICE_MODIFY_CURRENT))) {
xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
_("Xm driver only supports modifying persistent config"));
return -1;
}
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
xenUnifiedLock(priv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册