提交 09e44dca 编写于 作者: J Ján Tomko

qemu: implement vsock coldplug/coldunplug

https://bugzilla.redhat.com/show_bug.cgi?id=1291851Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 f3d96039
......@@ -8127,6 +8127,15 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
return -1;
break;
case VIR_DOMAIN_DEVICE_VSOCK:
if (vmdef->vsock) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("domain already has a vsock device"));
return -1;
}
VIR_STEAL_PTR(vmdef->vsock, dev->data.vsock);
break;
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_GRAPHICS:
......@@ -8138,7 +8147,6 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
case VIR_DOMAIN_DEVICE_IOMMU:
case VIR_DOMAIN_DEVICE_VSOCK:
case VIR_DOMAIN_DEVICE_LAST:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("persistent attach of device '%s' is not supported"),
......@@ -8311,6 +8319,17 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
VIR_DELETE_ELEMENT(vmdef->inputs, idx, vmdef->ninputs);
break;
case VIR_DOMAIN_DEVICE_VSOCK:
if (!vmdef->vsock ||
!virDomainVsockDefEquals(dev->data.vsock, vmdef->vsock)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("matching vsock device not found"));
return -1;
}
virDomainVsockDefFree(vmdef->vsock);
vmdef->vsock = NULL;
break;
case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_GRAPHICS:
......@@ -8322,7 +8341,6 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
case VIR_DOMAIN_DEVICE_IOMMU:
case VIR_DOMAIN_DEVICE_VSOCK:
case VIR_DOMAIN_DEVICE_LAST:
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("persistent detach of device '%s' is not supported"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册