diff --git a/hmp-commands.hx b/hmp-commands.hx index 2e2a3bcf98..dda0767c5e 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1862,3 +1862,17 @@ SRST List event channels in the guest ERST #endif + + { + .name = "dirtyring", + .args_type = "", + .params = "", + .help = "", + .cmd = hmp_dirtyring, + }, + +SRST +``dirtyring`` + Dirty ring +ERST + diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index 13f9a2dedb..776d075b63 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -183,3 +183,5 @@ void hmp_info_mtree(Monitor *mon, const QDict *qdict); void hmp_info_cryptodev(Monitor *mon, const QDict *qdict); #endif + +void hmp_dirtyring(Monitor *mon, const QDict *qdict); diff --git a/linux-user/main.c b/linux-user/main.c index 149e35432e..2a1fed8121 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -672,6 +672,7 @@ static int parse_args(int argc, char **argv) int main(int argc, char **argv, char **envp) { + printf("Dirty ring QEMU\n"); struct target_pt_regs regs1, *regs = ®s1; struct image_info info1, *info = &info1; struct linux_binprm bprm; diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 7e96ae6ffd..e041932beb 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -28,6 +28,7 @@ #include "qemu/error-report.h" #include "qemu/sockets.h" #include "sysemu/runstate.h" +#include "sysemu/kvm.h" #include "ui/qemu-spice.h" #include "sysemu/sysemu.h" #include "options.h" @@ -235,6 +236,10 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->vfio->transferred >> 10); } + monitor_printf(mon, "kvm_dirty_ring_enabled: %s\n", + kvm_dirty_ring_enabled() ? "on" : "off"); + + qapi_free_MigrationInfo(info); } diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 871898ac46..142ce17014 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -28,6 +28,7 @@ #include "hw/intc/intc.h" #include "qemu/log.h" #include "sysemu/sysemu.h" +#include "sysemu/kvm.h" bool hmp_handle_error(Monitor *mon, Error *err) { @@ -443,3 +444,12 @@ void hmp_info_mtree(Monitor *mon, const QDict *qdict) mtree_info(flatview, dispatch_tree, owner, disabled); } + +void hmp_dirtyring(Monitor *mon, const QDict *qdict) +{ + if (kvm_dirty_ring_enabled()) { + printf("Dirty ring enabled.\n"); + } else { + printf("Dirty ring disabled.\n"); + } +} diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index b0f948d337..4ae15df665 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -209,3 +209,8 @@ static void __attribute__((__constructor__)) monitor_init_qmp_commands(void) qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG, 0); } + +void qmp_dirtyring(Error **errp) +{ + printf("Hello, world!\n"); +} diff --git a/qapi/misc.json b/qapi/misc.json index ec30e5c570..eed02a6e8a 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -605,3 +605,10 @@ { 'event': 'VFU_CLIENT_HANGUP', 'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str', 'dev-id': 'str', 'dev-qom-path': 'str' } } + +## +# @dirtyring: +# +# Since: 9.0 +## +{ 'command': 'dirtyring' }