提交 3208c562 编写于 作者: S Stefan Berger 提交者: Stefan Berger

Check for QMP query-tpm-models

Check for QMP query-tpm-models and set a capability flag. Do not use
this QMP command if it is not supported.
Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
上级 e7d8ab01
......@@ -220,6 +220,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
"machine-usb-opt",
"tpm-passthrough",
"tpm-tis",
"query-tpm-models", /* 140 */
);
struct _virQEMUCaps {
......@@ -1962,6 +1964,8 @@ virQEMUCapsProbeQMPCommands(virQEMUCapsPtr qemuCaps,
virQEMUCapsSet(qemuCaps, QEMU_CAPS_ADD_FD);
else if (STREQ(name, "nbd-server-start"))
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NBD_SERVER);
else if (STREQ(name, "query-tpm-models"))
virQEMUCapsSet(qemuCaps, QEMU_CAPS_TPM_MODELS);
VIR_FREE(name);
}
VIR_FREE(commands);
......@@ -2144,6 +2148,10 @@ virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps,
{
int nentries, i;
char **entries = NULL;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_TPM_MODELS))
return 0;
if ((nentries = qemuMonitorGetTPMModels(mon, &entries)) < 0)
return -1;
......
......@@ -179,6 +179,7 @@ enum virQEMUCapsFlags {
QEMU_CAPS_MACHINE_USB_OPT = 137, /* -machine xxx,usb=on/off */
QEMU_CAPS_DEVICE_TPM_PASSTHROUGH = 138, /* -tpmdev passthrough */
QEMU_CAPS_DEVICE_TPM_TIS = 139, /* -device tpm_tis */
QEMU_CAPS_TPM_MODELS = 140, /* query-tpm-models QMP command */
QEMU_CAPS_LAST, /* this must always be the last item */
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册