From nobody Sun Apr 28 00:11:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516605883856451.92956877649715; Sun, 21 Jan 2018 23:24:43 -0800 (PST) Received: from localhost ([::1]:52310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edWT3-0006UR-PM for importer@patchew.org; Mon, 22 Jan 2018 02:24:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edWS5-00064b-Ts for qemu-devel@nongnu.org; Mon, 22 Jan 2018 02:23:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edWS5-00028K-4f for qemu-devel@nongnu.org; Mon, 22 Jan 2018 02:23:33 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:48730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edWS0-0001yw-Sv; Mon, 22 Jan 2018 02:23:28 -0500 Received: from localhost.localdomain (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Mon, 22 Jan 2018 00:23:13 -0700 From: Lin Ma To: qemu-block@nongnu.org Date: Mon, 22 Jan 2018 15:21:02 +0800 Message-Id: <20180122072102.4141-1-lma@suse.com> X-Mailer: git-send-email 2.15.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 137.65.250.26 Subject: [Qemu-devel] [PATCH] raw: Disable probing if image format is given by driver-specific options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If the user specifies image format through driver-specific options, The format probing should be prohibited and the warning message should not be printed. e.g.: $ qemu-system-x86_64 ... -drive file.file.filename=3Ddisk0.raw,file.driver= =3Draw ... WARNING: Image format was not specified for 'disk0.raw' and probing guessed= raw. Automatically detecting the format is dangerous for raw images, ... Signed-off-by: Lin Ma --- blockdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blockdev.c b/blockdev.c index 29d569a24e..ef4c167235 100644 --- a/blockdev.c +++ b/blockdev.c @@ -529,6 +529,8 @@ static BlockBackend *blockdev_init(const char *file, QD= ict *bs_opts, goto early_err; } qdict_put_str(bs_opts, "driver", buf); + } else if (qdict_haskey(bs_opts, "file.driver")) { + qdict_put_str(bs_opts, "driver", qdict_get_str(bs_opts, "file.driv= er")); } =20 on_write_error =3D BLOCKDEV_ON_ERROR_ENOSPC; --=20 2.15.1