From patchwork Tue Sep 24 21:00:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 174312 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4672003ill; Tue, 24 Sep 2019 14:15:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6BL2LbHeHkvQG7eUrcJj76wB7JIoDZ4hEOGKxMkuAs5Rx2WDQAUfFqCCCYMvb2iAZGY7r X-Received: by 2002:a5d:4742:: with SMTP id o2mr4500011wrs.253.1569359703383; Tue, 24 Sep 2019 14:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569359703; cv=none; d=google.com; s=arc-20160816; b=kcLdsbgTHCr+5WPNXgr0Nom0lqWMPbTzHvj9aphNK8k3IJe+428NT9H9u/4OvXDP0P 2sM9S9TNFG8FEC7SXQM5Xxi6p5CmdbjYfhE1mXG9+SoYWmEMsxLVlL2EymQq/YwHxPWN MMYWz1glMVKWm7zjSRAIDAEqLlMMb5F5LuWRLUPsiUpOwozU0rN0AxsBFuVRY+kBJiyI W1gapIZ7o9leujcFjBiXxd8FBmAs9oLL9aNRQMXQeHt1UetUheCpshY3/SO/IRMWqeUu nYIWa+RRzUE/SBCYiWQCerrGMnBLSu8t9krWdW44di3pQJl+MlfsxK6rZoNgxrHs0a8Q d73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=b6FIcOabpKRLlHH33rbrRAMy6kyScJiPH3lkiBmUDds=; b=e9pp7cntPXWwu4IRpHo5ukfczFNJq1m8HfPd0X0MTVCGkj/tzBYnkYaLQoM+owzMVN ZdXu/Vn7N52F2umw/BFANLvyIvUQaf2Sz/VpUjdEBgZxXhdM/FTP2wCSelzbgglgzhfA DmkVEtNiMkXk0+cvWQAzDgbeP0VRLHDlFcJubbEzfN8cs2Csk8krUG3i2fxSOUj72hod Yo2GZ6PDPSBANVB+VfmQfKtVYiDSR3GtECDGapxV4przztvyqsgTWtT0A4LTAW9MRl7o gQHmzK2mQmihszRyhP9YdIdtzZXCoAF5vDdJx4jBVOxKAUs4VRtG88HGB3DMa3RbXXi4 rIPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="okw/qoRU"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v1si2280016wrc.443.2019.09.24.14.15.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Sep 2019 14:15:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="okw/qoRU"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCs9F-0006Oe-3f for patch@linaro.org; Tue, 24 Sep 2019 17:15:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55603) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrw3-0002Zx-KN for qemu-devel@nongnu.org; Tue, 24 Sep 2019 17:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCrw0-0004Uk-MI for qemu-devel@nongnu.org; Tue, 24 Sep 2019 17:01:23 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46901) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCrvy-0004T8-Lk for qemu-devel@nongnu.org; Tue, 24 Sep 2019 17:01:19 -0400 Received: by mail-wr1-x436.google.com with SMTP id o18so3608426wrv.13 for ; Tue, 24 Sep 2019 14:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b6FIcOabpKRLlHH33rbrRAMy6kyScJiPH3lkiBmUDds=; b=okw/qoRUVaUP/y63sa59+x14iASUzjA997Bg85Hb/qlfO3by5/lp2CZCX/bsr21heB NyjeN9zGqqv6Jz/r2BTHxnkp/KzgYuPQyxdFmv6KBfpOPwDbUk366khyDIj21MJu0o7J dJBc9ifuK5Uz1M9RgNTxqc5kf67lSfeNJeF5fn/a00Mo4n4N5e2uFWTvvHdPUDSlfvdV wBfqHexJjL4GkpSzVuq4T5QZjdB4yyxZd5vAKBsWNXRTjDIRGMmoVNgw5Pszxf48lnvu vMwg36FNRl5UBA4RkY8EfjSj3gse3Ij3XWgbIbB7Ngg6MaZbcL75b2GtoHoH4Hq5KKCU lSWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b6FIcOabpKRLlHH33rbrRAMy6kyScJiPH3lkiBmUDds=; b=BVvuFyQWChSx99IE63NFmLIN2R0b4Yg3iHUsVQVJDAuvGcuMsB+S78E659S+WfjjUJ SfKkgN7J29CKOv/nR3qA5DMLmeLTH9SrCxBWhgD1TukfGz19GtEkjzI5m4zpT2nHX3Qw JkgIc9+yrdhf9AD4uVF/WKeyCUdTElCihB/RpErvrtCV99B2979nB3oR5qcNKPywj7gC 0aX18IcPC6eB4A8jIOcLQsV1te7KQlYo6oVVaT1wcYSawO6NrHfFglwMBtWUUnefoZmp pWiVFvXsmigxDOOjC/tHGqlvgmQ6OIekWY4y/Ct4k5LeIF2oqmdjadqbtWZisKvCsFsH CDSA== X-Gm-Message-State: APjAAAWzIhcwh1XpKLEw5pyPm5h0iipr2C8yDyd6VZcxnwt6D5is8TI5 +zu6YEPIMb3h+5l4a8gDPRbm4w== X-Received: by 2002:adf:ed05:: with SMTP id a5mr4850644wro.35.1569358875236; Tue, 24 Sep 2019 14:01:15 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n22sm998996wmk.19.2019.09.24.14.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 14:01:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B4C091FF9A; Tue, 24 Sep 2019 22:01:07 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v3 10/33] migration/postcopy: Recognise the recovery states as 'in_postcopy' Date: Tue, 24 Sep 2019 22:00:43 +0100 Message-Id: <20190924210106.27117-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924210106.27117-1-alex.bennee@linaro.org> References: <20190924210106.27117-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Juan Quintela , jsnow@redhat.com, f4bug@amsat.org, "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Dr. David Alan Gilbert" Various parts of the migration code do different things when they're in postcopy mode; prior to this patch this has been 'postcopy-active'. This patch extends 'in_postcopy' to include 'postcopy-paused' and 'postcopy-recover'. In particular, when you set the max-postcopy-bandwidth parameter, this only affects the current migration fd if we're 'in_postcopy'; this leads to a race in the postcopy recovery test where it increases the speed from 4k/sec to unlimited, but that increase can get ignored if the change is made between the point at which the reconnection happens and it transitions back to active. Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Alex Bennée Message-Id: <20190923174942.12182-1-dgilbert@redhat.com> --- migration/migration.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/migration/migration.c b/migration/migration.c index 01863a95f5f..5f7e4d15e95 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1659,7 +1659,14 @@ bool migration_in_postcopy(void) { MigrationState *s = migrate_get_current(); - return (s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE); + switch (s->state) { + case MIGRATION_STATUS_POSTCOPY_ACTIVE: + case MIGRATION_STATUS_POSTCOPY_PAUSED: + case MIGRATION_STATUS_POSTCOPY_RECOVER: + return true; + default: + return false; + } } bool migration_in_postcopy_after_devices(MigrationState *s)