mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: store the emulator name in the capabilities XML
We don't need this for any functional purpose, but when debugging hosts it is useful to know what binary a given capabilities XML document is associated with. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
0fcc78d51b
commit
42b3e5b9e4
@ -3872,6 +3872,7 @@ virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt)
|
||||
* Parsing a doc that looks like
|
||||
*
|
||||
* <qemuCaps>
|
||||
* <emulator>/some/path</emulator>
|
||||
* <qemuctime>234235253</qemuctime>
|
||||
* <selfctime>234235253</selfctime>
|
||||
* <selfvers>1002016</selfvers>
|
||||
@ -3915,6 +3916,18 @@ virQEMUCapsLoadCache(virArch hostArch,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!(str = virXPathString("string(./emulator)", ctxt))) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("missing emulator in QEMU capabilities cache"));
|
||||
goto cleanup;
|
||||
}
|
||||
if (STRNEQ(str, qemuCaps->binary)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Expected caps for '%s' but saw '%s'"),
|
||||
qemuCaps->binary, str);
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_FREE(str);
|
||||
if (virXPathLongLong("string(./qemuctime)", ctxt, &l) < 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("missing qemuctime in QEMU capabilities XML"));
|
||||
@ -4252,6 +4265,8 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps)
|
||||
virBufferAddLit(&buf, "<qemuCaps>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
|
||||
virBufferEscapeString(&buf, "<emulator>%s</emulator>\n",
|
||||
qemuCaps->binary);
|
||||
virBufferAsprintf(&buf, "<qemuctime>%llu</qemuctime>\n",
|
||||
(long long)qemuCaps->ctime);
|
||||
virBufferAsprintf(&buf, "<selfctime>%llu</selfctime>\n",
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-riscv32</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-riscv64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-riscv32</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-riscv64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -1,4 +1,5 @@
|
||||
<qemuCaps>
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
<qemuctime>0</qemuctime>
|
||||
<selfctime>0</selfctime>
|
||||
<selfvers>0</selfvers>
|
||||
|
@ -75,6 +75,7 @@ testQemuCaps(const void *opaque)
|
||||
char *capsFile = NULL;
|
||||
qemuMonitorTestPtr mon = NULL;
|
||||
virQEMUCapsPtr capsActual = NULL;
|
||||
char *binary = NULL;
|
||||
char *actual = NULL;
|
||||
unsigned int fakeMicrocodeVersion = 0;
|
||||
const char *p;
|
||||
@ -93,7 +94,10 @@ testQemuCaps(const void *opaque)
|
||||
if (qemuProcessQMPInitMonitor(qemuMonitorTestGetMonitor(mon)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(capsActual = virQEMUCapsNew()) ||
|
||||
binary = g_strdup_printf("/usr/bin/qemu-system-%s",
|
||||
data->archName);
|
||||
|
||||
if (!(capsActual = virQEMUCapsNewBinary(binary)) ||
|
||||
virQEMUCapsInitQMPMonitor(capsActual,
|
||||
qemuMonitorTestGetMonitor(mon)) < 0)
|
||||
goto cleanup;
|
||||
@ -132,6 +136,7 @@ testQemuCaps(const void *opaque)
|
||||
VIR_FREE(repliesFile);
|
||||
VIR_FREE(capsFile);
|
||||
VIR_FREE(actual);
|
||||
VIR_FREE(binary);
|
||||
qemuMonitorTestFree(mon);
|
||||
virObjectUnref(capsActual);
|
||||
return ret;
|
||||
|
@ -283,11 +283,14 @@ qemuTestParseCapabilitiesArch(virArch arch,
|
||||
const char *capsFile)
|
||||
{
|
||||
virQEMUCapsPtr qemuCaps = NULL;
|
||||
char *binary = g_strdup_printf("/usr/bin/qemu-system-%s",
|
||||
virArchToString(arch));
|
||||
|
||||
if (!(qemuCaps = virQEMUCapsNew()) ||
|
||||
if (!(qemuCaps = virQEMUCapsNewBinary(binary)) ||
|
||||
virQEMUCapsLoadCache(arch, qemuCaps, capsFile) < 0)
|
||||
goto error;
|
||||
|
||||
virQEMUCapsSetInvalidation(qemuCaps, false);
|
||||
return qemuCaps;
|
||||
|
||||
error:
|
||||
|
Loading…
Reference in New Issue
Block a user