mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Implement chardev source setup for tpm
Add handling to qemuDomainDeviceBackendChardevForeachOne and callbacks so that we can later use 'qemuBuildChardevCommand' for TPM devices. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9a89ec8997
commit
5c62df7e78
@ -11530,6 +11530,19 @@ qemuDomainDeviceBackendChardevForeachOne(virDomainDeviceDef *dev,
|
|||||||
|
|
||||||
return cb(dev, dev->data.rng->source.chardev, opaque);
|
return cb(dev, dev->data.rng->source.chardev, opaque);
|
||||||
|
|
||||||
|
case VIR_DOMAIN_DEVICE_TPM:
|
||||||
|
switch ((virDomainTPMBackendType) dev->data.tpm->type) {
|
||||||
|
case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
|
||||||
|
return cb(dev, dev->data.tpm->data.passthrough.source, opaque);
|
||||||
|
|
||||||
|
case VIR_DOMAIN_TPM_TYPE_EMULATOR:
|
||||||
|
return cb(dev, dev->data.tpm->data.emulator.source, opaque);
|
||||||
|
|
||||||
|
case VIR_DOMAIN_TPM_TYPE_LAST:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_LEASE:
|
case VIR_DOMAIN_DEVICE_LEASE:
|
||||||
case VIR_DOMAIN_DEVICE_FS:
|
case VIR_DOMAIN_DEVICE_FS:
|
||||||
case VIR_DOMAIN_DEVICE_INPUT:
|
case VIR_DOMAIN_DEVICE_INPUT:
|
||||||
@ -11543,7 +11556,6 @@ qemuDomainDeviceBackendChardevForeachOne(virDomainDeviceDef *dev,
|
|||||||
case VIR_DOMAIN_DEVICE_NONE:
|
case VIR_DOMAIN_DEVICE_NONE:
|
||||||
case VIR_DOMAIN_DEVICE_MEMBALLOON:
|
case VIR_DOMAIN_DEVICE_MEMBALLOON:
|
||||||
case VIR_DOMAIN_DEVICE_NVRAM:
|
case VIR_DOMAIN_DEVICE_NVRAM:
|
||||||
case VIR_DOMAIN_DEVICE_TPM:
|
|
||||||
case VIR_DOMAIN_DEVICE_PANIC:
|
case VIR_DOMAIN_DEVICE_PANIC:
|
||||||
case VIR_DOMAIN_DEVICE_LAST:
|
case VIR_DOMAIN_DEVICE_LAST:
|
||||||
case VIR_DOMAIN_DEVICE_MEMORY:
|
case VIR_DOMAIN_DEVICE_MEMORY:
|
||||||
|
@ -6891,6 +6891,10 @@ qemuProcessPrepareHostBackendChardevOne(virDomainDeviceDef *dev,
|
|||||||
* vhost-sockets for network devices */
|
* vhost-sockets for network devices */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TPMs FD passing setup is special and handled separately */
|
||||||
|
if (dev->type == VIR_DOMAIN_DEVICE_TPM)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ((virDomainChrType) chardev->type) {
|
switch ((virDomainChrType) chardev->type) {
|
||||||
|
@ -394,6 +394,10 @@ testPrepareHostBackendChardevOne(virDomainDeviceDef *dev,
|
|||||||
* vhost-sockets for network devices */
|
* vhost-sockets for network devices */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TPMs FD passing setup is special and handled separately */
|
||||||
|
if (dev->type == VIR_DOMAIN_DEVICE_TPM)
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ((virDomainChrType) chardev->type) {
|
switch ((virDomainChrType) chardev->type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user