From patchwork Wed Jun 21 07:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 778699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wsxwn0m3xz9s4q for ; Wed, 21 Jun 2017 18:00:57 +1000 (AEST) Received: from localhost ([::1]:52344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNaZK-0000sv-RZ for incoming@patchwork.ozlabs.org; Wed, 21 Jun 2017 04:00:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNaRu-0002po-TD for qemu-devel@nongnu.org; Wed, 21 Jun 2017 03:53:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNaRr-0003an-17 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 03:53:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNaRq-0003ZJ-PI for qemu-devel@nongnu.org; Wed, 21 Jun 2017 03:53:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0A527486C for ; Wed, 21 Jun 2017 07:53:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B0A527486C Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=peterx@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B0A527486C Received: from pxdev.xzpeter.org.com (ovpn-12-74.pek2.redhat.com [10.72.12.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF64782475; Wed, 21 Jun 2017 07:53:06 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 21 Jun 2017 15:52:08 +0800 Message-Id: <1498031528-1990-11-git-send-email-peterx@redhat.com> In-Reply-To: <1498031528-1990-1-git-send-email-peterx@redhat.com> References: <1498031528-1990-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 21 Jun 2017 07:53:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 10/10] migration: hmp: dump globals X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Eduardo Habkost , Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now we have some globals that can be configured for migration. Dump them in HMP info migration for better debugging. (we can also use this to monitor whether COMPAT fields are applied correctly on compatible machines) Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- hmp.c | 3 +++ include/migration/misc.h | 1 + migration/migration.c | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/hmp.c b/hmp.c index 8c72c58..4c41cac 100644 --- a/hmp.c +++ b/hmp.c @@ -43,6 +43,7 @@ #include "exec/ramlist.h" #include "hw/intc/intc.h" #include "migration/snapshot.h" +#include "migration/misc.h" #ifdef CONFIG_SPICE #include @@ -164,6 +165,8 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info = qmp_query_migrate(NULL); caps = qmp_query_migrate_capabilities(NULL); + migration_global_dump(mon); + /* do not display parameters during setup */ if (info->has_status && caps) { monitor_printf(mon, "capabilities: "); diff --git a/include/migration/misc.h b/include/migration/misc.h index 854c28d..2255121 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -54,5 +54,6 @@ bool migration_has_failed(MigrationState *); /* ...and after the device transmission */ bool migration_in_postcopy_after_devices(MigrationState *); void migration_only_migratable_set(void); +void migration_global_dump(Monitor *mon); #endif diff --git a/migration/migration.c b/migration/migration.c index e7e6cf3..b1b0825 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -43,6 +43,7 @@ #include "io/channel-buffer.h" #include "migration/colo.h" #include "hw/boards.h" +#include "monitor/monitor.h" #define MAX_THROTTLE (32 << 20) /* Migration transfer speed throttling */ @@ -1993,6 +1994,16 @@ void migrate_fd_connect(MigrationState *s) s->migration_thread_running = true; } +void migration_global_dump(Monitor *mon) +{ + MigrationState *ms = migrate_get_current(); + + monitor_printf(mon, "globals: store-global-state=%d, only_migratable=%d, " + "send-configuration=%d, send-section-footer=%d\n", + ms->store_global_state, ms->only_migratable, + ms->send_configuration, ms->send_section_footer); +} + static Property migration_properties[] = { DEFINE_PROP_BOOL("store-global-state", MigrationState, store_global_state, true),