From patchwork Tue Aug 6 17:21:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 1969651 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=RhdCwLUD; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wdg9k22PRz1yYD for ; Wed, 7 Aug 2024 03:22:45 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbNsd-0000Zj-BG; Tue, 06 Aug 2024 13:21:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbNsb-0000Yg-Nj; Tue, 06 Aug 2024 13:21:49 -0400 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbNsZ-0004yo-17; Tue, 06 Aug 2024 13:21:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:Date:Cc:To: From:Subject:Message-ID:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=7BDEE/1KYynIV5EYjRUP7OJjgrNP7RABmmtrkprGk9E=; b=RhdCwLUD4zPX5ntOfyJEeOemJz hxDlnKLquQ4YCXoimbPAZBljJBT7v7FXOK/RQ/uBdWL96b9ERzMN2JlwiHp2jdalEfmAOQDY5fkeQ VLKtjCfV4n/c5zFLIZP8VqEeCzzEf+ohBPSNsdA8/lqPoRhk7UI1h/y8bSFJFSar6/lI6ZyePzECu U9yGOJnCWNAZXkHv4rKL0ve1pOrFu2ORR0z196i/ZphF1YderWgx/CArt7wjEATQe4u4lq4OeXAIj OYh7PIPk4/ShETtLsfmaA/K6tqyWSgP4SQqRfB5LZfwZAvtKHTmQTmcYyTBKUJNiOh0/OMwVYc212 brNfDlqA==; Received: from [2001:8b0:10b:5:95e1:bb50:f4dd:70b1] (helo=u3832b3a9db3152.ant.amazon.com) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbNsQ-000000061T9-0yGs; Tue, 06 Aug 2024 17:21:38 +0000 Message-ID: Subject: [PATCH] net: Fix '-net nic,model=' for non-help arguments From: David Woodhouse To: qemu-devel@nongnu.org Cc: Michael Tokarev , Jason Wang , qemu-stable , Hans Date: Tue, 06 Aug 2024 18:21:37 +0100 User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Received-SPF: none client-ip=2001:8b0:10b:1236::1; envelope-from=BATV+045a134c4f2ff45cf0c3+7653+infradead.org+dwmw2@casper.srs.infradead.org; helo=casper.infradead.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: David Woodhouse Oops, don't *delete* the model option when checking for 'help'. Fixes: 64f75f57f9d2 ("net: Reinstate '-net nic, model=help' output as documented in man page") Reported-by: Hans Signed-off-by: David Woodhouse Cc: qemu-stable@nongnu.org Reviewed-by: Michael Tokarev --- This whole mess of alternative command line options could really do with some self tests. And maybe removing half of them. Three ways of doing the same thing ought to suffice. net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 2eb8bc9c0b..fc1125111c 100644 --- a/net/net.c +++ b/net/net.c @@ -1737,7 +1737,7 @@ void net_check_clients(void) static int net_init_client(void *dummy, QemuOpts *opts, Error **errp) { - const char *model = qemu_opt_get_del(opts, "model"); + const char *model = qemu_opt_get(opts, "model"); if (is_nic_model_help_option(model)) { return 0;