mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Modify qemuBuildTPMCommandLine
Modify the argument order and types to match other similar helpers. Also modify called functions to use the def->emulator instead of passing def->emulator and def. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
e6944a529e
commit
9de54baf26
@ -8091,8 +8091,7 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
qemuBuildTPMDevStr(const virDomainDef *def,
|
qemuBuildTPMDevStr(const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps)
|
||||||
const char *emulator)
|
|
||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
const virDomainTPMDef *tpm = def->tpm;
|
const virDomainTPMDef *tpm = def->tpm;
|
||||||
@ -8102,7 +8101,7 @@ qemuBuildTPMDevStr(const virDomainDef *def,
|
|||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("The QEMU executable %s does not support TPM "
|
_("The QEMU executable %s does not support TPM "
|
||||||
"model %s"),
|
"model %s"),
|
||||||
emulator, model);
|
def->emulator, model);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8124,7 +8123,6 @@ static char *
|
|||||||
qemuBuildTPMBackendStr(const virDomainDef *def,
|
qemuBuildTPMBackendStr(const virDomainDef *def,
|
||||||
virCommandPtr cmd,
|
virCommandPtr cmd,
|
||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps,
|
||||||
const char *emulator,
|
|
||||||
int *tpmfd,
|
int *tpmfd,
|
||||||
int *cancelfd)
|
int *cancelfd)
|
||||||
{
|
{
|
||||||
@ -8200,7 +8198,7 @@ qemuBuildTPMBackendStr(const virDomainDef *def,
|
|||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("The QEMU executable %s does not support TPM "
|
_("The QEMU executable %s does not support TPM "
|
||||||
"backend type %s"),
|
"backend type %s"),
|
||||||
emulator, type);
|
def->emulator, type);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(devset);
|
VIR_FREE(devset);
|
||||||
@ -8212,17 +8210,19 @@ qemuBuildTPMBackendStr(const virDomainDef *def,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuBuildTPMCommandLine(virDomainDefPtr def,
|
qemuBuildTPMCommandLine(virCommandPtr cmd,
|
||||||
virCommandPtr cmd,
|
const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps,
|
virQEMUCapsPtr qemuCaps)
|
||||||
const char *emulator)
|
|
||||||
{
|
{
|
||||||
char *optstr;
|
char *optstr;
|
||||||
int tpmfd = -1;
|
int tpmfd = -1;
|
||||||
int cancelfd = -1;
|
int cancelfd = -1;
|
||||||
char *fdset;
|
char *fdset;
|
||||||
|
|
||||||
if (!(optstr = qemuBuildTPMBackendStr(def, cmd, qemuCaps, emulator,
|
if (!def->tpm)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!(optstr = qemuBuildTPMBackendStr(def, cmd, qemuCaps,
|
||||||
&tpmfd, &cancelfd)))
|
&tpmfd, &cancelfd)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -8247,7 +8247,7 @@ qemuBuildTPMCommandLine(virDomainDefPtr def,
|
|||||||
VIR_FREE(fdset);
|
VIR_FREE(fdset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(optstr = qemuBuildTPMDevStr(def, qemuCaps, emulator)))
|
if (!(optstr = qemuBuildTPMDevStr(def, qemuCaps)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArgList(cmd, "-device", optstr, NULL);
|
virCommandAddArgList(cmd, "-device", optstr, NULL);
|
||||||
@ -8528,10 +8528,8 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
if (qemuBuildConsoleCommandLine(logManager, cmd, def, qemuCaps) < 0)
|
if (qemuBuildConsoleCommandLine(logManager, cmd, def, qemuCaps) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (def->tpm) {
|
if (qemuBuildTPMCommandLine(cmd, def, qemuCaps) < 0)
|
||||||
if (qemuBuildTPMCommandLine(def, cmd, qemuCaps, def->emulator) < 0)
|
goto error;
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < def->ninputs; i++) {
|
for (i = 0; i < def->ninputs; i++) {
|
||||||
virDomainInputDefPtr input = def->inputs[i];
|
virDomainInputDefPtr input = def->inputs[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user