mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-30 18:50:18 +03:00
qemuBuildTPMBackendStr: format device and alias separately
Also get rid of the temporary 'type' variable. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
66877835ec
commit
3c6f2df8fc
@ -10010,7 +10010,6 @@ qemuBuildTPMBackendStr(const virDomainDef *def,
|
||||
{
|
||||
const virDomainTPMDef *tpm = def->tpm;
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
const char *type = NULL;
|
||||
char *cancel_path = NULL;
|
||||
char *devset = NULL;
|
||||
char *cancelset = NULL;
|
||||
@ -10019,16 +10018,8 @@ qemuBuildTPMBackendStr(const virDomainDef *def,
|
||||
*tpmfd = -1;
|
||||
*cancelfd = -1;
|
||||
|
||||
switch (tpm->type) {
|
||||
case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
|
||||
case VIR_DOMAIN_TPM_TYPE_EMULATOR:
|
||||
type = virDomainTPMBackendTypeToString(tpm->type);
|
||||
break;
|
||||
case VIR_DOMAIN_TPM_TYPE_LAST:
|
||||
goto error;
|
||||
}
|
||||
|
||||
virBufferAsprintf(&buf, "%s,id=tpm-%s", type, tpm->info.alias);
|
||||
virBufferAsprintf(&buf, "%s", virDomainTPMBackendTypeToString(tpm->type));
|
||||
virBufferAsprintf(&buf, ",id=tpm-%s", tpm->info.alias);
|
||||
|
||||
switch (tpm->type) {
|
||||
case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
|
||||
|
Loading…
x
Reference in New Issue
Block a user