summaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-08-20 15:31:38 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-22 10:47:17 -0500
commit99afc91d6ccdbe45258cff66fd0ce0142820c366 (patch)
tree43ed327cc24a401174b977859c8a62e0a7f5540d /arch_init.c
parent67c332fd12326a6ef572f07b9d71370ada6a287f (diff)
qapi: add 'query-target' command to return target arch
Add a 'query-target' QAPI command to allow management applications to determine what target architecture a QEMU binary is emulating without having to parse the binary name or -help output $ qmp-shell -p /tmp/qemu (QEMU) query-target { u'return': { u'arch': u'x86_64' }} Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'arch_init.c')
-rw-r--r--arch_init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch_init.c b/arch_init.c
index 9b46bfcaa5..5a1173e29a 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -44,6 +44,7 @@
#include "exec-memory.h"
#include "hw/pcspk.h"
#include "qemu/page_cache.h"
+#include "qmp-commands.h"
#ifdef DEBUG_ARCH_INIT
#define DPRINTF(fmt, ...) \
@@ -1080,3 +1081,13 @@ int xen_available(void)
return 0;
#endif
}
+
+
+TargetInfo *qmp_query_target(Error **errp)
+{
+ TargetInfo *info = g_malloc0(sizeof(*info));
+
+ info->arch = TARGET_TYPE;
+
+ return info;
+}