From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289161; cv=none; d=zohomail.com; s=zohoarc; b=oEeoQse4VyPv4JjuWp/ENMaeyr+LtI2Rhb/kPZff0BcdNcS5Vb2NTGAQk3FPjriODkYQAVtXxCzAtFvONjZ/ZmtR8Vt98vfF6vkmUAktOJyhy3zC4m31OaP63KQFVb/Bj9s8sjKLSL1a6Z28OUsgJO3O+EJ8NxTdk9eun1JKf/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289161; h=Content-Type:Content-Transfer-Encoding:Cc: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=URWDH+XKEt/gpNiPkBNfvIfcJxqjt+YfyQ8FsN1TzTo=; b=VjrfrGlk1oq3LSQK8Ibh6gSEgUMcFKwwq6c9x+id5CA01rop5cDXuyWEX3m7P3xiy6TcrNZdijbW0w1Uj3JSaTmlW8NrzUzyNWEUS2x/UHTE8A0t3SpbWRlJ1fdSEKPRqjLOaS07vxn89RTe4Ejb8ucqZZ6cmxsr+hGQ+z/wST8= ARC-Authentication-Results: i=1; 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 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 1608289161946105.46636987111333; Fri, 18 Dec 2020 02:59:21 -0800 (PST) Received: from localhost ([::1]:40374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDTk-0007EX-RL for importer@patchew.org; Fri, 18 Dec 2020 05:59:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCa-00034H-GV for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCW-0004Vr-M5 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:35 -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-245-ZvMuWnUbOly0qkpZwqFXVw-1; Fri, 18 Dec 2020 05:41:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 69D8B800D62; Fri, 18 Dec 2020 10:41:27 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6537C60C15; Fri, 18 Dec 2020 10:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288090; 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=URWDH+XKEt/gpNiPkBNfvIfcJxqjt+YfyQ8FsN1TzTo=; b=LLbxZf0bAWAsT3Yc3MpFO0LUE45+R1TlQiZ8zRKlVmPgzEhwax4lR04HU/vYoyeOOEW+A3 A96wda6cD7jAxe5QY99r92olgw3/MlhSM4NRbtVP3j9i0qFfSk0e3FBJfYCLRM6zPkjzUt sK35AaZveSYFPbXWfDvdvRNndRdlkSU= X-MC-Unique: ZvMuWnUbOly0qkpZwqFXVw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 01/15] monitor:open brace '{' following struct go on the same line Date: Fri, 18 Dec 2020 10:41:03 +0000 Message-Id: <20201218104117.199096-2-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Yutao Ai Move the open brace '{' following struct go on the same line Signed-off-by: Yutao Ai Message-Id: <20201125014514.55562-2-aiyutao@huawei.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- monitor/hmp-cmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 65d8ff4849..79c84322b3 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1549,8 +1549,7 @@ end: hmp_handle_error(mon, err); } =20 -typedef struct HMPMigrationStatus -{ +typedef struct HMPMigrationStatus { QEMUTimer *timer; Monitor *mon; bool is_block_migration; --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608288859; cv=none; d=zohomail.com; s=zohoarc; b=Hv2rCGN1z/Xsrygj/scEnurAmuNDyoXlmb8yOIxdV3QfZ6SgUeaPjRjbdDqLEUtm2WuQgKM7h/d+zVVaC4ePBqjFc5jFK+v4cZFhmFB0lz7nmnZr1p8f8rbLoRBSGbMxV9CqyJuPw2JlhdAx+2HCblZKCH1BbbGhIoPkw1pthT8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608288859; h=Content-Type:Content-Transfer-Encoding:Cc: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=zrzrX6iuzJhbcG2ZgfN5m25KcePFqyYFOUMkOpfCM58=; b=Em12UI1G+K+a+GcI1v/hySd9qTz7SL+0P5ixpEMKN8DABNvTEkLx9j2c/7eB9ViiJ0CP9ztpIjYWjRHtSHNAA3rwbDCdxrcb8heuItBM/iw5EgEmcnUSV7/ssusaDUax+hGEBnEiNIRQsm9rCjD93Qlhr7M3vM7EPM1a2mfpgBM= ARC-Authentication-Results: i=1; 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 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 1608288859788870.1530021826172; Fri, 18 Dec 2020 02:54:19 -0800 (PST) Received: from localhost ([::1]:52046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDOs-0000H5-QC for importer@patchew.org; Fri, 18 Dec 2020 05:54:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCc-00035W-7I for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCa-0004Y6-A9 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:37 -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-594-RZdtS8yuPX2007VWnWBwkQ-1; Fri, 18 Dec 2020 05:41:31 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E90E51005D44; Fri, 18 Dec 2020 10:41:29 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id B818B60C15; Fri, 18 Dec 2020 10:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288095; 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=zrzrX6iuzJhbcG2ZgfN5m25KcePFqyYFOUMkOpfCM58=; b=X872hwezfga6jbBG83iPs7QZL9CW9oyjWoC5C9gjbaYo+Iqmu7auDoGYMWp5P4KjbXu5aG /Zy3yAEyEEHg7cnYSM5V02Ubv2tmgTLm95KHl+4jc4AtwW+qH/DtGIyYVQXW5De9TyhWLI X/OKkf+FfuUgRYqufsRW22KTFUSWiZs= X-MC-Unique: RZdtS8yuPX2007VWnWBwkQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 02/15] monitor:braces {} are necessary for all arms of this statement Date: Fri, 18 Dec 2020 10:41:04 +0000 Message-Id: <20201218104117.199096-3-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Yutao Ai Fix the errors by add {} Signed-off-by: Yutao Ai Message-Id: <20201125014514.55562-3-aiyutao@huawei.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- monitor/misc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/monitor/misc.c b/monitor/misc.c index fde6e36a0b..09f9a74d78 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -492,8 +492,10 @@ static void hmp_singlestep(Monitor *mon, const QDict *= qdict) static void hmp_gdbserver(Monitor *mon, const QDict *qdict) { const char *device =3D qdict_get_try_str(qdict, "device"); - if (!device) + if (!device) { device =3D "tcp::" DEFAULT_GDBSTUB_PORT; + } + if (gdbserver_start(device) < 0) { monitor_printf(mon, "Could not open gdbserver on device '%s'\n", device); @@ -559,10 +561,11 @@ static void memory_dump(Monitor *mon, int count, int = format, int wsize, } =20 len =3D wsize * count; - if (wsize =3D=3D 1) + if (wsize =3D=3D 1) { line_size =3D 8; - else + } else { line_size =3D 16; + } max_digits =3D 0; =20 switch(format) { @@ -583,10 +586,11 @@ static void memory_dump(Monitor *mon, int count, int = format, int wsize, } =20 while (len > 0) { - if (is_physical) + if (is_physical) { monitor_printf(mon, TARGET_FMT_plx ":", addr); - else + } else { monitor_printf(mon, TARGET_FMT_lx ":", (target_ulong)addr); + } l =3D len; if (l > line_size) l =3D line_size; --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289358; cv=none; d=zohomail.com; s=zohoarc; b=i3GmDPSHM04SsF9trblcR5ZvciNiJFxyE3ZPnFCkJc+QfyqJhA8+QpvxjDE7GdQU3WmpjAKlddnL+FKS1PLWoJbR/i1ckPY9HdvFqBHQhcPLuPVnQqYqTzIaJIbaHSVG56091xNMUjs1o6KkRgilVxwkIooUJxAiBb1GVx+i/RI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289358; h=Content-Type:Content-Transfer-Encoding:Cc: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=rxhTpWjjggPSysnfNJSR2RuDfOejyTuimqUQkrjiBT0=; b=gtc6sPt3hTaoKfZRQtdQK2R36aElWzTK7JLFo/TMSyGFjcCxZEw6X8bFXoGWzBc3eoXgCnG0cNxwqx0mB8CmIZPsao57C8gAqcubGRlrsYlY5rJGU4i3tH0fhCkyo563mFbJuafjqsUKeep0EqYruVf3OIPAqK0bByqIrZatfYM= ARC-Authentication-Results: i=1; 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 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 1608289357966339.6790348831157; Fri, 18 Dec 2020 03:02:37 -0800 (PST) Received: from localhost ([::1]:48236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDWr-00028H-QZ for importer@patchew.org; Fri, 18 Dec 2020 06:02:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCe-00039Z-C1 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCc-0004Yv-JP for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:39 -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-447-MRJ3Ot_gOqaCVcNgxdUPag-1; Fri, 18 Dec 2020 05:41:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 43E8A801B12; Fri, 18 Dec 2020 10:41:32 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 423A660C15; Fri, 18 Dec 2020 10:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288097; 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=rxhTpWjjggPSysnfNJSR2RuDfOejyTuimqUQkrjiBT0=; b=KueNAHi5YxfEgl4EOpblQxsEkZkTOhfCWIS62v+fL1tj4Tj7yFAzOsRhNZYtdIO/aYk5cx tKg7Wwzk6uvCWALQh8lddAfX/tYkaKN4NAN9CqlYcvOyO46gCsoMO3zSyzFs0d9vReU8Q5 MyUTqo8gT3Q7nSXgqnlPX5iberXvrhE= X-MC-Unique: MRJ3Ot_gOqaCVcNgxdUPag-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 03/15] monitor:Don't use '#' flag of printf format ('%#') in format strings Date: Fri, 18 Dec 2020 10:41:05 +0000 Message-Id: <20201218104117.199096-4-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Yutao Ai Delete '#' and use '0x' prefix instead Signed-off-by: Yutao Ai Message-Id: <20201125014514.55562-4-aiyutao@huawei.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Dr. David Alan Gilbert --- monitor/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/misc.c b/monitor/misc.c index 09f9a74d78..6f5ae096dc 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -919,7 +919,7 @@ static void hmp_ioport_read(Monitor *mon, const QDict *= qdict) suffix =3D 'l'; break; } - monitor_printf(mon, "port%c[0x%04x] =3D %#0*x\n", + monitor_printf(mon, "port%c[0x%04x] =3D 0x%0*x\n", suffix, addr, size * 2, val); } =20 --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289479; cv=none; d=zohomail.com; s=zohoarc; b=kU76jCN/h7kvonXoYM54uM+n0qpP3XjcYeW5sTQA5BV4oWyj2pGw14Klxiqpi6zsJbo3WXgReFKiTa5oYqUvqtgQk+Sr+yRCn4lbhYImNTy2vMlIBrQSpbWAseNBu/7ncTpqpHvPlHeMdUlHibmPfzTstp7kY9LBxg3sIjCNOyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289479; h=Content-Type:Content-Transfer-Encoding:Cc: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=LiuSidoZ4b3nzeLi7xd9yoxYKpdJwxFrBO3uu3stHxo=; b=iq/j+y4hUDpnpKcktOtI3uq9CY9GjLLtZmcVetLnDHQb6+/vuj6N91ScWx0aFvgJ4h2HoSesBfpC8c4pyQE6IYJ1cFsf3OOUWWhJYX6BQ0iIpIDF10cuk4GmazLBTlgl9VBXFhSNErG9b+/NDruP6mWDNbSw5jkvgIcHzJztPh0= ARC-Authentication-Results: i=1; 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 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 1608289479245428.0394966004319; Fri, 18 Dec 2020 03:04:39 -0800 (PST) Received: from localhost ([::1]:55214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDYr-00054p-Gt for importer@patchew.org; Fri, 18 Dec 2020 06:04:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCh-0003HN-Gn for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:44 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCe-0004ZV-Kk for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:43 -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-177-CZi41f2OOCCa3NWcj05f6w-1; Fri, 18 Dec 2020 05:41:35 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 970C5107ACE3; Fri, 18 Dec 2020 10:41:34 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91C9B60C15; Fri, 18 Dec 2020 10:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288100; 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=LiuSidoZ4b3nzeLi7xd9yoxYKpdJwxFrBO3uu3stHxo=; b=KXoTMwtOn/pIURoyKR0a1DwiuXWrVl/JoLWV9CakZcmHsDfWm47faiH2OvUHdUX7a/SCM6 u4b9PaBLfKJynxYUOLYSiX5MB8SiIPkNMKaq22/dbhjLQPijmDiIpp9vwZcT3CJCLzZuZa F+vTsmyP6lNAdlAGi9n4TevHx+yJRp8= X-MC-Unique: CZi41f2OOCCa3NWcj05f6w-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 04/15] hmp-commands.hx: List abbreviation after command for cont, quit, print Date: Fri, 18 Dec 2020 10:41:06 +0000 Message-Id: <20201218104117.199096-5-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Peter Maydell We have four HMP commands which have a single-character abbreviated version: cont ('c'), quit ('q'), print ('p') and help ('h'). For cont, quit and print, we list the abbreviation first in the help documentation and the command name. This has the odd effect that in the full 'help' command list these commands end up sorted out of alphabetical order (they end up after all the other commands that start with the same letter). As it happens, the only place this currently changes the order is for 'cont'. Abbreviation first is also not a very logical order, and it doesn't match what we use for 'help' (which is 'help|?'). Put the full command name first in both the help text and the .name field for cont, quit and print. Fixes: https://bugs.launchpad.net/qemu/+bug/1614609 Signed-off-by: Peter Maydell Message-Id: <20201121151711.20783-1-peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- hmp-commands.hx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 470a420c2d..73e0832ea1 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -40,7 +40,7 @@ SRST ERST =20 { - .name =3D "q|quit", + .name =3D "quit|q", .args_type =3D "", .params =3D "", .help =3D "quit the emulator", @@ -49,7 +49,7 @@ ERST }, =20 SRST -``q`` or ``quit`` +``quit`` or ``q`` Quit the emulator. ERST =20 @@ -401,7 +401,7 @@ SRST ERST =20 { - .name =3D "c|cont", + .name =3D "cont|c", .args_type =3D "", .params =3D "", .help =3D "resume emulation", @@ -409,7 +409,7 @@ ERST }, =20 SRST -``c`` or ``cont`` +``cont`` or ``c`` Resume emulation. ERST =20 @@ -554,7 +554,7 @@ SRST ERST =20 { - .name =3D "p|print", + .name =3D "print|p", .args_type =3D "fmt:/,val:l", .params =3D "/fmt expr", .help =3D "print expression value (use $reg for CPU register= access)", @@ -562,7 +562,7 @@ ERST }, =20 SRST -``p`` or ``print/``\ *fmt* *expr* +``print`` or ``p/``\ *fmt* *expr* Print expression value. Only the *format* part of *fmt* is used. ERST --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289359; cv=none; d=zohomail.com; s=zohoarc; b=ZLXAGfTYZb/I2vHw68Y/GM3N5tARhdf9K9wbOSKxDmIwVIbOwmClkn4ElMgxsZTQzVFZe3kZh97t1wG8+VBgsOhbXEZXEj1R1N4Zbgf8ZfAq/sC7FWJ2e+AmMqr53qathlWrKeSJCnvL/M7clceujkKsWnv4cawy4D3wgvq0Z68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289359; h=Content-Type:Content-Transfer-Encoding:Cc: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=w0nkvQYI5RGRxsFjUD91f2WONLDlvHrVWt56hOA4xfc=; b=XbnvZ5HTwedVsdME7Kou6yT/YUzjdW4Bax4Mj0YSR0r4k4IrxamKedCEHSN/5jVJyzXroOP5Z9uCN4xlBwXJNicXZaXAs/rT0XLOXcJZg+ND6JQrLwVpC4DPN2NmHXe/2IO5VFM2rKx4v/Ic9QJp7b58+p+4QfnW4KPfT4dAkUM= ARC-Authentication-Results: i=1; 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 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 1608289359889997.5774543223771; Fri, 18 Dec 2020 03:02:39 -0800 (PST) Received: from localhost ([::1]:48750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDWv-0002Mb-O3 for importer@patchew.org; Fri, 18 Dec 2020 06:02:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCg-0003Cn-BJ for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29351) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCe-0004ZT-IY for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:42 -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-315-4CA8ct6aNvaIpKt0s6r2Hw-1; Fri, 18 Dec 2020 05:41:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9025801817; Fri, 18 Dec 2020 10:41:36 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id E408660C15; Fri, 18 Dec 2020 10:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288100; 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=w0nkvQYI5RGRxsFjUD91f2WONLDlvHrVWt56hOA4xfc=; b=XwE5CUHpbp468wBeHxQYf7lhAaCmmK+U8Rxaw7723AzldSZMYJI7Avc5EqyYY404toTEVs qENMMlirsxMp9P4xXKQxLUazd3F4UXGH0fMwenIUu0+djJBtVS/X5Z/6VTmCrxYOXa5Cxo QfAYfCSs6RirHxwY3Marp3zGsnouubk= X-MC-Unique: 4CA8ct6aNvaIpKt0s6r2Hw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 05/15] virtiofsd: Use --thread-pool-size=0 to mean no thread pool Date: Fri, 18 Dec 2020 10:41:07 +0000 Message-Id: <20201218104117.199096-6-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Vivek Goyal Right now we create a thread pool and main thread hands over the request to thread in thread pool to process. Number of threads in thread pool can be managed by option --thread-pool-size. In tests we have noted that many of the workloads are getting better performance if we don't use a thread pool at all and process all the requests in the context of a thread receiving the request. Hence give user an option to be able to run virtiofsd without using a thread pool. To implement this, I have used existing option --thread-pool-size. This option defines how many maximum threads can be in the thread pool. Thread pool size zero freezes thead pool. I can't see why will one start virtiofsd with a frozen thread pool (hence frozen file system). So I am redefining --thread-pool-size=3D0 to mean, don't use a thread pool. Instead process the request in the context of thread receiving request from the queue. Signed-off-by: Vivek Goyal Message-Id: <20201109143548.GA1479853@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 36 ++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index b264dcbd18..ddcefee427 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -578,13 +578,18 @@ static void *fv_queue_thread(void *opaque) struct VuDev *dev =3D &qi->virtio_dev->dev; struct VuVirtq *q =3D vu_get_queue(dev, qi->qidx); struct fuse_session *se =3D qi->virtio_dev->se; - GThreadPool *pool; - - pool =3D g_thread_pool_new(fv_queue_worker, qi, se->thread_pool_size, = FALSE, - NULL); - if (!pool) { - fuse_log(FUSE_LOG_ERR, "%s: g_thread_pool_new failed\n", __func__); - return NULL; + GThreadPool *pool =3D NULL; + GList *req_list =3D NULL; + + if (se->thread_pool_size) { + fuse_log(FUSE_LOG_DEBUG, "%s: Creating thread pool for Queue %d\n", + __func__, qi->qidx); + pool =3D g_thread_pool_new(fv_queue_worker, qi, se->thread_pool_si= ze, + FALSE, NULL); + if (!pool) { + fuse_log(FUSE_LOG_ERR, "%s: g_thread_pool_new failed\n", __fun= c__); + return NULL; + } } =20 fuse_log(FUSE_LOG_INFO, "%s: Start for queue %d kick_fd %d\n", __func_= _, @@ -659,14 +664,27 @@ static void *fv_queue_thread(void *opaque) =20 req->reply_sent =3D false; =20 - g_thread_pool_push(pool, req, NULL); + if (!se->thread_pool_size) { + req_list =3D g_list_prepend(req_list, req); + } else { + g_thread_pool_push(pool, req, NULL); + } } =20 pthread_mutex_unlock(&qi->vq_lock); pthread_rwlock_unlock(&qi->virtio_dev->vu_dispatch_rwlock); + + /* Process all the requests. */ + if (!se->thread_pool_size && req_list !=3D NULL) { + g_list_foreach(req_list, fv_queue_worker, qi); + g_list_free(req_list); + req_list =3D NULL; + } } =20 - g_thread_pool_free(pool, FALSE, TRUE); + if (pool) { + g_thread_pool_free(pool, FALSE, TRUE); + } =20 return NULL; } --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289398; cv=none; d=zohomail.com; s=zohoarc; b=oDcS86KEQ8pWGeUf6ikE3eG9yLpXGTVMv17gu2ZffKpA47xXtjBibxQxbcZLRmhT1xEHuHzpR3eOt5so/wuofbv5XtgCKyUlv3fnd5SgQ5QHn7SRELoWZPGMmP4Wxj+5FYTHhvdCYdxaFqrZDCkcUNU4e535SemyfKlPfXP0xWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289398; h=Content-Type:Content-Transfer-Encoding:Cc: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=oL9B5pHuDTvl/C4Q0ubbRuu7tz9UoMdEJ0xwOaoJb38=; b=Rpq63tQmkEFlwPkNTVxmhyoA2Sii27mQOBTNtUR7tJr8vX4gUHaP/4lOw1S+6Fyxs19XbgyvYh/GK1iS9k/Vf/gk4WPgutn9JtVL9HLuQMB2XooQ+ykeUqmVkEvDV7ixLWvFuL8kOVe36XDgOtq6OroKq0AQA482OIFbb0jUZHk= ARC-Authentication-Results: i=1; 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 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 1608289398905951.4735774111928; Fri, 18 Dec 2020 03:03:18 -0800 (PST) Received: from localhost ([::1]:51622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDXZ-0003Yy-Ai for importer@patchew.org; Fri, 18 Dec 2020 06:03:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCk-0003LA-RM for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCi-0004ax-OY for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41: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-517-byaIMiSXOv6Kyb0wnH5i0Q-1; Fri, 18 Dec 2020 05:41:41 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 47D10107ACE4; Fri, 18 Dec 2020 10:41:39 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4545D60C15; Fri, 18 Dec 2020 10:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288103; 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=oL9B5pHuDTvl/C4Q0ubbRuu7tz9UoMdEJ0xwOaoJb38=; b=XgrtMmdyAYnGSvQl0oprEx0nQCKzSNZ84OmvWWYJ3zILWeRPUclTUOTHWU1jmgxQPDnobU NkxPpl1c5My7kmgk0AQDsEfT70UXz5qyqnzQi909jaIjB8J9EWNCXxp6aDm6jV4vj/vYFO oGbqkM0wgcH+ogAsqdAlUE5DGn0HwuE= X-MC-Unique: byaIMiSXOv6Kyb0wnH5i0Q-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 06/15] virtiofsd: make the debug log timestamp on stderr more human-readable Date: Fri, 18 Dec 2020 10:41:08 +0000 Message-Id: <20201218104117.199096-7-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Laszlo Ersek The current timestamp format doesn't help me visually notice small jumps in time ("small" as defined on human scale, such as a few seconds or a few ten seconds). Replace it with a local time format where such differences stand out. Before: > [13316826770337] [ID: 00000004] unique: 62, opcode: RELEASEDIR (29), node= id: 1, insize: 64, pid: 1 > [13316826778175] [ID: 00000004] unique: 62, success, outsize: 16 > [13316826781156] [ID: 00000004] virtio_send_msg: elem 0: with 1 in desc o= f length 16 > [15138279317927] [ID: 00000001] virtio_loop: Got VU event > [15138279504884] [ID: 00000001] fv_queue_set_started: qidx=3D1 started=3D0 > [15138279519034] [ID: 00000003] fv_queue_thread: kill event on queue 1 - = quitting > [15138280876463] [ID: 00000001] fv_remove_watch: TODO! fd=3D9 > [15138280897381] [ID: 00000001] virtio_loop: Waiting for VU event > [15138280946834] [ID: 00000001] virtio_loop: Got VU event > [15138281175421] [ID: 00000001] virtio_loop: Waiting for VU event > [15138281182387] [ID: 00000001] virtio_loop: Got VU event > [15138281189474] [ID: 00000001] virtio_loop: Waiting for VU event > [15138309321936] [ID: 00000001] virtio_loop: Unexpected poll revents 11 > [15138309434150] [ID: 00000001] virtio_loop: Exit (Notice how you don't (easily) notice the gap in time after "virtio_send_msg", and especially the amount of time passed is hard to estimate.) After: > [2020-12-08 06:43:22.58+0100] [ID: 00000004] unique: 51, opcode: RELEASED= IR (29), nodeid: 1, insize: 64, pid: 1 > [2020-12-08 06:43:22.58+0100] [ID: 00000004] unique: 51, success, outs= ize: 16 > [2020-12-08 06:43:22.58+0100] [ID: 00000004] virtio_send_msg: elem 0: wit= h 1 in desc of length 16 > [2020-12-08 06:43:29.34+0100] [ID: 00000001] virtio_loop: Got VU event > [2020-12-08 06:43:29.34+0100] [ID: 00000001] fv_queue_set_started: qidx= =3D1 started=3D0 > [2020-12-08 06:43:29.34+0100] [ID: 00000003] fv_queue_thread: kill event = on queue 1 - quitting > [2020-12-08 06:43:29.34+0100] [ID: 00000001] fv_remove_watch: TODO! fd=3D9 > [2020-12-08 06:43:29.34+0100] [ID: 00000001] virtio_loop: Waiting for VU = event > [2020-12-08 06:43:29.34+0100] [ID: 00000001] virtio_loop: Got VU event > [2020-12-08 06:43:29.34+0100] [ID: 00000001] virtio_loop: Waiting for VU = event > [2020-12-08 06:43:29.34+0100] [ID: 00000001] virtio_loop: Got VU event > [2020-12-08 06:43:29.34+0100] [ID: 00000001] virtio_loop: Waiting for VU = event > [2020-12-08 06:43:29.37+0100] [ID: 00000001] virtio_loop: Unexpected poll= revents 11 > [2020-12-08 06:43:29.37+0100] [ID: 00000001] virtio_loop: Exit Cc: "Dr. David Alan Gilbert" Cc: Stefan Hajnoczi Signed-off-by: Laszlo Ersek Message-Id: <20201208055043.31548-1-lersek@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 12de321745..e61cc56530 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -3284,18 +3284,38 @@ static void setup_nofile_rlimit(unsigned long rlimi= t_nofile) static void log_func(enum fuse_log_level level, const char *fmt, va_list a= p) { g_autofree char *localfmt =3D NULL; + struct timespec ts; + struct tm tm; + char sec_fmt[sizeof "2020-12-07 18:17:54"]; + char zone_fmt[sizeof "+0100"]; =20 if (current_log_level < level) { return; } =20 if (current_log_level =3D=3D FUSE_LOG_DEBUG) { - if (!use_syslog) { - localfmt =3D g_strdup_printf("[%" PRId64 "] [ID: %08ld] %s", - get_clock(), syscall(__NR_gettid), = fmt); - } else { + if (use_syslog) { + /* no timestamp needed */ localfmt =3D g_strdup_printf("[ID: %08ld] %s", syscall(__NR_ge= ttid), fmt); + } else { + /* try formatting a broken-down timestamp */ + if (clock_gettime(CLOCK_REALTIME, &ts) !=3D -1 && + localtime_r(&ts.tv_sec, &tm) !=3D NULL && + strftime(sec_fmt, sizeof sec_fmt, "%Y-%m-%d %H:%M:%S", + &tm) !=3D 0 && + strftime(zone_fmt, sizeof zone_fmt, "%z", &tm) !=3D 0) { + localfmt =3D g_strdup_printf("[%s.%02ld%s] [ID: %08ld] %s", + sec_fmt, + ts.tv_nsec / (10L * 1000 * 1000= ), + zone_fmt, syscall(__NR_gettid), + fmt); + } else { + /* fall back to a flat timestamp */ + localfmt =3D g_strdup_printf("[%" PRId64 "] [ID: %08ld] %s= ", + get_clock(), syscall(__NR_getti= d), + fmt); + } } fmt =3D localfmt; } @@ -3416,6 +3436,9 @@ int main(int argc, char *argv[]) struct lo_map_elem *reserve_elem; int ret =3D -1; =20 + /* Initialize time conversion information for localtime_r(). */ + tzset(); + /* Don't mask creation mode, kernel already did that */ umask(0); =20 --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289003; cv=none; d=zohomail.com; s=zohoarc; b=AIPqmJzPiJZeS7PxoITefO5uB3HMnj7lByPD4wTGBOUPgyYIO+d/jOZi81EFXyCKlKpcztlQctAMddPyujyLy6l0czHoka9Df2aEmH0VidB4kMjBJ/8hAMd8iyLp1gum6jRtd9aubcxA1qxaL7JdrfBQCBXpolUnZgDUAPDoaKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289003; h=Content-Type:Content-Transfer-Encoding:Cc: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=VEJJ1eMzdn/M1vp+/kmUhDwqf3aCJzpJCEUEebhldOY=; b=FbPnWXk08ltSQLif3Sze8sX0T9vvJJV4PvnaSUbVUhPsCgSXVrRgYllZ8OOeK+huofkfb5g5SGF1zeId4Yak/eMkEOqReyY9fUCgLTxlbsaRlwJrqmcYTdD/ERkew3aKv1Qpl9GaGNQPZIPflLDx41Hr40iKXbPF/bEMiseCMjY= ARC-Authentication-Results: i=1; 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 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 1608289003870142.1155741785401; Fri, 18 Dec 2020 02:56:43 -0800 (PST) Received: from localhost ([::1]:60446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDRC-0003qf-QA for importer@patchew.org; Fri, 18 Dec 2020 05:56:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCp-0003QQ-K0 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCn-0004cw-SU for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:51 -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-50-RaCx7Qb4P6inDh1gYpjUXw-1; Fri, 18 Dec 2020 05:41:45 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A5D8E1005504; Fri, 18 Dec 2020 10:41:44 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 938E060C15; Fri, 18 Dec 2020 10:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288109; 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=VEJJ1eMzdn/M1vp+/kmUhDwqf3aCJzpJCEUEebhldOY=; b=aIFt8qfAK5VqpLK9nVInxh1Y+AejHJHzzUjc0a43XjgF9i1rWrciwaIZk+qsialS1Ity8u 499S2d7fQNAblb7a8sL/gOIiAmj63m31hPOMUsumZ5PiK8BgNlL4eVVGDi3sjg/j2R/CEM hgNiu9oqrZqf83GfMiEONNLNRavXqFc= X-MC-Unique: RaCx7Qb4P6inDh1gYpjUXw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 07/15] virtiofsd: Set up posix_lock hash table for root inode Date: Fri, 18 Dec 2020 10:41:09 +0000 Message-Id: <20201218104117.199096-8-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Vivek Goyal We setup per inode hash table ->posix_lock to support remote posix locks. But we forgot to initialize this table for root inode. Laszlo managed to trigger an issue where he sent a FUSE_FLUSH request for root inode and lo_flush() found inode with inode->posix_lock NULL and accessing this table crashed virtiofsd. May be we can get rid of initializing this hash table for directory objects completely. But that optimization is for another day. Reported-by: Laszlo Ersek Signed-off-by: Vivek Goyal Message-Id: <20201207195539.GB3107@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index e61cc56530..80e62b1610 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -3380,6 +3380,9 @@ static void setup_root(struct lo_data *lo, struct lo_= inode *root) root->key.mnt_id =3D mnt_id; root->nlookup =3D 2; g_atomic_int_set(&root->refcount, 2); + pthread_mutex_init(&root->plock_mutex, NULL); + root->posix_locks =3D g_hash_table_new_full( + g_direct_hash, g_direct_equal, NULL, posix_locks_value_destroy); } =20 static guint lo_key_hash(gconstpointer key) @@ -3402,6 +3405,10 @@ static void fuse_lo_data_cleanup(struct lo_data *lo) if (lo->inodes) { g_hash_table_destroy(lo->inodes); } + + if (lo->root.posix_locks) { + g_hash_table_destroy(lo->root.posix_locks); + } lo_map_destroy(&lo->fd_map); lo_map_destroy(&lo->dirp_map); lo_map_destroy(&lo->ino_map); --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608290993; cv=none; d=zohomail.com; s=zohoarc; b=ZgdazXSnvp1+NcTuIBnhfy1RAQhsA62A8oBS9R9PwHPZpV5wYkeyuEWh0SEcxiHevIiHjvgk8unRszwVA8RAa124PyVBX0rMDKJDJzUQ0tsQNgzJk3DPoV9cJQ8eaF2h7QXFJjeKQ9O/8kdWvlDqfyTnLLJQYBlLyzt3ZCCZIyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608290993; h=Content-Type:Content-Transfer-Encoding:Cc: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=LJ7iN2Wd/TAj11GFc1fQSlLu/L7967OExO8WiNPhE4w=; b=lvaDCmYG3FsBNNdUa95pac4GxhRdie8Bv5a1WdQNI2wHdQUYNVoRb/SFo6CkNbTZ6feYbFFTkSJ+8YJD5rLqMPq0s4iV7PYNLAYR1XI1UkRxx2CWnORXYe7YzxzLwdn0eV5MPFUsDaskWehsw3wc2jW2/VIL7xK/WluzQ+mO1MI= ARC-Authentication-Results: i=1; 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 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 160829099370355.911117507599215; Fri, 18 Dec 2020 03:29:53 -0800 (PST) Received: from localhost ([::1]:35108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDbV-0008Ub-CC for importer@patchew.org; Fri, 18 Dec 2020 06:07:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCr-0003V7-Ej for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57141) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCp-0004dr-F5 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41: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-43-TzdYQ_PwOh-zB4ShF2BWjw-1; Fri, 18 Dec 2020 05:41:48 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F81F9CC23; Fri, 18 Dec 2020 10:41:47 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00CE960C15; Fri, 18 Dec 2020 10:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288110; 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=LJ7iN2Wd/TAj11GFc1fQSlLu/L7967OExO8WiNPhE4w=; b=E9Pu+yAHxQmFtLkdydn8elqVtUOEIXOQzWKI9Q2xiZl6xpFSjSt1RI9/8L+xOSsAq/ml16 6KIdFttMY6C3xT24bqkNqiEY79pzC4CPrMNZWb6/LRhg/NXvvxsTCyeqfBFWjsYpWj38kf BHpHbd9G5+RVe0X3bcZZrGzV6Cb55Og= X-MC-Unique: TzdYQ_PwOh-zB4ShF2BWjw-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 08/15] virtiofsd: Disable posix_lock hash table if remote locks are not enabled Date: Fri, 18 Dec 2020 10:41:10 +0000 Message-Id: <20201218104117.199096-9-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Vivek Goyal If remote posix locks are not enabled (lo->posix_lock =3D=3D false), then d= isable code paths taken to initialize inode->posix_lock hash table and correspondi= ng destruction and search etc. lo_getlk() and lo_setlk() have been modified to return ENOSYS if daemon does not support posix lock but client still sends a lock/unlock request. Signed-off-by: Vivek Goyal Message-Id: <20201207183021.22752-3-vgoyal@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 51 +++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 80e62b1610..4f805cbb82 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -902,10 +902,11 @@ static int lo_do_lookup(fuse_req_t req, fuse_ino_t pa= rent, const char *name, inode->key.ino =3D e->attr.st_ino; inode->key.dev =3D e->attr.st_dev; inode->key.mnt_id =3D mnt_id; - pthread_mutex_init(&inode->plock_mutex, NULL); - inode->posix_locks =3D g_hash_table_new_full( - g_direct_hash, g_direct_equal, NULL, posix_locks_value_destroy= ); - + if (lo->posix_lock) { + pthread_mutex_init(&inode->plock_mutex, NULL); + inode->posix_locks =3D g_hash_table_new_full( + g_direct_hash, g_direct_equal, NULL, posix_locks_value_des= troy); + } pthread_mutex_lock(&lo->mutex); inode->fuse_ino =3D lo_add_inode_mapping(req, inode); g_hash_table_insert(lo->inodes, &inode->key, inode); @@ -1291,12 +1292,13 @@ static void unref_inode(struct lo_data *lo, struct = lo_inode *inode, uint64_t n) if (!inode->nlookup) { lo_map_remove(&lo->ino_map, inode->fuse_ino); g_hash_table_remove(lo->inodes, &inode->key); - if (g_hash_table_size(inode->posix_locks)) { - fuse_log(FUSE_LOG_WARNING, "Hash table is not empty\n"); + if (lo->posix_lock) { + if (g_hash_table_size(inode->posix_locks)) { + fuse_log(FUSE_LOG_WARNING, "Hash table is not empty\n"); + } + g_hash_table_destroy(inode->posix_locks); + pthread_mutex_destroy(&inode->plock_mutex); } - g_hash_table_destroy(inode->posix_locks); - pthread_mutex_destroy(&inode->plock_mutex); - /* Drop our refcount from lo_do_lookup() */ lo_inode_put(lo, &inode); } @@ -1772,6 +1774,11 @@ static void lo_getlk(fuse_req_t req, fuse_ino_t ino,= struct fuse_file_info *fi, ino, fi->flags, fi->lock_owner, lock->l_type, lock->l_start, lock->l_len); =20 + if (!lo->posix_lock) { + fuse_reply_err(req, ENOSYS); + return; + } + inode =3D lo_inode(req, ino); if (!inode) { fuse_reply_err(req, EBADF); @@ -1817,6 +1824,11 @@ static void lo_setlk(fuse_req_t req, fuse_ino_t ino,= struct fuse_file_info *fi, ino, fi->flags, lock->l_type, lock->l_pid, fi->lock_owner, sl= eep, lock->l_whence, lock->l_start, lock->l_len); =20 + if (!lo->posix_lock) { + fuse_reply_err(req, ENOSYS); + return; + } + if (sleep) { fuse_reply_err(req, EOPNOTSUPP); return; @@ -1941,6 +1953,7 @@ static void lo_flush(fuse_req_t req, fuse_ino_t ino, = struct fuse_file_info *fi) int res; (void)ino; struct lo_inode *inode; + struct lo_data *lo =3D lo_data(req); =20 inode =3D lo_inode(req, ino); if (!inode) { @@ -1949,12 +1962,14 @@ static void lo_flush(fuse_req_t req, fuse_ino_t ino= , struct fuse_file_info *fi) } =20 /* An fd is going away. Cleanup associated posix locks */ - pthread_mutex_lock(&inode->plock_mutex); - g_hash_table_remove(inode->posix_locks, GUINT_TO_POINTER(fi->lock_owne= r)); - pthread_mutex_unlock(&inode->plock_mutex); - + if (lo->posix_lock) { + pthread_mutex_lock(&inode->plock_mutex); + g_hash_table_remove(inode->posix_locks, + GUINT_TO_POINTER(fi->lock_owner)); + pthread_mutex_unlock(&inode->plock_mutex); + } res =3D close(dup(lo_fi_fd(req, fi))); - lo_inode_put(lo_data(req), &inode); + lo_inode_put(lo, &inode); fuse_reply_err(req, res =3D=3D -1 ? errno : 0); } =20 @@ -3380,9 +3395,11 @@ static void setup_root(struct lo_data *lo, struct lo= _inode *root) root->key.mnt_id =3D mnt_id; root->nlookup =3D 2; g_atomic_int_set(&root->refcount, 2); - pthread_mutex_init(&root->plock_mutex, NULL); - root->posix_locks =3D g_hash_table_new_full( - g_direct_hash, g_direct_equal, NULL, posix_locks_value_destroy); + if (lo->posix_lock) { + pthread_mutex_init(&root->plock_mutex, NULL); + root->posix_locks =3D g_hash_table_new_full( + g_direct_hash, g_direct_equal, NULL, posix_locks_value_destroy= ); + } } =20 static guint lo_key_hash(gconstpointer key) --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608289474; cv=none; d=zohomail.com; s=zohoarc; b=c9k4SHHd67PqlJheyJ7uNmZ+//9FHkPQGWX4PkrVwa58xyqu9NvbuOM9imqX8+YW/Bvtud6ViC79VSCx4TQQ4pLCusSinESyauMLCEC7OC11yeoL8Ly7xWarBWqt5f+gr1I4ygoK+RXm2WoZbJfYpzA/4aUARpJJ3Wsn0hmel3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608289474; h=Content-Type:Content-Transfer-Encoding:Cc: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=HpyPVaY74FgLMjBqYw7cDckFWoP7kVFPc/zHYU0Hjf0=; b=C2AqC975p3VJ/gn5pKL1LmqcqDgj5C4GkYH3WgIvlikGshPA+Qe4+rOanoXU6eGYPJaBaEpkPN6S4GxGsJqWk67M8ewIrI99yeGFJ58a/uS2xQUsT8dat9PHe8Akwb5NW+jowaMJARS7bu0Ypfrcx9XbD88a3HjBeA42FecoSlw= ARC-Authentication-Results: i=1; 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 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 1608289474655552.194300447701; Fri, 18 Dec 2020 03:04:34 -0800 (PST) Received: from localhost ([::1]:54786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDYn-0004tW-CR for importer@patchew.org; Fri, 18 Dec 2020 06:04:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCt-0003aH-E4 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCr-0004e5-IT for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:41:55 -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-153-WbMB-LHQPf2uocNqfx6pgQ-1; Fri, 18 Dec 2020 05:41:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 758C7801B14; Fri, 18 Dec 2020 10:41:49 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6ADF360C15; Fri, 18 Dec 2020 10:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288112; 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=HpyPVaY74FgLMjBqYw7cDckFWoP7kVFPc/zHYU0Hjf0=; b=a8jbvJecwF7H4vjONbD+tOqmf31vIm2lgINoCaigJCgT7qGOLYsysddZvFt+d6O0pARVEF rCSlULHxaTb2jonRwO1JCGjAXwqjBxlPbSBQCKaFTrwwyLhrNQrGXhP46AAN07zoMrtIAV VVa926J0Q83Hb8KkepD8JGMLQB4+LS0= X-MC-Unique: WbMB-LHQPf2uocNqfx6pgQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 09/15] virtiofsd: Check file type in lo_flush() Date: Fri, 18 Dec 2020 10:41:11 +0000 Message-Id: <20201218104117.199096-10-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Vivek Goyal Currently lo_flush() is written in such a way that it expects to receive a FLUSH requests on a regular file (and not directories). For example, we call lo_fi_fd() which searches lo->fd_map. If we open directories using opendir(), we keep don't keep track of these in lo->fd_map instead we keep them in lo->dir_map. So we expect lo_flush() to be called on regular files only. Even linux fuse client calls FLUSH only for regular files and not directories. So put a check for filetype and return EBADF if lo_flush() is called on a non-regular file. Reported-by: Laszlo Ersek Signed-off-by: Vivek Goyal Message-Id: <20201211142544.GB3285@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index 4f805cbb82..b00be648d3 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -1961,6 +1961,12 @@ static void lo_flush(fuse_req_t req, fuse_ino_t ino,= struct fuse_file_info *fi) return; } =20 + if (!S_ISREG(inode->filetype)) { + lo_inode_put(lo, &inode); + fuse_reply_err(req, EBADF); + return; + } + /* An fd is going away. Cleanup associated posix locks */ if (lo->posix_lock) { pthread_mutex_lock(&inode->plock_mutex); --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608291615; cv=none; d=zohomail.com; s=zohoarc; b=ChYhRBLKaxP0G/cy4wLFQtravX3KlZz4eDDVmbTtc6adve36mvr82lLEs4+nuxf7Cjx/Ll/G0aNCNzxb+sdvoTF/vKj9yup52W8YC91+PL6EMSNl903/U8UTHfas+M6YEHoY5rWHQCV8C8pGToh3Q1fIPAah5XQ3XYXcwKut5O4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608291615; h=Content-Type:Content-Transfer-Encoding:Cc: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=ayG5vht1yT5nQ7SYaiIUVTjkngKM2r3QOIBwqb3vcYI=; b=ngpoAIfVEbdGGaJRqE5Zx5+1w34luVwbPAKHCfGVBcZIp3b4XqaEXXpZmy2zfUuMkDoNq0ApBvy3U8pzVYJeR6PwqP9LRsgsbGLosqOBMthNVWeylDPEtDqrOpyz9VEa2hFpIatHwDCu8ctO2OJLUrh0VfIqJnZvx59eVg/uPmw= ARC-Authentication-Results: i=1; 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 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 1608291615050230.9844891526085; Fri, 18 Dec 2020 03:40:15 -0800 (PST) Received: from localhost ([::1]:34600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDbP-0008I8-9g for importer@patchew.org; Fri, 18 Dec 2020 06:07:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDCz-0003mD-De for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCw-0004fa-Jf for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:01 -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-32-kfASRdh_PNWAkWld8l7mUA-1; Fri, 18 Dec 2020 05:41:52 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE0AA9CC03; Fri, 18 Dec 2020 10:41:51 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFE3860C15; Fri, 18 Dec 2020 10:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288117; 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=ayG5vht1yT5nQ7SYaiIUVTjkngKM2r3QOIBwqb3vcYI=; b=ha8hfTuiPYPFL0la370tBo6tKYk3lW/M/9QUUsnVVRyp8yURCoUinjzFMeFR2l7WWUGJzE lUDxPGlZo+fR5U+bk9PQDMRYcO0Wt4tNo066RoSsAxQqEDQyh4dCKPg1J0MaY+eVO2Ll3t HaEN+mJ//fenrZuTMXQ95WZcLZpLQls= X-MC-Unique: kfASRdh_PNWAkWld8l7mUA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 10/15] virtiofsd: update FUSE_FORGET comment on "lo_inode.nlookup" Date: Fri, 18 Dec 2020 10:41:12 +0000 Message-Id: <20201218104117.199096-11-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Laszlo Ersek Miklos confirms it's *only* the FUSE_FORGET request that the client can use for decrementing "lo_inode.nlookup". Cc: "Dr. David Alan Gilbert" Cc: Miklos Szeredi Cc: Stefan Hajnoczi Fixes: 1222f015558fc34cea02aa3a5a92de608c82cec8 Signed-off-by: Laszlo Ersek Message-Id: <20201208073936.8629-1-lersek@redhat.com> Reviewed-by: Vivek Goyal Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/passthrough_ll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough= _ll.c index b00be648d3..5fb36d9407 100644 --- a/tools/virtiofsd/passthrough_ll.c +++ b/tools/virtiofsd/passthrough_ll.c @@ -101,7 +101,7 @@ struct lo_inode { * This counter keeps the inode alive during the FUSE session. * Incremented when the FUSE inode number is sent in a reply * (FUSE_LOOKUP, FUSE_READDIRPLUS, etc). Decremented when an inode is - * released by requests like FUSE_FORGET, FUSE_RMDIR, FUSE_RENAME, etc. + * released by a FUSE_FORGET request. * * Note that this value is untrusted because the client can manipulate * it arbitrarily using FUSE_FORGET requests. --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608291165; cv=none; d=zohomail.com; s=zohoarc; b=VqRSz8+EA9iepVunnuYnWjsWpaU7FQ5v7UUyfXyAK4N4ZA/FDJAnCH4gVRw6cwJXwUHRS+dRdbtjaGhrFqGtJDAI5rJ7+gkJplzoi3J9zYATyCegDtwrxWOyjlCtxB5znj4aNebXdDxyL8v7szzT98pa5I8KQHDxnsUARmvVwcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608291165; h=Content-Type:Content-Transfer-Encoding:Cc: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=kgnKVQes/+rsc9Qae198nAa6ob5L5drbXnb9PvrTf2g=; b=ZxLPhY44nv2Ky2A8vtcg8ozU0Oh3V4PlCxyWuUJHGK8+gJAMH20jE9jKaBJFiARqe6M7MTcVZjC9RlWkZrVW5cvCKhkUM42scm279I3LJxfPu5bv7v5WK+3c7YlxD0tVNR/Eq1KkxilB5+0fRMa4hU7gBaQ/5U7D5GCiZfoC5z8= ARC-Authentication-Results: i=1; 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 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 1608291165732207.3894992643534; Fri, 18 Dec 2020 03:32:45 -0800 (PST) Received: from localhost ([::1]:58936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDaN-0006ax-Pb for importer@patchew.org; Fri, 18 Dec 2020 06:06:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDD1-0003q6-3k for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDCz-0004fz-4s for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:02 -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-563-YobG6np2NMaVMbNVmVF33Q-1; Fri, 18 Dec 2020 05:41:55 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16C88800D53; Fri, 18 Dec 2020 10:41:54 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1650D60C15; Fri, 18 Dec 2020 10:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288119; 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=kgnKVQes/+rsc9Qae198nAa6ob5L5drbXnb9PvrTf2g=; b=biA+4QT6j/9efYvutjs+CUIFVG7Y6hoeOnIMZGRwwShcYh8mQnkJfR69uaxRhKn1u/fPjF MldX2p0Opd0XNfN+MskM1sDzCZ4BQuTN8H7vbEHKBQr50y0b+UQqAUbknkSR8qozHvDhHE Y8pbhot7lL3BX1ZsJlYfwCmxLsP3UtQ= X-MC-Unique: YobG6np2NMaVMbNVmVF33Q-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 11/15] virtiofsd: Remove useless code about send_notify_iov Date: Fri, 18 Dec 2020 10:41:13 +0000 Message-Id: <20201218104117.199096-12-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Alex Chen The 'ch' will be NULL in the following stack: send_notify_iov()->fuse_send_msg()->virtio_send_msg(), and this may lead to NULL pointer dereferenced in virtio_send_msg(). But send_notify_iov() was never called, so remove the useless code about send_notify_iov() to fix this problem. Signed-off-by: Alex Chen Message-Id: <20201214121615.29967-1-alex.chen@huawei.com> Reviewed-by: Stefan Hajnoczi Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_lowlevel.c | 98 --------------------------------- 1 file changed, 98 deletions(-) diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowleve= l.c index d4119e92ab..e94b71110b 100644 --- a/tools/virtiofsd/fuse_lowlevel.c +++ b/tools/virtiofsd/fuse_lowlevel.c @@ -2143,104 +2143,6 @@ static void do_destroy(fuse_req_t req, fuse_ino_t n= odeid, send_reply_ok(req, NULL, 0); } =20 -static int send_notify_iov(struct fuse_session *se, int notify_code, - struct iovec *iov, int count) -{ - struct fuse_out_header out =3D { - .error =3D notify_code, - }; - - if (!se->got_init) { - return -ENOTCONN; - } - - iov[0].iov_base =3D &out; - iov[0].iov_len =3D sizeof(struct fuse_out_header); - - return fuse_send_msg(se, NULL, iov, count); -} - -int fuse_lowlevel_notify_poll(struct fuse_pollhandle *ph) -{ - if (ph !=3D NULL) { - struct fuse_notify_poll_wakeup_out outarg =3D { - .kh =3D ph->kh, - }; - struct iovec iov[2]; - - iov[1].iov_base =3D &outarg; - iov[1].iov_len =3D sizeof(outarg); - - return send_notify_iov(ph->se, FUSE_NOTIFY_POLL, iov, 2); - } else { - return 0; - } -} - -int fuse_lowlevel_notify_inval_inode(struct fuse_session *se, fuse_ino_t i= no, - off_t off, off_t len) -{ - struct fuse_notify_inval_inode_out outarg =3D { - .ino =3D ino, - .off =3D off, - .len =3D len, - }; - struct iovec iov[2]; - - if (!se) { - return -EINVAL; - } - - iov[1].iov_base =3D &outarg; - iov[1].iov_len =3D sizeof(outarg); - - return send_notify_iov(se, FUSE_NOTIFY_INVAL_INODE, iov, 2); -} - -int fuse_lowlevel_notify_inval_entry(struct fuse_session *se, fuse_ino_t p= arent, - const char *name, size_t namelen) -{ - struct fuse_notify_inval_entry_out outarg =3D { - .parent =3D parent, - .namelen =3D namelen, - }; - struct iovec iov[3]; - - if (!se) { - return -EINVAL; - } - - iov[1].iov_base =3D &outarg; - iov[1].iov_len =3D sizeof(outarg); - iov[2].iov_base =3D (void *)name; - iov[2].iov_len =3D namelen + 1; - - return send_notify_iov(se, FUSE_NOTIFY_INVAL_ENTRY, iov, 3); -} - -int fuse_lowlevel_notify_delete(struct fuse_session *se, fuse_ino_t parent, - fuse_ino_t child, const char *name, - size_t namelen) -{ - struct fuse_notify_delete_out outarg =3D { - .parent =3D parent, - .child =3D child, - .namelen =3D namelen, - }; - struct iovec iov[3]; - - if (!se) { - return -EINVAL; - } - - iov[1].iov_base =3D &outarg; - iov[1].iov_len =3D sizeof(outarg); - iov[2].iov_base =3D (void *)name; - iov[2].iov_len =3D namelen + 1; - - return send_notify_iov(se, FUSE_NOTIFY_DELETE, iov, 3); -} - int fuse_lowlevel_notify_store(struct fuse_session *se, fuse_ino_t ino, off_t offset, struct fuse_bufvec *bufv) { --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608291016; cv=none; d=zohomail.com; s=zohoarc; b=Vf+KQUc6xoK51/z4LhjK7sgFUR8cLaEEIthegjG+EzP4Snc5rYItBS+wowzeMt6q5lV1whZ8KbCsbM2/5Uy+/UnubD7hAKyBhtAEZ9TqEh7Vge7bRl8Q+grJsJY3lOL4y0Mnf7dFTTNr+8qwMMXHLlygT6k7ZbL1K9rHW4R/DmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608291016; h=Content-Type:Content-Transfer-Encoding:Cc: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=iqkVfgLcyetc/UYffZiuz9r4dOhDMExN8KlzSzUwKBE=; b=UJ0WMINV3100Lp+MAPuILP15Ow8NXTcLLpT4ZEGFc/90nJYX8DkB828deusalX8vVwGS3f8yK9ngwhEYI/JncNJ+7ds/GlLzEgYhsJA76F0gSqGCIlEz3iiqmpyN1IKeJAYAFgW5f7vPti1odfoZZfjrkvHGt3/K6I3lOCFO5+o= ARC-Authentication-Results: i=1; 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 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 1608291016446789.507879311932; Fri, 18 Dec 2020 03:30:16 -0800 (PST) Received: from localhost ([::1]:43130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDdg-0003Jy-2n for importer@patchew.org; Fri, 18 Dec 2020 06:09:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDD3-0003xC-SD for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37733) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDD0-0004h6-Hq for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:05 -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-47-Uth777BPO5il57-Fc3-C5A-1; Fri, 18 Dec 2020 05:41:57 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 61E77801817; Fri, 18 Dec 2020 10:41:56 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62C9160C15; Fri, 18 Dec 2020 10:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288121; 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=iqkVfgLcyetc/UYffZiuz9r4dOhDMExN8KlzSzUwKBE=; b=dF18M+sO0gnSGTtW4n2Q7tAB371HHncHlsuWts/WriMSeWBJP3lFWYBYTNJZFp8gM1c+/Q gCKn5kPSS0StvQ3RQ0BDzWTFs6B1W5RkKF+3U1rpsIxzsBTWb4hfGYyqjQ71vPRG1SXdrT lPdetU+8/3zVtW0PDh3BkedRwWHkQJQ= X-MC-Unique: Uth777BPO5il57-Fc3-C5A-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 12/15] docs/devel/migration: Improve debugging section a bit Date: Fri, 18 Dec 2020 10:41:14 +0000 Message-Id: <20201218104117.199096-13-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Markus Armbruster Fix typos, and make the example work out of the box. Signed-off-by: Markus Armbruster Message-Id: <20201217071450.701909-1-armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- docs/devel/migration.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/devel/migration.rst b/docs/devel/migration.rst index 49112bb27a..ad381b89b2 100644 --- a/docs/devel/migration.rst +++ b/docs/devel/migration.rst @@ -53,22 +53,23 @@ savevm/loadvm functionality. Debugging =3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -The migration stream can be analyzed thanks to `scripts/analyze_migration.= py`. +The migration stream can be analyzed thanks to `scripts/analyze-migration.= py`. =20 Example usage: =20 .. code-block:: shell =20 - $ qemu-system-x86_64 - (qemu) migrate "exec:cat > mig" - $ ./scripts/analyze_migration.py -f mig + $ qemu-system-x86_64 -display none -monitor stdio + (qemu) migrate "exec:cat > mig" + (qemu) q + $ ./scripts/analyze-migration.py -f mig { "ram (3)": { "section sizes": { "pc.ram": "0x0000000008000000", ... =20 -See also ``analyze_migration.py -h`` help for more options. +See also ``analyze-migration.py -h`` help for more options. =20 Common infrastructure =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608292464; cv=none; d=zohomail.com; s=zohoarc; b=eLiRytIK6nnOplnrn8PoYnlFo5kx00QVvRoEQBUaH5s4Ph2za/t2wgaFNJofux985a/WR+8XdaKRMdC8tCnQG8lf+RoYMoOhi6NTs7Rckdc+NTnRKGdjg+eqr/tr1seTX3szGZSSIrhaEK5WT8BApILi7O9IJXkG27fGGIbWsM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608292464; h=Content-Type:Content-Transfer-Encoding:Cc: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=VmwrJVa0LdXm2ZqYsR6l+c6WdFBeD8tQoyo0gfaTpXI=; b=NZdIZkRND7/GPUF9V2wWRji3K+HDmtTJNLrfgeg/QheNgZ6Washs+zQi1bul7M3qnqYA/f6feUK7RoQppgX/y9LlGfpqbSWphLwjqUixfiNVoj6WEiMpB0lNFpepMxMffS7Ip1OgjJsj87jow8vlHvyPN/xpp3pQnRyt38RBA98= ARC-Authentication-Results: i=1; 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 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 1608292464067101.86129784116406; Fri, 18 Dec 2020 03:54:24 -0800 (PST) Received: from localhost ([::1]:39014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDcW-0001eR-6v for importer@patchew.org; Fri, 18 Dec 2020 06:08:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDD2-0003uX-Qn for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDD0-0004hA-SA for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:04 -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-508-zf2wfl0bPwOCrU5c_r2K4w-1; Fri, 18 Dec 2020 05:42:00 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AECC759; Fri, 18 Dec 2020 10:41:58 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADF7A60C15; Fri, 18 Dec 2020 10:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288122; 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=VmwrJVa0LdXm2ZqYsR6l+c6WdFBeD8tQoyo0gfaTpXI=; b=Wabi2s6Y3v10W0nGdseX1EYM1jzuTyQjWkFVJvWaRQaCkk0EJFA3ZbBUC6tC1q0suoEbuu HRcjOL/6JDEQl07eUiKs9P6cMqHPYyWi34QzbVlqiuLDh0Vufwz//mmRWdBVZN+Y8ItoYq M7rsGLUNpS42rl+6W3V+0dZdK2I0sHs= X-MC-Unique: zf2wfl0bPwOCrU5c_r2K4w-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 13/15] savevm: Remove dead code in save_snapshot() Date: Fri, 18 Dec 2020 10:41:15 +0000 Message-Id: <20201218104117.199096-14-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Tuguoyi The snapshot in each bs is deleted at the beginning, so there is no need to find the snapshot again. Signed-off-by: Tuguoyi Message-Id: <1607410416-13563-2-git-send-email-tu.guoyi@h3c.com> Reviewed-by: Denis V. Lunev Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 5f937a2762..601b5144b8 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2728,7 +2728,7 @@ int qemu_load_device_state(QEMUFile *f) int save_snapshot(const char *name, Error **errp) { BlockDriverState *bs, *bs1; - QEMUSnapshotInfo sn1, *sn =3D &sn1, old_sn1, *old_sn =3D &old_sn1; + QEMUSnapshotInfo sn1, *sn =3D &sn1; int ret =3D -1, ret2; QEMUFile *f; int saved_vm_running; @@ -2797,13 +2797,7 @@ int save_snapshot(const char *name, Error **errp) } =20 if (name) { - ret =3D bdrv_snapshot_find(bs, old_sn, name); - if (ret >=3D 0) { - pstrcpy(sn->name, sizeof(sn->name), old_sn->name); - pstrcpy(sn->id_str, sizeof(sn->id_str), old_sn->id_str); - } else { - pstrcpy(sn->name, sizeof(sn->name), name); - } + pstrcpy(sn->name, sizeof(sn->name), name); } else { /* cast below needed for OpenBSD where tv_sec is still 'long' */ localtime_r((const time_t *)&tv.tv_sec, &tm); --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608291808; cv=none; d=zohomail.com; s=zohoarc; b=ajlUgb522+a+17m9ZN1ZXlf+aV+PsbHZffUtavpbXj7W34Z0W2kKr/7zxaxuZyyYO+FUAs6DHgE0GHvos6CSGMF9TgYrKpOLiXY+FiGo7UKpYxVhC8mHZ+s909EMxdSWI0DQN6zqHmo1GKvT3j2t0wO4PFg7AmaBFmDeLhyBWKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608291808; h=Content-Type:Content-Transfer-Encoding:Cc: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=FTC4KCO0oXS70552iRFyKX+l5WH0KUvjjS9B5WeucLQ=; b=j1LSyfLmHpqfN7faUjo+vkU4T3OzhBI2EDiiRYcoqtAQB4SktKv6k6Nkvg1S9Q8/0cz8WS8mIOg0fDHUY0uQqfHeD/qfBobeYw/uyc1Ov6Jwt+dQ9C7JMwOJlBO6HgEhftT0I5zlHDbJRaM/HCVLfqy+96smRea9so1Q9Asey34= ARC-Authentication-Results: i=1; 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 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 1608291808966323.9140810572835; Fri, 18 Dec 2020 03:43:28 -0800 (PST) Received: from localhost ([::1]:50908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDg2-0006Ya-MR for importer@patchew.org; Fri, 18 Dec 2020 06:12:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDDF-00041J-Ri for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDD9-0004jG-L7 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:17 -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-423-T2XiDRfEPGGAvUHY3S-tyA-1; Fri, 18 Dec 2020 05:42:06 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DAB2801B12; Fri, 18 Dec 2020 10:42:04 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07A5F60C15; Fri, 18 Dec 2020 10:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288129; 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=FTC4KCO0oXS70552iRFyKX+l5WH0KUvjjS9B5WeucLQ=; b=dPf5oOsAEbUjWYKX6qdLBSV9qAKFKom+xMvxXeof8w4bEaee2nDfDlj/sdSbxSCad8Ukgm Hz2se4/HFuGf1NqLrQGL4rsXQfi8qH4paEiFex8ErnZt2h+Pm0moXS/YwpHcgdH65+qM6O fug5JdpSe8JCLHoEW4WsU6wFnQpuTRw= X-MC-Unique: T2XiDRfEPGGAvUHY3S-tyA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 14/15] savevm: Delete snapshots just created in case of error Date: Fri, 18 Dec 2020 10:41:16 +0000 Message-Id: <20201218104117.199096-15-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Tuguoyi bdrv_all_create_snapshot() can fails with some snapshots created, so it's better to delete those snapshots before returns to the caller Signed-off-by: Tuguoyi Message-Id: <1607410416-13563-3-git-send-email-tu.guoyi@h3c.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- migration/savevm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/savevm.c b/migration/savevm.c index 601b5144b8..4a18c9d897 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2833,6 +2833,7 @@ int save_snapshot(const char *name, Error **errp) if (ret < 0) { error_setg(errp, "Error while creating snapshot on '%s'", bdrv_get_device_or_node_name(bs)); + bdrv_all_delete_snapshot(sn->name, &bs, NULL); goto the_end; } =20 --=20 2.29.2 From nobody Sat May 18 22:54:13 2024 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1608291174; cv=none; d=zohomail.com; s=zohoarc; b=cQ3zSXOqXPhncx1DTSS+pDSi2FAB+YWAbaYD8QzXgmQa/TyEoyXrxnJ3qIb4BtqlhLEkP4IQglicZDOQRbTy4BN2ft+AWwaHAeTCeK38GHmFtQ/X5fBpiNBBlVQlAsMdpjQnY+X0Sc1dD/MtZz0o2RxSRnxKKnFKc4KOEYnylAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608291174; h=Content-Type:Content-Transfer-Encoding:Cc: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=tocaSQbstAXKuFcibAp7Zwy0Hn14WnnWxqXmFAUBUsw=; b=Eezf2cTgzHUCIbNr2rJnWdtK38ELkCZEVtgiECjBzxLj7rfLZZM6aX8p94mNGRBD7WVyTGwgcmcDp9GY8GpWv3DU83TEw+lBV9Dnq5GFnvg3imoklJWkVRpFcoZ+DzXkEVP/HsShitTbTLOERKfBwwU+g61bSCUAu0OaWP90jNo= ARC-Authentication-Results: i=1; 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 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 1608291174632796.3426838713934; Fri, 18 Dec 2020 03:32:54 -0800 (PST) Received: from localhost ([::1]:47376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqDeN-00051P-3w for importer@patchew.org; Fri, 18 Dec 2020 06:10:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqDDG-00041K-Lp for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqDDB-0004kF-VF for qemu-devel@nongnu.org; Fri, 18 Dec 2020 05:42:17 -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-69-jRqGPGQiNDShhbphy_My3Q-1; Fri, 18 Dec 2020 05:42:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1194C107ACE3; Fri, 18 Dec 2020 10:42:10 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-114-200.ams2.redhat.com [10.36.114.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9D7660C15; Fri, 18 Dec 2020 10:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608288133; 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=tocaSQbstAXKuFcibAp7Zwy0Hn14WnnWxqXmFAUBUsw=; b=ADN0VEuo/KLqdGQkDBZ7FIVICBsyeJ7zmZE4LAbGHwVFFTMKuQcCy0BuDILzjgZx5CChZm k1yTydLXKmg/DSfKeuMxNt6/2R7cNo830b4A5Adh/rgh7P83zG5/Rw3krny1pp0asevJXS 34frAiZHRNr2H6YwJvLKuDoU7kpuMno= X-MC-Unique: jRqGPGQiNDShhbphy_My3Q-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, aiyutao@huawei.com, peter.maydell@linaro.org, vgoyal@redhat.com, lersek@redhat.com, alex.chen@huawei.com, armbru@redhat.com, tu.guoyi@h3c.com Subject: [PULL 15/15] migration: Don't allow migration if vm is in POSTMIGRATE Date: Fri, 18 Dec 2020 10:41:17 +0000 Message-Id: <20201218104117.199096-16-dgilbert@redhat.com> In-Reply-To: <20201218104117.199096-1-dgilbert@redhat.com> References: <20201218104117.199096-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: stefanha@redhat.com, quintela@redhat.com 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: Tuguoyi The following steps will cause qemu assertion failure: - pause vm by executing 'virsh suspend' - create external snapshot of memory and disk using 'virsh snapshot-create-= as' - doing the above operation again will cause qemu crash The backtrace looks like: at /build/qemu-5.0/migration/savevm.c:1401 at /build/qemu-5.0/migration/savevm.c:1453 When the first migration completes, bs->open_flags will set BDRV_O_INACTIVE flag by bdrv_inactivate_all(), and during the second migration the bdrv_inactivate_recurse assert that the bs->open_flags is already BDRV_O_INACTIVE enabled which cause crash. As Vladimir suggested, this patch makes migrate_prepare check the state of = vm and return error if it is in RUN_STATE_POSTMIGRATE state. Signed-off-by: Tuguoyi Message-Id: <6b704294ad2e405781c38fb38d68c744@h3c.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Reported-by: Li Zhang Reviewed-by: Pankaj Gupta Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index e0dbde4091..f5d4a52c95 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2102,6 +2102,12 @@ static bool migrate_prepare(MigrationState *s, bool = blk, bool blk_inc, return false; } =20 + if (runstate_check(RUN_STATE_POSTMIGRATE)) { + error_setg(errp, "Can't migrate the vm that was paused due to " + "previous migration"); + return false; + } + if (migration_is_blocked(errp)) { return false; } --=20 2.29.2