From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142387; cv=none; d=zohomail.com; s=zohoarc; b=BMETn0p+TT9kHBiWd+B+5n77kTLgBKHW4NEVoiebMjq8VaPo3eJCHtKICtDl7JShChMPFHUbwKikGq1MUOE5GX5Ci6iZ9CZuFhJCQe9f1TYXqqZBNBYpqiig1x6Pki4r+aqhilHY0fr/dn4r7eJq5jF0qFpPu/9paPrNMlcpEAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142387; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w0e863PwX6d7J/JmPX14i8QvC2RmA0dRj3ib8BKw8Vk=; b=m7NHZx2jcVT/exYo9I9l4K4Ti88moH1N3e+AecNXkpw9jJ4iygu/Xf62kW7H0DbBFPRkLnJtYdzP4tHjMYdlb5OmPfguPG5woJfwuydkMH4cvtjkzfQRetHeK2hFX8Bo0WAH//6Sbyo8PZgB3tkEOKkN1+aHcnIa5laIENrZ7Jg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158514238788167.79091158941844; Wed, 25 Mar 2020 06:19:47 -0700 (PDT) Received: from localhost ([::1]:36152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5wg-0002ms-Kr for importer@patchew.org; Wed, 25 Mar 2020 09:19:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52983) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5tp-0006bB-1A for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5tn-0005zd-SY for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:48 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:33351) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5tn-0005yo-PG for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:47 -0400 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-40-okfhtMq_MCaZtVa_UVFyhQ-1; Wed, 25 Mar 2020 09:16:45 -0400 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 5AD17107ACC4; Wed, 25 Mar 2020 13:16:39 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9DC05C3F8; Wed, 25 Mar 2020 13:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w0e863PwX6d7J/JmPX14i8QvC2RmA0dRj3ib8BKw8Vk=; b=d6v9oDGMykDMYkFRO+zP1szH2eUfwRbKGtj04wlzbhzva0yUSnV/EV1LHjANG7g05ZYMBW ruE3dFgGeHA31K+t5m/KqyQNaRp38IKoztlB57l6x4GA2OSpc/1TOkeivhueuzU7b9m97Q GgtI00jyipPJhOiJo0hmjsYCnZymyrM= X-MC-Unique: okfhtMq_MCaZtVa_UVFyhQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 1/9] hmp-cmd: fix a missing_break warning Date: Wed, 25 Mar 2020 13:16:24 +0000 Message-Id: <20200325131632.311034-2-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Pan Nengyuan This fix coverity issues 94417686: 1260 break; CID 94417686: (MISSING_BREAK) 1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTT= LE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement. 1261 case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD: 1262 p->has_throttle_trigger_threshold =3D true; 1263 visit_type_int(v, param, &p->throttle_trigger_threshold, &e= rr); 1264 case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL: Fixes: dc14a470763c96fd9d360e1028ce38e8c3613a77 Fixes: Coverity (CID 1421950) Reported-by: Euler Robot Signed-off-by: Pan Nengyuan Message-Id: <20200318071620.59748-1-pannengyuan@huawei.com> Reviewed-by: Keqian Zhu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 58724031ea..c882c9f3cc 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QD= ict *qdict) case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD: p->has_throttle_trigger_threshold =3D true; visit_type_int(v, param, &p->throttle_trigger_threshold, &err); + break; case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL: p->has_cpu_throttle_initial =3D true; visit_type_int(v, param, &p->cpu_throttle_initial, &err); --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142284; cv=none; d=zohomail.com; s=zohoarc; b=I8Ju4O8BBoC3M2Bzzb9q+/RIfMgBngN4cEhA8XIQg8knCWnSvSEXXlYyZklsW/I0Vg5oIZI9JESKvQi20keIxpPgHJeD1RZkOh6HArcowGCLsISF9M+mmElLkgrMYgZiRpMzzj52J8srjn8r50lBzBZglDwad+iGPkvAgamfov0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142284; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pydUbxiU1H3iPmV+/JsmS6Cq589AJNt5/EbCILkfIkI=; b=d/GeBLYYBjoF8kVleE4B5tbC23rqzZ/96Zk5R2WWtDmt92kd00rT39GRzqtEUhacuupwBmAdWYrHvoHHYqB/ODWkGX+Im7MGOBlUwBxThDnNXBewN0QP5umHW8E8Uiew5S3PwZTzykAFTfQGzmkDeaJtXYWBbidNPWlJ9KJgGsM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142284819313.26119316712277; Wed, 25 Mar 2020 06:18:04 -0700 (PDT) Received: from localhost ([::1]:36108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5v1-00085H-QU for importer@patchew.org; Wed, 25 Mar 2020 09:18:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52972) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5tl-0006Wg-Ug for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5tk-0005uR-OY for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:45 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:28941) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5tk-0005tv-Kr for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:44 -0400 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-nzGyf0RaPCyYrARlzEnduw-1; Wed, 25 Mar 2020 09:16:42 -0400 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 2178A1137843; Wed, 25 Mar 2020 13:16:41 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id B360D5C241; Wed, 25 Mar 2020 13:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pydUbxiU1H3iPmV+/JsmS6Cq589AJNt5/EbCILkfIkI=; b=OV/HA6jKu1Nzi3WEKJ0UKpURtz7rW/2+gOVwvD6IAFn38IcfVGDVMVWvBsPFuniw7ToteJ ls3Kr3o6hMe7aEarm7jo1F2DxH+eRk3eXXL1nU76JFfnKP4lAo9KR8K24Vx+K136KNMm6b ttaXKAubBEaZTz5m0KgQQk5LSJEUiGg= X-MC-Unique: nzGyf0RaPCyYrARlzEnduw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 2/9] xbzrle: update xbzrle doc Date: Wed, 25 Mar 2020 13:16:25 +0000 Message-Id: <20200325131632.311034-3-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi Add new parameter description, also: 1. Remove unsociable space. 2. Nit picking: s/two/2 in report Signed-off-by: Mao Zhongyi Message-Id: <20200320143216.423374-1-maozhongyi@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- docs/xbzrle.txt | 7 ++++++- migration/migration.c | 2 +- monitor/hmp-cmds.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/xbzrle.txt b/docs/xbzrle.txt index c0a7dfd44c..b431bdaf0f 100644 --- a/docs/xbzrle.txt +++ b/docs/xbzrle.txt @@ -92,6 +92,11 @@ Usage power of 2. The cache default value is 64MBytes. (on source only) {qemu} migrate_set_cache_size 256m =20 +Commit 73af8dd8d7 "migration: Make xbzrle_cache_size a migration parameter" +(v2.11.0) deprecated migrate-set-cache-size, therefore, the new parameter +is recommended. + {qemu} migrate_set_parameter xbzrle-cache-size 256m + 4. Start outgoing migration {qemu} migrate -d tcp:destination.host:4444 {qemu} info migrate @@ -108,7 +113,7 @@ power of 2. The cache default value is 64MBytes. (on so= urce only) xbzrle transferred: I kbytes xbzrle pages: J pages xbzrle cache miss: K - xbzrle overflow : L + xbzrle overflow: L =20 xbzrle cache-miss: the number of cache misses to date - high cache-miss ra= te indicates that the cache size is set too low. diff --git a/migration/migration.c b/migration/migration.c index c1d88ace7f..4b26110d57 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1243,7 +1243,7 @@ static bool migrate_params_check(MigrationParameters = *params, Error **errp) error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "xbzrle_cache_size", "is invalid, it should be bigger than target page size" - " and a power of two"); + " and a power of 2"); return false; } =20 diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index c882c9f3cc..76725c2ace 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -303,7 +303,7 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict) info->xbzrle_cache->cache_miss); monitor_printf(mon, "xbzrle cache miss rate: %0.2f\n", info->xbzrle_cache->cache_miss_rate); - monitor_printf(mon, "xbzrle overflow : %" PRIu64 "\n", + monitor_printf(mon, "xbzrle overflow: %" PRIu64 "\n", info->xbzrle_cache->overflow); } =20 --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142491; cv=none; d=zohomail.com; s=zohoarc; b=kjdhbuWfIfFArJ9bZ7a8uiBytzUcjfCC8tuiH8VRz4RqQLE8mmayunx4nCADP11RUmR9JDtUvVF9DNRjh5perGA83qz98hSotMAKCAoskIAQ57h9t8MdDvmQ7niZnCD0q1p213gvjcuuTTgfT14a0fNLYmECgVCfQscXwLmo+8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142491; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nEQLTnESrCkmIYtvp45jrMRH1TdW1/P8cKhXdzg257k=; b=Bx7bcWeTxWF/5biXMkU4oQ+0CEM7WZ9nvcWHRioPwjhG/tuCTMhKPk+37t/YyB2l82nD0spfhtdlhs4CE0CgDY2e4fob674lLePBtgC3Qpv7zz+ceZmgc85BwD+XmQ4PNYevFilaWyaShhnRwJaUIF01nxEw3jyLwKWWhjLJWiA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142491434593.4137987668262; Wed, 25 Mar 2020 06:21:31 -0700 (PDT) Received: from localhost ([::1]:36212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5yM-00066B-GM for importer@patchew.org; Wed, 25 Mar 2020 09:21:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53016) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5ts-0006hB-Fl for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5tr-00067D-8S for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:52 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:43343) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5tr-00066I-3x for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:51 -0400 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-160-ONgN0yWFN7yLdljVZ5jIEA-1; Wed, 25 Mar 2020 09:16:46 -0400 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 C6E6D1005509; Wed, 25 Mar 2020 13:16:43 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EB3D5C241; Wed, 25 Mar 2020 13:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nEQLTnESrCkmIYtvp45jrMRH1TdW1/P8cKhXdzg257k=; b=SnJppTQsoIFTv2pAkyT2S1fDHRj8esyayy9T3ghyw+Xk9TkUDzggO+mG8UX6lSJkh2/E4U UwkoIqHnybJs3CIur4egefTUszYz9xCZAbPVvOXlWDGsOVqTsS9idfCV6FbYI7lstPe6yN HOZgOwPJx8LTZBye6OmS5LVnUSzufa0= X-MC-Unique: ONgN0yWFN7yLdljVZ5jIEA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 3/9] tests/migration: Reduce autoconverge initial bandwidth Date: Wed, 25 Mar 2020 13:16:26 +0000 Message-Id: <20200325131632.311034-4-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 When using max-bandwidth=3D~100Mb/s, this test fails on Travis-CI s390x when configured with --disable-tcg: $ make check-qtest TEST check-qtest-s390x: tests/qtest/boot-serial-test qemu-system-s390x: -accel tcg: invalid accelerator tcg qemu-system-s390x: falling back to KVM TEST check-qtest-s390x: tests/qtest/pxe-test TEST check-qtest-s390x: tests/qtest/test-netfilter TEST check-qtest-s390x: tests/qtest/test-filter-mirror TEST check-qtest-s390x: tests/qtest/test-filter-redirector TEST check-qtest-s390x: tests/qtest/drive_del-test TEST check-qtest-s390x: tests/qtest/device-plug-test TEST check-qtest-s390x: tests/qtest/virtio-ccw-test TEST check-qtest-s390x: tests/qtest/cpu-plug-test TEST check-qtest-s390x: tests/qtest/migration-test ** ERROR:tests/qtest/migration-test.c:1229:test_migrate_auto_converge: 'got_= stop' should be FALSE ERROR - Bail out! ERROR:tests/qtest/migration-test.c:1229:test_migrate_au= to_converge: 'got_stop' should be FALSE make: *** [tests/Makefile.include:633: check-qtest-s390x] Error 1 Per David Gilbert, "it could just be the writing is slow on s390 and the migration thread fast; in which case the autocomplete wouldn't be needed. Perhaps we just need to reduce the bandwidth limit." Tuning the threshold by reducing the initial bandwidth makes the autoconverge test pass. Suggested-by: Dr. David Alan Gilbert Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200323184015.11565-1-philmd@redhat.com> Reviewed-by: Dr. David Alan Gilbert Tested-by: Alex Benn=C3=A9e Signed-off-by: Dr. David Alan Gilbert --- tests/qtest/migration-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 3d6cc83b88..2568c9529c 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1211,7 +1211,7 @@ static void test_migrate_auto_converge(void) * without throttling. */ migrate_set_parameter_int(from, "downtime-limit", 1); - migrate_set_parameter_int(from, "max-bandwidth", 100000000); /* ~100Mb= /s */ + migrate_set_parameter_int(from, "max-bandwidth", 1000000); /* ~1Mb/s */ =20 /* To check remaining size after precopy */ migrate_set_capability(from, "pause-before-switchover", true); --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142400; cv=none; d=zohomail.com; s=zohoarc; b=nrIE7vh2UkBRbEDFYt8QJw84TdTEGbNYfpJxuQLyBpL5RceOHzZpZMSjMaolhgsdI+Z0Hdi2aemPPeH3YEz3yMwGs2v2gW+iTJJSMztp64Iat+ZONtn5vyf3hfmALWfOj5zoIakmYou62y4OM/AV01hgQJnE1WBQK9HZSrAoey4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142400; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JYdtQHSIl4/fYPARd3TKivQvxgloLHQr+oCAfsFFOfo=; b=F4Z8lWOxolY+7kCm7gFEh22S53KWUYV09kOjmnF/Hndt9qVQPchMr2SNBs+SAQD5bscBTqwd2O0rrWsGcYworQd1QBM2zC13J4R4Vxqy+CWQ+EPqlx+Yg1KG4wuplXeUnEpCUcXOCuzJcpB6wZPqj2e1A+06vCDwu7DiDriCXrA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142400222781.6683683629055; Wed, 25 Mar 2020 06:20:00 -0700 (PDT) Received: from localhost ([::1]:36156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5ws-0003Ch-Pa for importer@patchew.org; Wed, 25 Mar 2020 09:19:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53033) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5tt-0006ix-HW for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5ts-0006A6-GD for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:53 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:51828) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5ts-000692-Cf for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:52 -0400 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-33-q6B9-KKKPfGQZRzDEJhO2A-1; Wed, 25 Mar 2020 09:16:47 -0400 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 7C5571005512; Wed, 25 Mar 2020 13:16:46 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 275B25C545; Wed, 25 Mar 2020 13:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JYdtQHSIl4/fYPARd3TKivQvxgloLHQr+oCAfsFFOfo=; b=bssRH1HhxDSLq1Lv6NTKr9rLJmOWcXxLzXATahQoB4SD3qtiC6ukOGPvbxrjhxXlp8cdZX bdkZS9m7GgbCmwiokFE9AVEZkKGtYvnQzJTdMUsV7VODduAPbazkqKs7WXK3oCGSlqiXLb PadRyZbG1U//Asl7mvhXK/DKkBtzvfk= X-MC-Unique: q6B9-KKKPfGQZRzDEJhO2A-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 4/9] hmp/vnc: Fix info vnc list leak Date: Wed, 25 Mar 2020 13:16:27 +0000 Message-Id: <20200325131632.311034-5-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 216.205.24.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" We're iterating the list, and then freeing the iteration pointer rather than the list head. Fixes: 0a9667ecdb6d ("hmp: Update info vnc") Reported-by: Coverity (CID 1421932) Signed-off-by: Dr. David Alan Gilbert Message-Id: <20200323120822.51266-1-dgilbert@redhat.com> Reviewed-by: Peter Maydell Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 76725c2ace..04ca342c51 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -527,10 +527,11 @@ static void hmp_info_vnc_servers(Monitor *mon, VncSer= verInfo2List *server) =20 void hmp_info_vnc(Monitor *mon, const QDict *qdict) { - VncInfo2List *info2l; + VncInfo2List *info2l, *info2l_head; Error *err =3D NULL; =20 info2l =3D qmp_query_vnc_servers(&err); + info2l_head =3D info2l; if (err) { hmp_handle_error(mon, err); return; @@ -559,7 +560,7 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict) info2l =3D info2l->next; } =20 - qapi_free_VncInfo2List(info2l); + qapi_free_VncInfo2List(info2l_head); =20 } #endif --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142294; cv=none; d=zohomail.com; s=zohoarc; b=VZFagGB4WApSXNlvyhXn3npjUeln/XA5lYCIkQ7bUnDNyD3wU3eGc0lGrlxguFtZPsN8jzLw/JUh0y3o2eCnIKm9xc7U7FBqHMgmByZbhOgwZxIOmUVgrHWXlYn0SR1dC5rNVHqy2IvpJ7nxdl6h3NoFbs51blggM/LGqlT8+q8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142294; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=umvOk8bwq+bQkl8WN+BspP5KPXkvD7/fipNx/LETqDE=; b=J9g/ZGucnBTFQJ7cAHzLnmoMVDfyVxsgo4Rn+SVd0rs6Jrw2X2JelOssuJrW81fZvk/KfHiziP0vSFgQ5fjcPvOqdxoaLcegLkyJfGc+CllI7QnZCWuy7SVOmpJaMk9nddtI+LGh6sd5BonzJx9NX3dLnXXu9DAz7Q5bZ2+YNwM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158514229437020.78296000537125; Wed, 25 Mar 2020 06:18:14 -0700 (PDT) Received: from localhost ([::1]:36116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5vB-0008Pm-6S for importer@patchew.org; Wed, 25 Mar 2020 09:18:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53030) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5tt-0006iV-9N for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5ts-00069J-8f for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:53 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:36927) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5ts-00068M-50 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:52 -0400 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-96-jb9rWO4tNNCW1xB_mJtJhA-1; Wed, 25 Mar 2020 09:16:49 -0400 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 800FD1922960; Wed, 25 Mar 2020 13:16:48 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC0D35C298; Wed, 25 Mar 2020 13:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=umvOk8bwq+bQkl8WN+BspP5KPXkvD7/fipNx/LETqDE=; b=GrHr0CoZq3HbuoiUmahSfybxvnCPGaazLEiZrmgncgN+PkkaQDxI8zQy7X9dxZNcruGgSV zga+EHz9DiNkDTYHBgACqDDVJY3M5oweEf12Au0cszzIelPTWjkdToNW0x/PBTqJLjwMHG EL/S5MiymoLNT0kpUjnWoHWH7XizzL4= X-MC-Unique: jb9rWO4tNNCW1xB_mJtJhA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 5/9] tools/virtiofsd/passthrough_ll: Fix double close() Date: Wed, 25 Mar 2020 13:16:28 +0000 Message-Id: <20200325131632.311034-6-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 On success, the fdopendir() call closes fd. Later on the error path we try to close an already-closed fd. This can lead to use-after-free. Fix by only closing the fd if the fdopendir() call failed. Cc: qemu-stable@nongnu.org Fixes: b39bce121b (add dirp_map to hide lo_dirp pointers) Reported-by: Coverity (CID 1421933 USE_AFTER_FREE) Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200321120654.7985-1-philmd@redhat.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 4f259aac70..4c35c95b25 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -1520,8 +1520,7 @@ out_err: if (d) { if (d->dp) { closedir(d->dp); - } - if (fd !=3D -1) { + } else if (fd !=3D -1) { close(fd); } free(d); --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142560; cv=none; d=zohomail.com; s=zohoarc; b=GSh2KWa58CgPook08Djz/UFkk5GzUP/xevYF+p0kOwq02BW7QtXyWG0tGWJnp1yUKqq8pRs593YRv63DosCmXAC3kZ+echmzryLKlUforvF9Fy7ic5jbax8OY1tfiJdHTE/D5Wb5O91Du4ueShVgUcfLxS+72/Xjz+7MFEhKDgM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142560; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=roHxRK0CyW53DrD9unCUVNNTq7w3Riel1xOoeqTB6Fs=; b=OkCeXsVmr0s5rq/x6zf0kpkuZ5pcfvYslZ04cH6cW9HxZdhQVByxDyIRZDDTlOYrUQdMoFWRWCk/iAbUw+zoZVcm95Raw+ckuC2zlPCb/sA2baaWGaC6aGvtODf3PL0WizSJVJ+gqquoCtqgHlDvbyHBCH3oR66vCL/1YAPTfWw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142560871249.0016050394429; Wed, 25 Mar 2020 06:22:40 -0700 (PDT) Received: from localhost ([::1]:36250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5zU-0007nQ-00 for importer@patchew.org; Wed, 25 Mar 2020 09:22:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53048) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5tv-0006mr-UG for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5tu-0006Eb-Og for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:55 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:58467) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5tu-0006Dv-LE for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:54 -0400 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-108-GZKzHfSSO5W-pZXVjUpoEg-1; Wed, 25 Mar 2020 09:16:52 -0400 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 4502E107ACC4; Wed, 25 Mar 2020 13:16:51 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCB5A5C3F8; Wed, 25 Mar 2020 13:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=roHxRK0CyW53DrD9unCUVNNTq7w3Riel1xOoeqTB6Fs=; b=QZn0JNpnbDxHptA7vAprh2JtfLDRoINa/tbGOcDPu42azbetoX7TN20G06W2gj0DLMfN73 hKxBzTypW+yE0tFWHz+xrfwodbl5wm0g4WOPiIVjKZBBgLeAfHzWHcfWtlDBxjZ/jcI+Ly 7ZzkiqUiNrMwfI0ZKb2wfj8KaFBnTyA= X-MC-Unique: GZKzHfSSO5W-pZXVjUpoEg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 6/9] vl.c: fix migration failure for 3.1 and older machine types Date: Wed, 25 Mar 2020 13:16:29 +0000 Message-Id: <20200325131632.311034-7-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Igor Mammedov Migration from QEMU(v4.0) fails when using 3.1 or older machine type. For example if one attempts to migrate QEMU-2.12 started as qemu-system-ppc64 -nodefaults -M pseries-2.12 -m 4096 -mem-path /tmp/ to current master, it will fail with qemu-system-ppc64: Unknown ramblock "ppc_spapr.ram", cannot accept migrat= ion qemu-system-ppc64: error while loading state for instance 0x0 of device '= ram' qemu-system-ppc64: load of migration failed: Invalid argument Caused by 900c0ba373 commit which switches main RAM allocation to memory backends and the fact in 3.1 and older QEMU, backends used full[***] QOM path as memory region name instead of backend's name. That was changed after 3.1 to use prefix-less names by default (fa0cb34d22) for new machine types. *** effectively makes main RAM memory region names defined by MachineClass::default_ram_id being altered with '/objects/' prefix and therefore migration fails as old QEMU sends prefix-less name while new QEMU expects name with prefix when using 3.1 and older machine types. Fix it by forcing implicit[1] memory backend to always use prefix-less names for its memory region by setting 'x-use-canonical-path-for-ramblock-id' property to false. 1) i.e. memory backend created by compat glue which maps -m/-mem-path/-mem-prealloc/default RAM size into appropriate backend type/options to match old CLI format. Fixes: 900c0ba373 Signed-off-by: Igor Mammedov Reported-by: Luk=C3=A1=C5=A1 Doktor Message-Id: <20200304172748.15338-1-imammedo@redhat.com> Tested-by: Luk=C3=A1=C5=A1 Doktor Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Dr. David Alan Gilbert --- softmmu/vl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/softmmu/vl.c b/softmmu/vl.c index 1d33a28340..814537bb42 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2801,6 +2801,9 @@ static void create_default_memdev(MachineState *ms, c= onst char *path) object_property_set_int(obj, ms->ram_size, "size", &error_fatal); object_property_add_child(object_get_objects_root(), mc->default_ram_i= d, obj, &error_fatal); + /* Ensure backend's memory region name is equal to mc->default_ram_id = */ + object_property_set_bool(obj, false, "x-use-canonical-path-for-rambloc= k-id", + &error_fatal); user_creatable_complete(USER_CREATABLE(obj), &error_fatal); object_unref(obj); object_property_set_str(OBJECT(ms), mc->default_ram_id, "memory-backen= d", --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142299; cv=none; d=zohomail.com; s=zohoarc; b=PmG+J49ejKPYtkaU/FhZ17hkHs6ltqDJvb6J+xw0VaiPPp5Jebgn5GRE63GZ1u1TL3Dp8dTFEnixP3b4+IfroVtvYW0ks/0DbfyNNaOqMba+k7uGVpnQ8fJszGmlT2J8hmOR2S/uB4rVTpBVUkJ17Bo6PCtkcaxcw1Blqiz7D2Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142299; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/rpPcwoRo0YJ8IbJdvb/7Apw8Xalqs+hkaNAvH7+1nA=; b=P/m6vUmYfdipO6SM0v7gLTn4gIRrEPK53BzGaH6lwfmsE+c44FpgrNgQ2m86uoTHBLcFIK91jkIVBDXJa7QsknA81jTVlIGXtqUAMF18XHvTYR1TsJVWv6esNLHV/Q+UO+NyIROqO4OSPAqSX0acNYGPMsr18wK7wfTpVQ4i/ZU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142299588468.929039936452; Wed, 25 Mar 2020 06:18:19 -0700 (PDT) Received: from localhost ([::1]:36118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5vG-0000Cz-LZ for importer@patchew.org; Wed, 25 Mar 2020 09:18:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53072) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5ty-0006tN-NF for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5tx-0006JX-OI for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:58 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:44819) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5tx-0006Ip-Ki for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:16:57 -0400 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-148-3Kj2nayxPTSeJO_sZf0nmQ-1; Wed, 25 Mar 2020 09:16:54 -0400 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 1C1EEA1368; Wed, 25 Mar 2020 13:16:53 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E5B85C298; Wed, 25 Mar 2020 13:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/rpPcwoRo0YJ8IbJdvb/7Apw8Xalqs+hkaNAvH7+1nA=; b=MjU/chstvxgu5023JvDAxsF5WMWazLv4fGeMsVFd8npG5Tz2wzIwPvoCq/2prWegOMnFIc ubNkcRe6esp9kU+f2tTjDMGrCd/5011xzFYqJ7z3l7cfPbFmYzfsIsSNYCDKob1YpSzbtD apZjmbhs/r2obs5m6m4CvBMKGgo9DAU= X-MC-Unique: 3Kj2nayxPTSeJO_sZf0nmQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 7/9] migration/colo: fix use after free of local_err Date: Wed, 25 Mar 2020 13:16:30 +0000 Message-Id: <20200325131632.311034-8-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy local_err is used again in secondary_vm_do_failover() after replication_stop_all(), so we must zero it. Otherwise try to set non-NULL local_err will crash. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200324153630.11882-5-vsementsov@virtuozzo.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/colo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/colo.c b/migration/colo.c index 44942c4e23..a54ac84f41 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -93,6 +93,7 @@ static void secondary_vm_do_failover(void) replication_stop_all(true, &local_err); if (local_err) { error_report_err(local_err); + local_err =3D NULL; } =20 /* Notify all filters of all NIC to do checkpoint */ --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142634; cv=none; d=zohomail.com; s=zohoarc; b=d3YOB7IVWMRAFr+f2oP3rmsbmSTFM8EiQowwjLFydoJtgLIJmvKv3AuGgcB+izO26qk3Y7gRNMQwk5/HcGyIKPNDcEtJ+EyYiA11W0x8xrjlI60Fa+PN9cj5FN9eT0Xfx8LHJf2VbZfSn6NslZBdqGMg2XzE5bD3gh2+E+05P6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142634; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zz0Ct3y11qKGgf70xqYznROrobSz7/NPUeqRaoI2Y84=; b=N7tEXkdOVnpxiNxlHhcdmZTS3rOsS2aaLs7idS1745pAlOwGhkXgkmFL4vOFHHd8Xfc+8HtQmChlQW/jwDxuHxE4Gq8mLxwrjPA/E16+Vvi/HpoFOWq+PCuxJJqSB9NmCsIlkW5PUGkiTPMsAL0YYoYal0lGwwwZN54xSf6kXts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142634304461.5713492319999; Wed, 25 Mar 2020 06:23:54 -0700 (PDT) Received: from localhost ([::1]:36284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH60f-0001sg-Fa for importer@patchew.org; Wed, 25 Mar 2020 09:23:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53094) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5u3-00078E-Tm for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:17:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5u2-0006P3-Uf for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:17:03 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:48666) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5u2-0006Oh-R6 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:17:02 -0400 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-182-qsXLFQfNP1C02B-g3i3fSg-1; Wed, 25 Mar 2020 09:17:00 -0400 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 C415619251C0; Wed, 25 Mar 2020 13:16:55 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 680A95C3F8; Wed, 25 Mar 2020 13:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zz0Ct3y11qKGgf70xqYznROrobSz7/NPUeqRaoI2Y84=; b=aItFvmQHfM5di0AyscNCgtO+T7AWap2f3HLtoSuXFzLfJzdFtxgf4JVO8H0JaqX8SSN2cu cR8gWizSC0xILuIiYENbutKOmFvNWt4hr9xB7pFORNiGZUXZPZJ3rvmLQ0mnJMBdBxs/De s3qJPRBYQGfRXwPvCjPispLMoZe1HBo= X-MC-Unique: qsXLFQfNP1C02B-g3i3fSg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 8/9] migration/ram: fix use after free of local_err Date: Wed, 25 Mar 2020 13:16:31 +0000 Message-Id: <20200325131632.311034-9-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 63.128.21.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy local_err is used again in migration_bitmap_sync_precopy() after precopy_notify(), so we must zero it. Otherwise try to set non-NULL local_err will crash. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200324153630.11882-6-vsementsov@virtuozzo.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/ram.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/ram.c b/migration/ram.c index c12cfdbe26..04f13feb2e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -980,6 +980,7 @@ static void migration_bitmap_sync_precopy(RAMState *rs) */ if (precopy_notify(PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC, &local_err)) { error_report_err(local_err); + local_err =3D NULL; } =20 migration_bitmap_sync(rs); --=20 2.25.1 From nobody Thu Apr 25 18:59:14 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=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1585142404; cv=none; d=zohomail.com; s=zohoarc; b=ISbi03aFFs9i1lXNJ6b3hYWWhmAunUL4KsvRXJZStG26RfwVvoErrXmuOhHXltIK1mLMYxeaIkuYenozRWISCV19VlvVv94eHFrdy0HC4pKa1b0ct4/Tzpv2sKp/nScdIq0nxJzybdSLILmUIEsqnNc0xm9C1xQmqrtGDeT0fqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585142404; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZdQEFDx+CXSDBGvTAB5sIDuw+cC9KWpbTVeUiMmRYAc=; b=meuqXbwJfj8YNqAzYGYmSLEqCBnxUuzPGw4EPFvgBKgxQwvg8YGg9Lo1I14wZRYZ/VmLsKxjmMMzn0CnyvzvI2xzUoSFaCOu2XacMcdXVAdIdczYYRvhZFBeEzYs5cSn8/xvokn0a7a8ircbpob7XnjlHJVUSZD3WeKjzjU5MKc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585142404608175.35123588611964; Wed, 25 Mar 2020 06:20:04 -0700 (PDT) Received: from localhost ([::1]:36160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5wx-0003Pq-PG for importer@patchew.org; Wed, 25 Mar 2020 09:20:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53083) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH5u2-00074M-F3 for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:17:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH5u1-0006Nb-8g for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:17:02 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:50209) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jH5u1-0006NO-5B for qemu-devel@nongnu.org; Wed, 25 Mar 2020 09:17:01 -0400 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-89-C4MujUplNGiLL0boZWio2w-1; Wed, 25 Mar 2020 09:16:58 -0400 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 72898802687; Wed, 25 Mar 2020 13:16:57 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-213.ams2.redhat.com [10.36.114.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C84E5C298; Wed, 25 Mar 2020 13:16:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585142220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZdQEFDx+CXSDBGvTAB5sIDuw+cC9KWpbTVeUiMmRYAc=; b=i6lPXk3YqZcPPi7TKPr9q8eLOs0Ce+tbSkPNIVP0Kuc/1nM1dHesxIYOUFPOHWFwvFxHoB PbNQR5Agg+TTM3nAnlordkngNseLey1Bh+nrRaNE/3wf9o+cpn0zyr7NNK6dKt+Lg0jrkT 41/C0POjvi5DIMzheMLjetzX/8yyA50= X-MC-Unique: C4MujUplNGiLL0boZWio2w-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, pannengyuan@huawei.com, maozhongyi@cmss.chinamobile.com, vsementsov@virtuozzo.com, imammedo@redhat.com, philmd@redhat.com Subject: [PULL 9/9] migration: use "" instead of (null) for tls-authz Date: Wed, 25 Mar 2020 13:16:32 +0000 Message-Id: <20200325131632.311034-10-dgilbert@redhat.com> In-Reply-To: <20200325131632.311034-1-dgilbert@redhat.com> References: <20200325131632.311034-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: 216.205.24.74 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi run: (qemu) info migrate_parameters announce-initial: 50 ms ... announce-max: 550 ms multifd-compression: none xbzrle-cache-size: 4194304 max-postcopy-bandwidth: 0 tls-authz: '(null)' Migration parameter 'tls-authz' is used to provide the QOM ID of a QAuthZ subclass instance that provides the access control check, default is NULL. But the empty string is not a valid object ID, so use "" instead of the default. Although it will fail when lookup an object with ID "", it is harmless, just consistent with tls_creds. As a bonus, this patch also fixed the bad indentation on the last line and removed 'has_tls_authz' redundant check in 'hmp_info_migrate_parameters'. Signed-off-by: Mao Zhongyi Message-Id: <119f539a9f4d198bc3bcced46b8280520d60bc51.1585100802.git.maozho= ngyi@cmss.chinamobile.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 3 ++- monitor/hmp-cmds.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 4b26110d57..c4c9aee15e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -790,7 +790,8 @@ MigrationParameters *qmp_query_migrate_parameters(Error= **errp) params->has_tls_hostname =3D true; params->tls_hostname =3D g_strdup(s->parameters.tls_hostname); params->has_tls_authz =3D true; - params->tls_authz =3D g_strdup(s->parameters.tls_authz); + params->tls_authz =3D g_strdup(s->parameters.tls_authz ? + s->parameters.tls_authz : ""); params->has_max_bandwidth =3D true; params->max_bandwidth =3D s->parameters.max_bandwidth; params->has_downtime_limit =3D true; diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 04ca342c51..9b94e67879 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -459,9 +459,9 @@ void hmp_info_migrate_parameters(Monitor *mon, const QD= ict *qdict) monitor_printf(mon, "%s: %" PRIu64 "\n", MigrationParameter_str(MIGRATION_PARAMETER_MAX_POSTCOPY_BANDWI= DTH), params->max_postcopy_bandwidth); - monitor_printf(mon, " %s: '%s'\n", + monitor_printf(mon, "%s: '%s'\n", MigrationParameter_str(MIGRATION_PARAMETER_TLS_AUTHZ), - params->has_tls_authz ? params->tls_authz : ""); + params->tls_authz); } =20 qapi_free_MigrationParameters(params); --=20 2.25.1