diff mbox series

[for-6.0,3/6] qapi: Use qmp_query_accel() in qmp_query_kvm()

Message ID 20201116131011.26607-4-r.bolshakov@yadro.com (mailing list archive)
State New, archived
Headers show
Series Add HMP/QMP commands to query accelerator | expand

Commit Message

Roman Bolshakov Nov. 16, 2020, 1:10 p.m. UTC
qmp_query_accel() is generic and can be used instead of open-coding
qmp_query_kvm().

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 monitor/qmp-cmds.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index f5d50afa9c..5a5f3a65f4 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -54,12 +54,7 @@  NameInfo *qmp_query_name(Error **errp)
 
 AccelInfo *qmp_query_kvm(Error **errp)
 {
-    AccelInfo *info = g_malloc0(sizeof(*info));
-
-    info->enabled = kvm_enabled();
-    info->present = kvm_available();
-
-    return info;
+    return qmp_query_accel("kvm", errp);
 }
 
 AccelInfo *qmp_query_accel(const char *name, Error **errp)