From nobody Fri Apr 26 16:40:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581600215098754.0952957774007; Thu, 13 Feb 2020 05:23:35 -0800 (PST) Received: from localhost ([::1]:52252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ESr-0001lL-ND for importer@patchew.org; Thu, 13 Feb 2020 08:23:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46939) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EQC-0005qK-HO for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EQB-0007fm-Ar for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:48 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:42725 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EQA-0007ew-Ep for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:46 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-ZW_LtA09OyqZXS56AX123A-1; Thu, 13 Feb 2020 08:20:43 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 247A2802584; Thu, 13 Feb 2020 13:20:42 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6E796685A; Thu, 13 Feb 2020 13:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M3rk4N4XuCcIWOOAIksqrMSXz8VZy5V8PE8Oy5hTwMM=; b=Wh7t57EMRyEYmeEq8WC989w29x97OfuiH4g6Umm35vSu5VAcNQgQ3IKhrm+OtzqlUgBOJ4 BtcwZDLYkMEpdnqAbzIWbSs8eagk4ZOHwVCWisBLM+GB6FA8kxvY7RcVBC67MPC/D7fQFg a3nmOT/ZuoVS1gOP9bOdXER5rRFc/HQ= From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 1/6] migration: Maybe VM is paused when migration is cancelled Date: Thu, 13 Feb 2020 14:20:25 +0100 Message-Id: <20200213132030.57757-2-quintela@redhat.com> In-Reply-To: <20200213132030.57757-1-quintela@redhat.com> References: <20200213132030.57757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: ZW_LtA09OyqZXS56AX123A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , Zhimin Feng , "Dr. David Alan Gilbert" , Euler Robot , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Zhimin Feng If the migration is cancelled when it is in the completion phase, the migration state is set to MIGRATION_STATUS_CANCELLING. The VM maybe wait for the 'pause_sem' semaphore in migration_maybe_pause function, so that VM always is paused. Reported-by: Euler Robot Signed-off-by: Zhimin Feng Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/migration.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 3a21a4686c..1ca6be2323 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2797,14 +2797,22 @@ static int migration_maybe_pause(MigrationState *s, /* This block intentionally left blank */ } =20 - qemu_mutex_unlock_iothread(); - migrate_set_state(&s->state, *current_active_state, - MIGRATION_STATUS_PRE_SWITCHOVER); - qemu_sem_wait(&s->pause_sem); - migrate_set_state(&s->state, MIGRATION_STATUS_PRE_SWITCHOVER, - new_state); - *current_active_state =3D new_state; - qemu_mutex_lock_iothread(); + /* + * If the migration is cancelled when it is in the completion phase, + * the migration state is set to MIGRATION_STATUS_CANCELLING. + * So we don't need to wait a semaphore, otherwise we would always + * wait for the 'pause_sem' semaphore. + */ + if (s->state !=3D MIGRATION_STATUS_CANCELLING) { + qemu_mutex_unlock_iothread(); + migrate_set_state(&s->state, *current_active_state, + MIGRATION_STATUS_PRE_SWITCHOVER); + qemu_sem_wait(&s->pause_sem); + migrate_set_state(&s->state, MIGRATION_STATUS_PRE_SWITCHOVER, + new_state); + *current_active_state =3D new_state; + qemu_mutex_lock_iothread(); + } =20 return s->state =3D=3D new_state ? 0 : -EINVAL; } --=20 2.24.1 From nobody Fri Apr 26 16:40:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581600133832731.6116847240656; Thu, 13 Feb 2020 05:22:13 -0800 (PST) Received: from localhost ([::1]:52232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ERY-0007b1-IM for importer@patchew.org; Thu, 13 Feb 2020 08:22:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46969) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EQJ-0005zk-Dt for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EQH-0007ib-7o for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:54 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26764 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EQH-0007iL-3N for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:53 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431-vF9QDLV1NRSa3N7xo4lyMw-1; Thu, 13 Feb 2020 08:20:50 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37B3A1413; Thu, 13 Feb 2020 13:20:49 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D1D85C1BB; Thu, 13 Feb 2020 13:20:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600052; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ixHaisp+i77QOlZ41KfAP3G96ORtiggZqOICGYeIUjU=; b=Xvf4DgX1QgPYa/RYDxEsa0zMu1I9IBYRcavW2FwCkPkJN79hJsNd2gXuDUYSdI4ynRNL2w lS7t5ZaWhDMDsLFlpzb++T8oue9+pkvfcyUL8qvnVcp/XsusRq9UZosdkr4DgkuLY6toUI 4GiAK0ixtGNQj9B4k0oURJPVR345Umk= From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 2/6] migration: Optimization about wait-unplug migration state Date: Thu, 13 Feb 2020 14:20:26 +0100 Message-Id: <20200213132030.57757-3-quintela@redhat.com> In-Reply-To: <20200213132030.57757-1-quintela@redhat.com> References: <20200213132030.57757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: vF9QDLV1NRSa3N7xo4lyMw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , "Dr. David Alan Gilbert" , Paolo Bonzini , Jens Freimann , Keqian Zhu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Keqian Zhu qemu_savevm_nr_failover_devices() is originally designed to get the number of failover devices, but it actually returns the number of "unplug-pending" failover devices now. Moreover, what drives migration state to wait-unplug should be the number of "unplug-pending" failover devices, not all failover devices. We can also notice that qemu_savevm_state_guest_unplug_pending() and qemu_savevm_nr_failover_devices() is equivalent almost (from the code view). So the latter is incorrect semantically and useless, just delete it. In the qemu_savevm_state_guest_unplug_pending(), once hit a unplug-pending failover device, then it can return true right now to save cpu time. Signed-off-by: Keqian Zhu Reviewed-by: Juan Quintela Tested-by: Jens Freimann Reviewed-by: Jens Freimann Signed-off-by: Juan Quintela --- migration/migration.c | 2 +- migration/savevm.c | 24 +++--------------------- migration/savevm.h | 1 - 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 1ca6be2323..8fb68795dc 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3341,7 +3341,7 @@ static void *migration_thread(void *opaque) =20 qemu_savevm_state_setup(s->to_dst_file); =20 - if (qemu_savevm_nr_failover_devices()) { + if (qemu_savevm_state_guest_unplug_pending()) { migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_WAIT_UNPLUG); =20 diff --git a/migration/savevm.c b/migration/savevm.c index f19cb9ec7a..1d4220ece8 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1140,36 +1140,18 @@ void qemu_savevm_state_header(QEMUFile *f) } } =20 -int qemu_savevm_nr_failover_devices(void) +bool qemu_savevm_state_guest_unplug_pending(void) { SaveStateEntry *se; - int n =3D 0; =20 QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (se->vmsd && se->vmsd->dev_unplug_pending && se->vmsd->dev_unplug_pending(se->opaque)) { - n++; - } - } - - return n; -} - -bool qemu_savevm_state_guest_unplug_pending(void) -{ - SaveStateEntry *se; - int n =3D 0; - - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - if (!se->vmsd || !se->vmsd->dev_unplug_pending) { - continue; - } - if (se->vmsd->dev_unplug_pending(se->opaque)) { - n++; + return true; } } =20 - return n > 0; + return false; } =20 void qemu_savevm_state_setup(QEMUFile *f) diff --git a/migration/savevm.h b/migration/savevm.h index c42b9c80ee..ba64a7e271 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -31,7 +31,6 @@ =20 bool qemu_savevm_state_blocked(Error **errp); void qemu_savevm_state_setup(QEMUFile *f); -int qemu_savevm_nr_failover_devices(void); bool qemu_savevm_state_guest_unplug_pending(void); int qemu_savevm_state_resume_prepare(MigrationState *s); void qemu_savevm_state_header(QEMUFile *f); --=20 2.24.1 From nobody Fri Apr 26 16:40:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581600145155281.8599930710369; Thu, 13 Feb 2020 05:22:25 -0800 (PST) Received: from localhost ([::1]:52234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ERf-0007ns-EK for importer@patchew.org; Thu, 13 Feb 2020 08:22:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46988) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EQM-00064X-Gj for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EQL-0007jt-HI for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:58 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:59433 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EQL-0007jf-DB for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:20:57 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-3UWCgk0iNGO6MZLREOtZIA-1; Thu, 13 Feb 2020 08:20:55 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2335C184AED4 for ; Thu, 13 Feb 2020 13:20:54 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FEA95C241; Thu, 13 Feb 2020 13:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BR0NFF4kB4WALowFrUZKqMjz8zRgyClatayP7H8o15c=; b=Yqh4w2iT/pJ0nLc+E+A6Oa16CIazYBhfSm/r5+mozvvUVOSljItBpK/eCWcq4SpCFwJpsH O9OtpQ8cZ4a85iSVFbDHDOPz8yzCBCrrZAJR4ZtsSKYSpYz2uL8CGgPzkD+WRQLmDGvL6j Vt1qWtJJioc3Y7c79ErJBIn53DkHCuw= From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 3/6] migration/rdma: rdma_accept_incoming_migration fix error handling Date: Thu, 13 Feb 2020 14:20:27 +0100 Message-Id: <20200213132030.57757-4-quintela@redhat.com> In-Reply-To: <20200213132030.57757-1-quintela@redhat.com> References: <20200213132030.57757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 3UWCgk0iNGO6MZLREOtZIA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , "Dr. David Alan Gilbert" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" rdma_accept_incoming_migration is called from an fd handler and can't return an Error * anywhere. Currently it's leaking Error's in errp/local_err - there's no point putting them in there unless we can report them. Turn most into fprintf's, and the last into an error_reportf_err where it's coming up from another function. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/rdma.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/migration/rdma.c b/migration/rdma.c index 2379b8345b..f61587891b 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -3980,13 +3980,13 @@ static void rdma_accept_incoming_migration(void *op= aque) RDMAContext *rdma =3D opaque; int ret; QEMUFile *f; - Error *local_err =3D NULL, **errp =3D &local_err; + Error *local_err =3D NULL; =20 trace_qemu_rdma_accept_incoming_migration(); ret =3D qemu_rdma_accept(rdma); =20 if (ret) { - ERROR(errp, "RDMA Migration initialization failed!"); + fprintf(stderr, "RDMA ERROR: Migration initialization failed\n"); return; } =20 @@ -3998,13 +3998,16 @@ static void rdma_accept_incoming_migration(void *op= aque) =20 f =3D qemu_fopen_rdma(rdma, "rb"); if (f =3D=3D NULL) { - ERROR(errp, "could not qemu_fopen_rdma!"); + fprintf(stderr, "RDMA ERROR: could not qemu_fopen_rdma\n"); qemu_rdma_cleanup(rdma); return; } =20 rdma->migration_started_on_destination =3D 1; - migration_fd_process_incoming(f, errp); + migration_fd_process_incoming(f, &local_err); + if (local_err) { + error_reportf_err(local_err, "RDMA ERROR:"); + } } =20 void rdma_start_incoming_migration(const char *host_port, Error **errp) --=20 2.24.1 From nobody Fri Apr 26 16:40:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581600154341627.4442667743597; Thu, 13 Feb 2020 05:22:34 -0800 (PST) Received: from localhost ([::1]:52236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ERs-00086u-S7 for importer@patchew.org; Thu, 13 Feb 2020 08:22:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47020) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EQZ-0006UU-3I for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EQY-0007pX-5r for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:11 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43587 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EQY-0007p8-1t for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-4XgtjMKGMNiDPzTiRB2F7Q-1; Thu, 13 Feb 2020 08:21:06 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CEEB5802CBC for ; Thu, 13 Feb 2020 13:21:05 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79D575C54A; Thu, 13 Feb 2020 13:20:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ouxemjEQjJZWO36TxE/ocS3VG6z8bD5gZUW9n4giJ10=; b=RitP0hbONUnevO0wmputTcg6FwwXlMbraBgnxOvtxfQFNVzl9Z58FRJg9OXKBGwxpYOdDi /SIcy71YdmqFvFQhyPZ5j9WrOSFkzR2GCgrHSnnoAs9bq0Zrua0aY0N2RdVcXWbvqBHR2b DEGzL6ipiPxuSxgyI/G7y9W423PsdaU= From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 4/6] tests/migration: Add some slack to auto converge Date: Thu, 13 Feb 2020 14:20:28 +0100 Message-Id: <20200213132030.57757-5-quintela@redhat.com> In-Reply-To: <20200213132030.57757-1-quintela@redhat.com> References: <20200213132030.57757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 4XgtjMKGMNiDPzTiRB2F7Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , "Dr. David Alan Gilbert" , Peter Xu , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" There's an assert in autoconverge that checks that we quit the iteration when we go below the expected threshold. Philippe saw a case where this assert fired with the measured value slightly over the threshold. (about 3k out of a few million). I can think of two reasons: a) Rounding errors b) That after we make the decision to quit iteration we do one more sync and that sees a few more dirty pages. So add 1% slack to the assertion, that should cover a and most cases of b, probably all we'll see for the test. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Signed-off-by: Juan Quintela --- tests/qtest/migration-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index cf27ebbc9d..a78ac0c7da 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1237,7 +1237,8 @@ static void test_migrate_auto_converge(void) g_assert_cmpint(percentage, <=3D, max_pct); =20 remaining =3D read_ram_property_int(from, "remaining"); - g_assert_cmpint(remaining, <, expected_threshold); + g_assert_cmpint(remaining, <, + (expected_threshold + expected_threshold / 100)); =20 migrate_continue(from, "pre-switchover"); =20 --=20 2.24.1 From nobody Fri Apr 26 16:40:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581600222748697.0879635203363; Thu, 13 Feb 2020 05:23:42 -0800 (PST) Received: from localhost ([::1]:52254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ESz-0001ws-FI for importer@patchew.org; Thu, 13 Feb 2020 08:23:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47033) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EQd-0006VP-Gj for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EQc-0007rd-BU for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:15 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:41944 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EQc-0007rD-7P for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:14 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-_ZdXER3DOBKYrXwZ6_SEcg-1; Thu, 13 Feb 2020 08:21:11 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 021F389A09B; Thu, 13 Feb 2020 13:21:10 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 341A45C1D8; Thu, 13 Feb 2020 13:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kKg2syVySPTKKTaxIlMZ4/nfHaH90SGJTpSM4vIU9JY=; b=LIM83V7A9LA5GDu9ixspUI22KtQk2PbIrYzZLeO1xaYOB1kyUAty1lY0aTewR6FWQBRYCp TXImdv2mTOujtCBuArzvN5Mbo3BRM3W4MdM/GCmLts5IvFRx4IOq0i931oFHUWACxj5ZuV HBUL8vMTF+yBzv3utTwUqCIFIIlFDx8= From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 5/6] migration-test: fix some memleaks in migration-test Date: Thu, 13 Feb 2020 14:20:29 +0100 Message-Id: <20200213132030.57757-6-quintela@redhat.com> In-Reply-To: <20200213132030.57757-1-quintela@redhat.com> References: <20200213132030.57757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: _ZdXER3DOBKYrXwZ6_SEcg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , Pan Nengyuan , "Dr. David Alan Gilbert" , Euler Robot , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Pan Nengyuan spotted by asan, 'check-qtest-aarch64' runs fail if sanitizers is enabled. Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Reviewed-by: Juan Quintela Reviewed-by: Laurent Vivier Signed-off-by: Juan Quintela --- tests/qtest/migration-test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index a78ac0c7da..ccf313f288 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -498,11 +498,13 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, const char *arch =3D qtest_get_arch(); const char *machine_opts =3D NULL; const char *memory_size; + int ret =3D 0; =20 if (args->use_shmem) { if (!g_file_test("/dev/shm", G_FILE_TEST_IS_DIR)) { g_test_skip("/dev/shm is not supported"); - return -1; + ret =3D -1; + goto out; } } =20 @@ -611,8 +613,9 @@ static int test_migrate_start(QTestState **from, QTestS= tate **to, g_free(shmem_path); } =20 +out: migrate_start_destroy(args); - return 0; + return ret; } =20 static void test_migrate_end(QTestState *from, QTestState *to, bool test_d= est) @@ -1134,6 +1137,8 @@ static void test_validate_uuid(void) { MigrateStart *args =3D migrate_start_new(); =20 + g_free(args->opts_source); + g_free(args->opts_target); args->opts_source =3D g_strdup("-uuid 11111111-1111-1111-1111-11111111= 1111"); args->opts_target =3D g_strdup("-uuid 11111111-1111-1111-1111-11111111= 1111"); do_test_validate_uuid(args, false); @@ -1143,6 +1148,8 @@ static void test_validate_uuid_error(void) { MigrateStart *args =3D migrate_start_new(); =20 + g_free(args->opts_source); + g_free(args->opts_target); args->opts_source =3D g_strdup("-uuid 11111111-1111-1111-1111-11111111= 1111"); args->opts_target =3D g_strdup("-uuid 22222222-2222-2222-2222-22222222= 2222"); args->hide_stderr =3D true; @@ -1153,6 +1160,7 @@ static void test_validate_uuid_src_not_set(void) { MigrateStart *args =3D migrate_start_new(); =20 + g_free(args->opts_target); args->opts_target =3D g_strdup("-uuid 22222222-2222-2222-2222-22222222= 2222"); args->hide_stderr =3D true; do_test_validate_uuid(args, false); @@ -1162,6 +1170,7 @@ static void test_validate_uuid_dst_not_set(void) { MigrateStart *args =3D migrate_start_new(); =20 + g_free(args->opts_source); args->opts_source =3D g_strdup("-uuid 11111111-1111-1111-1111-11111111= 1111"); args->hide_stderr =3D true; do_test_validate_uuid(args, false); @@ -1380,6 +1389,7 @@ static void test_multifd_tcp_cancel(void) " 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}"= ); qobject_unref(rsp); =20 + g_free(uri); uri =3D migrate_get_socket_address(to2, "socket-address"); =20 wait_for_migration_status(from, "cancelled", NULL); --=20 2.24.1 From nobody Fri Apr 26 16:40:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1581600278527248.03383450806018; Thu, 13 Feb 2020 05:24:38 -0800 (PST) Received: from localhost ([::1]:52262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2ETt-00039V-9f for importer@patchew.org; Thu, 13 Feb 2020 08:24:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47044) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2EQe-0006Vm-LW for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2EQd-0007sN-Ju for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:16 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:33141 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2EQd-0007rs-GJ for qemu-devel@nongnu.org; Thu, 13 Feb 2020 08:21:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-c0BUiphbMAWrP8-OiowZFA-1; Thu, 13 Feb 2020 08:21:13 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C7F485B6EF for ; Thu, 13 Feb 2020 13:21:12 +0000 (UTC) Received: from secure.mitica (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59B785C1D8; Thu, 13 Feb 2020 13:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H/w/8VtAx2c3iD4K1lyp6dvbtw7YhI3frPIBSSwV6uk=; b=bcHqUyK1QvUfPtRqZspDEXqJ2ZJjaFwE2Y1qxzi7lNe+Xy6QPn73lKr4qiL+2RLzWhTZpg KZZ2KmGzNweyCvCk767lzeFTQJcS+R1BN44kYQsEAcGO3bUJckwSrt9PSfIR1qkM8+i4nS WStEkSGI0HQhKQo/cEehRYAETmSGxEc= From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 6/6] git: Make submodule check only needed modules Date: Thu, 13 Feb 2020 14:20:30 +0100 Message-Id: <20200213132030.57757-7-quintela@redhat.com> In-Reply-To: <20200213132030.57757-1-quintela@redhat.com> References: <20200213132030.57757-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: c0BUiphbMAWrP8-OiowZFA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Laurent Vivier , Thomas Huth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Juan Quintela , "Dr. David Alan Gilbert" , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If one is compiling more than one tree from the same source, it is possible that they need different submodules. Change the check to see that all modules that we are interested in are updated, discarding the ones that we don't care about. Signed-off-by: Juan Quintela --- v1->v2: patchw insists in not using modules --- scripts/git-submodule.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh index 98ca0f2737..65ed877aef 100755 --- a/scripts/git-submodule.sh +++ b/scripts/git-submodule.sh @@ -59,10 +59,14 @@ status) fi =20 test -f "$substat" || exit 1 - CURSTATUS=3D$($GIT submodule status $modules) - OLDSTATUS=3D$(cat $substat) - test "$CURSTATUS" =3D "$OLDSTATUS" - exit $? + for module in $modules; do + CURSTATUS=3D$($GIT submodule status $module) + OLDSTATUS=3D$(cat $substat | grep $module) + if test "$CURSTATUS" !=3D "$OLDSTATUS"; then + exit 1 + fi + done + exit 0 ;; update) if test -z "$maybe_modules" --=20 2.24.1