From patchwork Mon Oct 9 09:31:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 730965 Delivered-To: patch@linaro.org Received: by 2002:a5d:574c:0:b0:31d:da82:a3b4 with SMTP id q12csp1110508wrw; Mon, 9 Oct 2023 02:32:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLZPGL35x6GzUPzxqVW1oTYrjFfRyNplelLXNzJE7bRcyf/iV8SNWCq5xqZRs11d4pOYaP X-Received: by 2002:ac8:5704:0:b0:419:4e1c:6904 with SMTP id 4-20020ac85704000000b004194e1c6904mr19919184qtw.20.1696843935855; Mon, 09 Oct 2023 02:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843935; cv=none; d=google.com; s=arc-20160816; b=Pd7s3vC/RwOFwbgNeO449F9sP70vFzdSlNmxe8QFDki43L5xtl7gG+YfocSIRn/Ncs jwJh4Wq68gNiKS6hGu48aqFckUYfMTx36vENHHLscKfpAMAbn+GeTXvnTn9upACunI/t uVlOVMVxq1yW/UgenXHWPJH2gZ0v/0vbElrJvRBFWM7HyC5KRYiRTElYynAlxJPCeR1V vNKwO6hPRW3iNScOWbOBojFzLDotWRHPXrfrLPzaVdIHcfFq6FPWtj94JagWvICiEJDT o46DY5JRu3W/v6hwn53ULsq2z1g+Gov1b2wA8eQdPSKZZg3666rFmFi46f64IFPdpimZ fYcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=mabujDx0DSImp/RgYxObckqCXl/9gkN8GQesN9V0wGU=; fh=DMNbb4XLDSATGwS8tXoi6pAX9xps/in/YLpCr1+hqqM=; b=f3GKLnOdIZTx3aAb57qTaC761AqnMpTrUl3HCbXw9T92XO70xW1s5ehL6+YfDM6Oa7 bfv9aylYpDGTaLTCboB8IN8jTvc5eY9KO1wu+kjtO2ZyRabwPiVcuLtOBLgYqjX8AxC5 SwwVHbXL25z9K5Ewai0BSUZVTXJiL57l66k9DI6edxPL4GHWola/YPssAiCL1armSMQi 6hl1IQStlf2kV998MKxi4D1JlAjt/+pTS5GDWBIY2mQFYJPNfsOb6mHyTOL7fE+Bi5Ln ZUwmxeIOaavYzrnRrlrcvWHmt+HEiFVjeqwzpnJmgwZdlld/BTWJOdZtnJJoYyOnV6+u IMAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k+LYp5qH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y17-20020a05622a121100b00419797673cbsi5808483qtx.800.2023.10.09.02.32.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2023 02:32:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k+LYp5qH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpmcO-0004BP-FT; Mon, 09 Oct 2023 05:32:04 -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 1qpmcJ-0004Az-Cg for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:31:59 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpmcH-0002nU-F4 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 05:31:58 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53808d5b774so7714937a12.3 for ; Mon, 09 Oct 2023 02:31:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696843914; x=1697448714; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mabujDx0DSImp/RgYxObckqCXl/9gkN8GQesN9V0wGU=; b=k+LYp5qHrb6ghSSMlfR94IwANtYj4Gkb+dgcWdx4MnS78YY55qoaPlRdzwZCcCzbch PJLOE2hdlcrC2NuyLFC8pjzYnLdHKStYvT7mKh21fKK1KfScIcrW+mrt5IVHtIVmg14J q0ZSta+doBzBgn5S2e71A2aqCwdLHOnQ1iHufavWE3/UMo/SboFRMKw+LlQJb0c947iK JSwJ1b+4nZkqBO33fNwF0UfIYOloThe+puqTWjmiOZxlTRowxAYIj/+0PyNQqHgXCmAz X78uEYbyNaW/FoeqnvFBxlVBK/VMP6iEUT6P543v7zcwtTSJcRbbI3EwG56oqD8K8Uip a0sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696843914; x=1697448714; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mabujDx0DSImp/RgYxObckqCXl/9gkN8GQesN9V0wGU=; b=ucDHm3GnrdNvtPjfAoBLWzcIkgP15uxwmzGrqxLabbH2VTNMJD+x4MlMXavkY364LI /V9wTRS8EGcUNbglN3y9SEkW9GwC3QhfrOm/5B+sJV1JiTCTymMcaG44aSgu6fQfUcJv rmfFSRxQwhjFsed7TjPpfGAVszWmH3LCQWGcovuSs9onvTyq5fOwNYhsuuJod8fMHv5z 5XWzsxHQ6GfELsQ5Z1fQnhnYgqdi4ySAIBiRiF7M7C92FG4Ki3qblfSjb5nGQRIV9aMu b4raQwsyI0nJTFfSAuj+mXnD3oAgZK2+KrpYSknx52kmx5YHVosddiM2dThPzj9MIyHX YqLw== X-Gm-Message-State: AOJu0YytbQZUcVMLB64GvdNND//snd08sXW1G4ydnENLascUWtQHyG5w 3L1LKHXio5Ld1Tn5+erOwj2uyBczNR2xmS5UI+Y= X-Received: by 2002:a50:ed14:0:b0:52f:a162:f4c4 with SMTP id j20-20020a50ed14000000b0052fa162f4c4mr12692315eds.18.1696843914506; Mon, 09 Oct 2023 02:31:54 -0700 (PDT) Received: from m1x-phil.lan (thr44-h01-176-170-217-185.dsl.sta.abo.bbox.fr. [176.170.217.185]) by smtp.gmail.com with ESMTPSA id s21-20020aa7d795000000b0053613c8312bsm5907295edq.42.2023.10.09.02.31.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:31:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH] system/vl: Use global &bdo_queue in configure_blockdev() Date: Mon, 9 Oct 2023 11:31:52 +0200 Message-ID: <20231009093152.51270-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Commit d11bf9bf0f ("vl: Factor configure_blockdev() out of main()") passed &bdo_queue as argument, but this isn't really necessary since there is only one call, so we still use the global variable. Dropping the &bdo_queue argument allows to silence this global shadow warning: softmmu/vl.c:678:54: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void configure_blockdev(BlockdevOptionsQueue *bdo_queue, ^ softmmu/vl.c:172:29: note: previous declaration is here static BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); ^ Remove a spurious empty line. Signed-off-by: Philippe Mathieu-Daudé --- softmmu/vl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 98e071e63b..bc283b9fd4 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -674,8 +674,7 @@ static void default_drive(int enable, int snapshot, BlockInterfaceType type, } -static void configure_blockdev(BlockdevOptionsQueue *bdo_queue, - MachineClass *machine_class, int snapshot) +static void configure_blockdev(MachineClass *machine_class, int snapshot) { /* * If the currently selected machine wishes to override the @@ -688,10 +687,10 @@ static void configure_blockdev(BlockdevOptionsQueue *bdo_queue, } /* open the virtual block devices */ - while (!QSIMPLEQ_EMPTY(bdo_queue)) { - BlockdevOptionsQueueEntry *bdo = QSIMPLEQ_FIRST(bdo_queue); + while (!QSIMPLEQ_EMPTY(&bdo_queue)) { + BlockdevOptionsQueueEntry *bdo = QSIMPLEQ_FIRST(&bdo_queue); - QSIMPLEQ_REMOVE_HEAD(bdo_queue, entry); + QSIMPLEQ_REMOVE_HEAD(&bdo_queue, entry); loc_push_restore(&bdo->loc); qmp_blockdev_add(bdo->bdo, &error_fatal); loc_pop(&bdo->loc); @@ -712,7 +711,6 @@ static void configure_blockdev(BlockdevOptionsQueue *bdo_queue, CDROM_OPTS); default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS); default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS); - } static QemuOptsList qemu_smp_opts = { @@ -1961,7 +1959,7 @@ static void qemu_create_early_backends(void) * Note: we need to create audio and block backends before * setting machine properties, so they can be referred to. */ - configure_blockdev(&bdo_queue, machine_class, snapshot); + configure_blockdev(machine_class, snapshot); audio_init_audiodevs(); }