From patchwork Fri Oct 6 11:36:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729981 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp455870wrp; Fri, 6 Oct 2023 04:38:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnTc/N60/E14VxihrgtyIG8Rkc95I+ft8tbTAh59pxH0JGs7+HXRyT3uymhBHx5DdxIw98 X-Received: by 2002:a67:fdd0:0:b0:454:2d1e:6ced with SMTP id l16-20020a67fdd0000000b004542d1e6cedmr8382693vsq.27.1696592282329; Fri, 06 Oct 2023 04:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592282; cv=none; d=google.com; s=arc-20160816; b=QzwxK3Tr4+wmn3iWwVkXv/3HNsOBGRUDm7Vt+bGKjN1soG5Hcy4+UzM6auEUl6ho17 BMAuT0HdtZGs4zD9ahIVN+j2sG7TUXHJ7nml9BmAOXqtem/sITkR6uoa4aUnQ+bVe0D6 3uT1PlRH48BpsGZTjyrJ1/7uASxgACPqqBp2fDJWi8bwyLSByKXc1L/s7zSSQmVOsJ6F leimNDyDEfpdT7TD+/aiVySVjyYuiH9qPInxJBHe0ppSufkFZfYN/oiWp7mll+HNXSZz Jb4mwnNEF8bfnKylbnb/8irabw6DDdEzIL4mW2mMDVTjxgq8gWS4g0gh1WkxIhj2DpF0 Adjw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; fh=kWQoQsLK82AARKMfoe+qpmqOSQjjSZfWUhPHIg9yF+c=; b=hsGWg4Rnhm30XPGddjx5v+ezabdjoQy2mMTBcHqzH1OeT8+ACkGS2tvVvX3ju+y/Cv Ltl8xG+JNegBvhwnxdXJQ12N7ECmTQW18UDZXartLzmS3OfcdGrC6jizYfjRql9fVh7l vGPsD+EHdY3FQUxLbRJkZAJ5vKTJOSheybNSoCGxPNeVdHqjeUupl1LtfKYLGIVZB8Ne 0u9kFnlaX6LMzOcioCktVxZUfAk4rV/DqJr3Wh1AWMeyLOsmzbeOp7dGWTNfYiJe/qUg LeyAUsQrpEdEYEH1BO6uZ1iFsS67WSowJEH1ucpDJ00dNLZijnrRep8U62nrurkU1CUB TmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IOIGS9hM; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id tn4-20020a05620a3c0400b00773d6c99af2si2173173qkn.449.2023.10.06.04.38.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:38:02 -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=@redhat.com header.s=mimecast20190719 header.b=IOIGS9hM; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj8x-00051J-5v; Fri, 06 Oct 2023 07:37:19 -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 1qoj8o-0004zE-6S for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8h-00006U-KA for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=WeDsGMFtz4asvODucopxPE5YKxApxjds6GXhzdwffeM=; b=IOIGS9hMfoKyzsS7YG/ImVP6gEUrckauKKwzOH2Q/v2e8pHq5pgrE2DrFpB9YKdE0c6RPA cDMPdHnRAILplv4SCzLrI9pHOEnFZ1nC7VDMJiNP7mmvg1jZF33S0K0DZG40da3lprEBw0 KQ5/Cw2BR/kiNkKLediWhANgXfLGpXE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-vnqYtYC4OMm7mYa7zGU1_Q-1; Fri, 06 Oct 2023 07:37:00 -0400 X-MC-Unique: vnqYtYC4OMm7mYa7zGU1_Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC3AC1C06370; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AEAB20268CB; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 71B2C21E6913; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth Subject: [PULL 10/32] hw/audio/soundhw: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:35 +0200 Message-ID: <20231006113657.3803180-11-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: hw/audio/soundhw.c:86:33: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void select_soundhw(const char *optarg, const char *audiodev) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-2-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- include/hw/audio/soundhw.h | 2 +- hw/audio/soundhw.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/audio/soundhw.h b/include/hw/audio/soundhw.h index 270717a06a..474c5ff94e 100644 --- a/include/hw/audio/soundhw.h +++ b/include/hw/audio/soundhw.h @@ -8,6 +8,6 @@ void deprecated_register_soundhw(const char *name, const char *descr, void soundhw_init(void); void show_valid_soundhw(void); -void select_soundhw(const char *optarg, const char *audiodev); +void select_soundhw(const char *name, const char *audiodev); #endif diff --git a/hw/audio/soundhw.c b/hw/audio/soundhw.c index 94d9463e42..b387b0ef7d 100644 --- a/hw/audio/soundhw.c +++ b/hw/audio/soundhw.c @@ -83,7 +83,7 @@ void show_valid_soundhw(void) static struct soundhw *selected = NULL; static const char *audiodev_id; -void select_soundhw(const char *optarg, const char *audiodev) +void select_soundhw(const char *name, const char *audiodev) { struct soundhw *c; @@ -92,7 +92,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } for (c = soundhw; c->name; ++c) { - if (g_str_equal(c->name, optarg)) { + if (g_str_equal(c->name, name)) { selected = c; audiodev_id = audiodev; break; @@ -100,7 +100,7 @@ void select_soundhw(const char *optarg, const char *audiodev) } if (!c->name) { - error_report("Unknown sound card name `%s'", optarg); + error_report("Unknown sound card name `%s'", name); show_valid_soundhw(); exit(1); } From patchwork Fri Oct 6 11:36:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729992 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp457976wrp; Fri, 6 Oct 2023 04:43:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEfUw8BNQpt9PFqQaCKBy1mpaWZe5hEzNHmXFf49jIjuR2WltWWTEbf1KbG3VCdX6ZDnDh X-Received: by 2002:a0c:f4cf:0:b0:656:3a3c:8765 with SMTP id o15-20020a0cf4cf000000b006563a3c8765mr8791297qvm.6.1696592592943; Fri, 06 Oct 2023 04:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592592; cv=none; d=google.com; s=arc-20160816; b=yYO+ePFaSeRzbogCdDt6G0mQqy3EAngVrWzL6pTfgDVsw2XJ9yeuqM5nbvK92mdwg7 llrbmxAuOWJ86q9q7XNWQd8TPpwQO3BmCeVbrSfFCzEYnBVH4exSfVAMzxHGzWwYiSBM xvm5Sj5B2dXCPi0ZSiKW5/9/b11/KgzZo+gjQGT09Pl+GV96l1T1pOSdxmW/F6MeGNRO FBNowYZOJqJwHuOXpSKQUsOkb3oUyR6ZeGM5dR1dk5uBfjq30YiSh2NBEmM0Cvh1DilK 3cijNrIGLKUsG8cwzQzi3GKMF/XXFatF/bCYPGHTWwt7MBkypywmVEMYruyUk/c1HsuE egiA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8tO50er00dR7aTTYvXvw7IrMFjKlh8I5Sm2ncEgmemg=; fh=Zaxgg2zL3uPfAXbJA+wClWPCbcGdvuFrt3cxY8aYf0k=; b=zvQOzeo7eg9J0NPT2s+wU3lNUMrk4Lkm0hDI1tlHDlPzeqL0bnf+7n4fbi6pvs/2fe t8F6sXXdgqXg3VO6J9XiNW6LdiQ8It49sshZNABYFarq/2kmvGbUw3PAx+akRq838Fsh WaVpibFCodkUGPu2yHKOxoyhv9vwxoO05upRXZXWwcE5WBn4kdvjaaN3VD1qBVvtwx0X rUscvBqXW6T9zQ6tbf4Rihf/62+MRpNL6aqvM4IffZmMZ2nreg2OTohf8tvHUC8c3GOe q+MUl27AtLS+N6HI6y3dIPgG/H2frhX5w+hzRSWNZrOj5h5mk/kle3zCloGEbCyfFOfU ZpFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EQppMGdu; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b10-20020a0cc98a000000b0066407a7a47fsi2194632qvk.608.2023.10.06.04.43.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:43:12 -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=@redhat.com header.s=mimecast20190719 header.b=EQppMGdu; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9Q-0005BS-5h; Fri, 06 Oct 2023 07:37:48 -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 1qoj8z-00052u-A8 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-00007l-VA for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592224; 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=8tO50er00dR7aTTYvXvw7IrMFjKlh8I5Sm2ncEgmemg=; b=EQppMGdu8wgVMBfaosJE3Ev5zebtaeFIhj3b2vQMHBzWkPivtw0S1DRBauDFy/FSW7Vewb T49MBjNvpeJvVe+P4LutoDYP2io/2WRpKSM4YQv2BjjLLR66yr++VW40omBHQU76Q6/Vuv UW+at3gsVZtusazvXH2W35EzqMmPb/o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-656-sfej_yqrOuu63eVMcmUtNw-1; Fri, 06 Oct 2023 07:37:00 -0400 X-MC-Unique: sfej_yqrOuu63eVMcmUtNw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF4E9811E7E; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F1451054FC0; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 74A2921E6914; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , John Snow Subject: [PULL 11/32] hw/ide/ahci: Clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:36 +0200 Message-ID: <20231006113657.3803180-12-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: hw/ide/ahci.c:1577:23: error: declaration shadows a local variable [-Werror,-Wshadow] IDEState *s = &ad->port.ifs[j]; ^ hw/ide/ahci.c:1569:29: note: previous declaration is here void ahci_uninit(AHCIState *s) ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-3-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: John Snow Signed-off-by: Markus Armbruster --- hw/ide/ahci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index d0a774bc17..fcc5476e9e 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1622,9 +1622,7 @@ void ahci_uninit(AHCIState *s) AHCIDevice *ad = &s->dev[i]; for (j = 0; j < 2; j++) { - IDEState *s = &ad->port.ifs[j]; - - ide_exit(s); + ide_exit(&ad->port.ifs[j]); } object_unparent(OBJECT(&ad->port)); } From patchwork Fri Oct 6 11:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729990 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp457575wrp; Fri, 6 Oct 2023 04:42:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQnPSVsqPd/iinb419Nxamixf46G93AxvsWzJngT2P1fJVUIxkZx3lsaQseVlEn37uIAaD X-Received: by 2002:ac8:5c15:0:b0:418:1da6:eb8f with SMTP id i21-20020ac85c15000000b004181da6eb8fmr9769653qti.27.1696592536454; Fri, 06 Oct 2023 04:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592536; cv=none; d=google.com; s=arc-20160816; b=nych6KT5Mcj70D4r7c9Xob66UldN5Bwaoi/J7MD2jAzhsiP/SHzUiChe7XK3DhYdhN 513bAYsZ4XOQqWUi0vahn3b9wuZF2VXvLDk3XszOLnLnD5jZm5pF5bn2E1NPi7Ac+whm XCHjuSnigncnd+CDtfLmG5O7hK/gv5ZmQtwYZDdcIi5HMYXjBq9h7B9werMaYPjRiEyA jSOIpeceCOMy52EBU4ppfesbgj5c36YU9Ei+Pb6ctUz0Y3UuYruoQLpGqZ0lGfRV7gGA oIK+uwG7nu8H2/Qx1wvlNIke9yxVL/t36g+6iQ6SOXNom8pIW1fIDmpF2Wjt86KSYnEx WK/Q== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vTFZ5zkFumeXfVmSRYWZ6swj3UJExKk1gLMUiBKRj5c=; fh=kWQoQsLK82AARKMfoe+qpmqOSQjjSZfWUhPHIg9yF+c=; b=eBtqCIQ0usSwHSMU1Mr4YhbKQm3SltNs3YjrvcQ8wffO/vQ2uqUCcap3dpV8E6d1K6 JYF5tRQ1XcXG0Ay66iwso7QaDVOz9/ziIQmYhHlD+vtJZ5MLZFdd+evcTErQ1amSs0Vb ok+09vmmSfD/hXNdKseXJCg2vcP5r2SMG9taWFEaZKX1vvaIciKeou0FK9MDt5r2GjR1 94iCAcow1PL/OjKU/4ElRKL1c/m2AKq8UlTgGZNoqqA5pa4hCQfAX4l8GtxgmpWO0YHK wSKKbaF4o915A/ZF/5gPkmhFF+dEEUJVGZPM8ss5+nQ7XhgTzdJ2vIvlw23cz9JB62cj LuZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CWqHrtiB; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t18-20020a05622a149200b00418122a226bsi2286414qtx.182.2023.10.06.04.42.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:42:16 -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=@redhat.com header.s=mimecast20190719 header.b=CWqHrtiB; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9J-00058t-JK; Fri, 06 Oct 2023 07:37:41 -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 1qoj8t-00050m-L4 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8n-00006c-Qe for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592221; 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=vTFZ5zkFumeXfVmSRYWZ6swj3UJExKk1gLMUiBKRj5c=; b=CWqHrtiBKg3BH7U3PMaVymAfxhJiWTQSOZAuQkkbuNX4fDLnTkyIVtgM0tka8joOZM0qCf D0YJ1lZdXXN/EJKT9dlEYerZpoXx+CKEXcv5MRH5jpj26wRRck69HzRbgPK14EWcsNm4Jp q2paNixAP6ZS3ppmQBZnqzh/DpECHSU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-112-7y0ZQEt4PTCO7y5uW97s0Q-1; Fri, 06 Oct 2023 07:37:00 -0400 X-MC-Unique: 7y0ZQEt4PTCO7y5uW97s0Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C63C281D781; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A54EC1054FC1; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 77A6121E6915; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Thomas Huth Subject: [PULL 12/32] net/net: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:37 +0200 Message-ID: <20231006113657.3803180-13-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: net/net.c:1680:35: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool netdev_is_modern(const char *optarg) ^ net/net.c:1714:38: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void netdev_parse_modern(const char *optarg) ^ net/net.c:1728:60: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void net_client_parse(QemuOptsList *opts_list, const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-4-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Markus Armbruster --- include/net/net.h | 6 +++--- net/net.c | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 330d285930..2fb1c9181c 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -247,9 +247,9 @@ extern const char *host_net_devices[]; /* from net.c */ extern NetClientStateList net_clients; -bool netdev_is_modern(const char *optarg); -void netdev_parse_modern(const char *optarg); -void net_client_parse(QemuOptsList *opts_list, const char *str); +bool netdev_is_modern(const char *optstr); +void netdev_parse_modern(const char *optstr); +void net_client_parse(QemuOptsList *opts_list, const char *optstr); void show_netdevs(void); void net_init_clients(void); void net_check_clients(void); diff --git a/net/net.c b/net/net.c index 1c0bfdaa6c..c0c0cbe99e 100644 --- a/net/net.c +++ b/net/net.c @@ -1677,7 +1677,7 @@ void net_init_clients(void) * Modern syntax is to be parsed with netdev_parse_modern(). * Traditional syntax is to be parsed with net_client_parse(). */ -bool netdev_is_modern(const char *optarg) +bool netdev_is_modern(const char *optstr) { QemuOpts *opts; bool is_modern; @@ -1689,13 +1689,13 @@ bool netdev_is_modern(const char *optarg) .desc = { { } }, }; - if (optarg[0] == '{') { + if (optstr[0] == '{') { /* This is JSON, which means it's modern syntax */ return true; } opts = qemu_opts_create(&dummy_opts, NULL, false, &error_abort); - qemu_opts_do_parse(opts, optarg, dummy_opts.implied_opt_name, + qemu_opts_do_parse(opts, optstr, dummy_opts.implied_opt_name, &error_abort); type = qemu_opt_get(opts, "type"); is_modern = !g_strcmp0(type, "stream") || !g_strcmp0(type, "dgram"); @@ -1711,12 +1711,12 @@ bool netdev_is_modern(const char *optarg) * netdev_parse_modern() appends to @nd_queue, whereas net_client_parse() * appends to @qemu_netdev_opts. */ -void netdev_parse_modern(const char *optarg) +void netdev_parse_modern(const char *optstr) { Visitor *v; NetdevQueueEntry *nd; - v = qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v = qobject_input_visitor_new_str(optstr, "type", &error_fatal); nd = g_new(NetdevQueueEntry, 1); visit_type_Netdev(v, NULL, &nd->nd, &error_fatal); visit_free(v); @@ -1725,9 +1725,9 @@ void netdev_parse_modern(const char *optarg) QSIMPLEQ_INSERT_TAIL(&nd_queue, nd, entry); } -void net_client_parse(QemuOptsList *opts_list, const char *optarg) +void net_client_parse(QemuOptsList *opts_list, const char *optstr) { - if (!qemu_opts_parse_noisily(opts_list, optarg, true)) { + if (!qemu_opts_parse_noisily(opts_list, optstr, true)) { exit(1); } } From patchwork Fri Oct 6 11:36:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729996 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp458380wrp; Fri, 6 Oct 2023 04:44:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEauFP03hWDo5OAW3iMRaBK4gXMzgdKI7R13lCWzr6mAXUuJtiFmh0CYf5dpxZbNTAKFi6T X-Received: by 2002:a05:620a:2683:b0:76a:eeb6:dd7b with SMTP id c3-20020a05620a268300b0076aeeb6dd7bmr8789022qkp.75.1696592662921; Fri, 06 Oct 2023 04:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592662; cv=none; d=google.com; s=arc-20160816; b=ylPoytftgygXhv7yL+cFb45u+kiuTerSzop3mGYtlxUk/rPsSvbPolVc8xIauXlncj pXcigz8WkgbJ8Kck8lhsxsvmglfsDRsZvLvajTQtKoJO7J9+zCO3k0+f9OxueWxzGmzv I8zGO3Y9MxmMlu0NFj++B9FtxOvmi1HrL3H5L4fmQUy/FLdqMtBGfOtqxIY+KFVJchs/ cNW0ClyL2xi2Ks9pMk3d+mUqenZcXtFRWM+U25nOBk3SNdT8pn2ilEgl/l6PRRWGcbEq WYzNZsCBTyxsgOae1WZBbuVHdP26vt0IklumOACr0qUmaQT4u+69puNneh/oHfjXCICz HISw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CzR+RMIq811dbSevTYmjOhuBh9GlyIdCm7XlyB+I4OM=; fh=i1pZRuKD5MhOXg6DnHnBvYF8Xhy7p4U+yXFYiz2hjRc=; b=cqo5AZjUbhfs8M226X7PVA5nUHjRnnTSE0Q1Uz9Psy2NoylC99Axswau+hvLIQ9OKQ 0uMCzXm99okSMdLt/JfBwiR8OwY726bTfTCiaCTLJ7N89Z23+1u7q7M5x7sf3Xz7blbo eb48Rkfp2NP6QfJWssDzoZ/IFnIVN2Tv9UzLbGgFZoER75dFkikTjVJasrMAvpuFg3KW GaG/g4lTcyfAdVgacMuvuZTf9r8Gi+xSXZ7xwsNZo1M9Le6uFbxOmfS15Xq/vxFZnso8 NXSvX30husyUIX+qTvYJf0ZjHro048R/VtvFJ5xyzaJ5rDGCwI0wqGCHLhEjwrZOWAYS VeUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ox7UCq0c; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id rg3-20020a05620a8ec300b00775b023f298si2196248qkn.139.2023.10.06.04.44.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:44:22 -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=@redhat.com header.s=mimecast20190719 header.b=Ox7UCq0c; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9K-00059P-7v; Fri, 06 Oct 2023 07:37:42 -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 1qoj8w-00051o-Di for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8q-00008C-Df for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592225; 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=CzR+RMIq811dbSevTYmjOhuBh9GlyIdCm7XlyB+I4OM=; b=Ox7UCq0cCbu1jCnw/0KNPMy3bPA++oD0eYQHsmVKCBDY24YulQcBmvPhSvOS2qlHeC6YNW qNWwZh+oqCPZchQTtqMqsXFj2VgrWDQY5emlTFNspjO6PB1nIdgbiKw1In83sFY/DSLKFi gyDmSVNaYAUJLE7upc0FhyeABUpMHCY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-354-aoflsY0cPHOD4_tY0WV8rg-1; Fri, 06 Oct 2023 07:37:00 -0400 X-MC-Unique: aoflsY0cPHOD4_tY0WV8rg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D708629A9D40; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5DB540C6EA8; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7A90021E6916; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 13/32] os-posix: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:38 +0200 Message-ID: <20231006113657.3803180-14-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: os-posix.c:103:31: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool os_set_runas(const char *optarg) ^ os-posix.c:176:32: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void os_set_chroot(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-5-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/sysemu/os-posix.h | 4 ++-- os-posix.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h index 6dfdcbb086..dff32ae185 100644 --- a/include/sysemu/os-posix.h +++ b/include/sysemu/os-posix.h @@ -49,8 +49,8 @@ void os_setup_signal_handling(void); int os_set_daemonize(bool d); bool is_daemonized(void); void os_daemonize(void); -bool os_set_runas(const char *optarg); -void os_set_chroot(const char *optarg); +bool os_set_runas(const char *user_id); +void os_set_chroot(const char *path); void os_setup_post(void); int os_mlock(void); diff --git a/os-posix.c b/os-posix.c index f90dfda9b0..52ef6990ff 100644 --- a/os-posix.c +++ b/os-posix.c @@ -94,13 +94,13 @@ static uid_t user_uid = (uid_t)-1; /* -1 -1 >=0 */ static gid_t user_gid = (gid_t)-1; /* -1 -1 >=0 */ /* - * Prepare to change user ID. optarg can be one of 3 forms: + * Prepare to change user ID. user_id can be one of 3 forms: * - a username, in which case user ID will be changed to its uid, * with primary and supplementary groups set up too; * - a numeric uid, in which case only the uid will be set; * - a pair of numeric uid:gid. */ -bool os_set_runas(const char *optarg) +bool os_set_runas(const char *user_id) { unsigned long lv; const char *ep; @@ -108,14 +108,14 @@ bool os_set_runas(const char *optarg) gid_t got_gid; int rc; - user_pwd = getpwnam(optarg); + user_pwd = getpwnam(user_id); if (user_pwd) { user_uid = -1; user_gid = -1; return true; } - rc = qemu_strtoul(optarg, &ep, 0, &lv); + rc = qemu_strtoul(user_id, &ep, 0, &lv); got_uid = lv; /* overflow here is ID in C99 */ if (rc || *ep != ':' || got_uid != lv || got_uid == (uid_t)-1) { return false; @@ -173,9 +173,9 @@ static void change_process_uid(void) static const char *chroot_dir; -void os_set_chroot(const char *optarg) +void os_set_chroot(const char *path) { - chroot_dir = optarg; + chroot_dir = path; } static void change_root(void) From patchwork Fri Oct 6 11:36:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729985 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456526wrp; Fri, 6 Oct 2023 04:39:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGB3pqO4h/X1D0cn3zcsbps21YWktLZwiG0NZ34id7QEMnRtb41ssgZ0t4g3BnZLQ46N5Sw X-Received: by 2002:a0c:b21e:0:b0:658:26d7:72e0 with SMTP id x30-20020a0cb21e000000b0065826d772e0mr7731996qvd.4.1696592380660; Fri, 06 Oct 2023 04:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592380; cv=none; d=google.com; s=arc-20160816; b=m2tmZls2PjAla4nYVJlQH6BW0SuLQ70fTKrLEZuMB8sGdbrCne4SJPaF/ckpq4ppsb CcUk7C2COcvtdIPjViTh5Cdm/WXxSruSqiGkODgmCzJ//z3UkGlrixIh94tuOHJWQ3Fm +lex8Fx2YnAZQYAHZckrKVUs4BD6vEOfDd+VqLeJggFtQEjyOJeWa3OAoV1hBlqkOPwx VuF0B/Ucn29OdDqZ5KW4sS1GE8+r5WqJMcxASo12mB2BXijeDANfbFwo1dfY8CZz+tp9 EebWQG2Lsk/nvuMk1xXKM7EobGqEa7C9U2dojlPjlGh5mdTPwnq3D50ZJLQHoagoimTu q55w== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yyqNIrAV89ZLDcW0VZ3dmJJQ7bbyUqitHtkl6WYqbIg=; fh=kFeeQCZHOWMjM3PvFVR/cFiybISAQy4MaQRyjN/+tkQ=; b=gJ/nVaZT86OnJM0rmYRC7KrVNziz5XH7hCunUF9mXkiuFdrmsJ0w3tiqfK65WLH7X1 wNyMAm2aMTDeRFzmS5uYSxTeTO46q5r0mttSbriu/u3R5MdUkq9/RSaZ8xr4/ixZ3HEc 9YKe2y5BKD63DxwtM/1rAu8uy158chvFSBJUc8ISfWgtZqW73c0BCQypojmCG2SOw5w1 fVEBrzVGkvM8Q/L1v+ME8cSBBbvgz1MURSaCLxwii9F+BRQH4lWF41YN8d1tO++1efef 8tfHU24HxrhiEiPWfwitW59Z1b7/wwDXFNS81dHth1JFtD5qIhebcD90lJ+VYduzVk5h ChNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FkIcl8ZJ; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id de12-20020a05620a370c00b0076d81c85ecesi2324548qkb.723.2023.10.06.04.39.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:40 -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=@redhat.com header.s=mimecast20190719 header.b=FkIcl8ZJ; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-00057T-47; Fri, 06 Oct 2023 07:37:40 -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 1qoj8u-00050s-8z for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8o-00008K-Ll for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592225; 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=yyqNIrAV89ZLDcW0VZ3dmJJQ7bbyUqitHtkl6WYqbIg=; b=FkIcl8ZJDH7UoWoKjmTZvxyzHolsHMA8lB6mHOF1Ow73tWVQ+qfd3jsGc5liFWy52Qen6C TQKH77+LN0oHZy42BD0/qnoX6Ftwv0zS2aIceY4qPXZxfAS/auvu+llB8Tq8YY/HFEqokq 4E7Bwc0p019tLf2x2AQ1sXdI6zAKMbk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-122-V48I8PrHNNiT-_s67WZmYA-1; Fri, 06 Oct 2023 07:37:00 -0400 X-MC-Unique: V48I8PrHNNiT-_s67WZmYA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DB36F18175A4; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAABD47AD4A; Fri, 6 Oct 2023 11:36:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7D5C821E691A; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 14/32] plugins/loader: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:39 +0200 Message-ID: <20231006113657.3803180-15-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: include/qemu/plugin.h:245:54: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static inline void qemu_plugin_opt_parse(const char *optarg, ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-6-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/qemu/plugin.h | 4 ++-- plugins/loader.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index bc0781cab8..7fdc3a4849 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -50,7 +50,7 @@ static inline void qemu_plugin_add_opts(void) qemu_add_opts(&qemu_plugin_opts); } -void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head); +void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head); int qemu_plugin_load_list(QemuPluginList *head, Error **errp); union qemu_plugin_cb_sig { @@ -242,7 +242,7 @@ void qemu_plugin_user_postfork(bool is_child); static inline void qemu_plugin_add_opts(void) { } -static inline void qemu_plugin_opt_parse(const char *optarg, +static inline void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head) { error_report("plugin interface not enabled in this build"); diff --git a/plugins/loader.c b/plugins/loader.c index 809f3f9b13..734c11cae0 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -140,12 +140,12 @@ static int plugin_add(void *opaque, const char *name, const char *value, return 0; } -void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head) +void qemu_plugin_opt_parse(const char *optstr, QemuPluginList *head) { struct qemu_plugin_parse_arg arg; QemuOpts *opts; - opts = qemu_opts_parse_noisily(qemu_find_opts("plugin"), optarg, true); + opts = qemu_opts_parse_noisily(qemu_find_opts("plugin"), optstr, true); if (opts == NULL) { exit(1); } From patchwork Fri Oct 6 11:36:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729993 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp458090wrp; Fri, 6 Oct 2023 04:43:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9s5crB2+HMk1ivif1Qlx387fNqt8dpj5/IzyLEbkCaqC5LPpLQzp/kPIZe1tO9dnVwS1Q X-Received: by 2002:a25:9c85:0:b0:d7f:d6a7:d57d with SMTP id y5-20020a259c85000000b00d7fd6a7d57dmr7245881ybo.27.1696592610569; Fri, 06 Oct 2023 04:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592610; cv=none; d=google.com; s=arc-20160816; b=TL9Nhvq5sGwND/a0JqfuVECdFnxzjP4a0I3LhdU8S6HxIwWA5OMfeXhuPwDMvMnyq9 TX+X+YDRAjc8BRysXTHK7dFY1sFRwtYpZSryG/gwAeF/eBl00G4qLWEhibu2Mcms16/Y ntq7ik/Lyb2kvHboVEVzUVP4Uv1+Lg/kIyIWyp+Y1E8owvsnCiWYDImAFNQ2+m8989gQ EZywmsL1TUZtyZAiCn01A4WBFXG4ydVwx0WoolcrLlgihCD+aHb1YLKItclHXrz+4J+D 8TyPfL8TcPhVAMWjpyinWaJWv1Ab/fL0J2wBAH45lpmOonk6T+HTFYDEIb0wkNuQDtf7 KViw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n4zK6KjuMtQLVDggv3EgqW/6JdP/Ds6q2/MlLzdYfIo=; fh=i1pZRuKD5MhOXg6DnHnBvYF8Xhy7p4U+yXFYiz2hjRc=; b=DobUEwmYCgwRPXsqfxbex6VrF/M7nPThaBOJQW7n80tmVNXJ0eJXyyB2tGibNNKYcb aRxxq0TcFVWzObHGY+mc+nbv0i/vX24FXdlvWcD8zUicZnMN0nfXTUEdYQmUs2p8TYO7 Rx7JKbI+j0EiSHQQvNHo8RqcHYUWulOcKZaQ3VWkZfPMIVyqGqePpFrn14eH6zJvlRVC VfK+Qoo38S9MWAcN6CQkGxpVFOzR7dhc+Iw8WB52rvzIiQo92QSTy0t0pByzZjGiSEfW 4q/NSYRq2FyiRbIv+xhBfT01qNmEOfF3Y9nFmuxX8k/GaIvbY7zzUmORbIM6ycWZM8c1 lZXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DQRlTDMk; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c10-20020a0ce14a000000b0065b0fc01a9dsi2202355qvl.385.2023.10.06.04.43.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:43:30 -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=@redhat.com header.s=mimecast20190719 header.b=DQRlTDMk; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9V-0005Eu-C5; Fri, 06 Oct 2023 07:37:53 -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 1qoj96-00054D-Qj for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj90-0000EB-Iw for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592239; 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=n4zK6KjuMtQLVDggv3EgqW/6JdP/Ds6q2/MlLzdYfIo=; b=DQRlTDMkRIAhFz8x9k15kOVtRjkQeJM7qX+v+EaurPWii1WqLi/fVurwvomrxGVPFfPmWN bJ7YmMqlezyRK/00AWWhJ/Gz+1z5T44p/GyCNfBire6pmHNNjxluBSEiBZdk7oF/vMs4Bj qUokaaguM8dF0ibvMlSaUtrNaFY8+Pk= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-_gTK8oOBPE653dfOeH2B0g-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: _gTK8oOBPE653dfOeH2B0g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D797E3827DE8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 952055CC01; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8076E21E691B; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 15/32] qemu-img: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:40 +0200 Message-ID: <20231006113657.3803180-16-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: qemu-img.c:247:46: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static bool is_valid_option_list(const char *optarg) ^ qemu-img.c:265:53: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static int accumulate_options(char **options, char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-7-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- qemu-img.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a48edb7101..6068ab0d27 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -235,25 +235,25 @@ void help(void) } /* - * Is @optarg safe for accumulate_options()? + * Is @list safe for accumulate_options()? * It is when multiple of them can be joined together separated by ','. - * To make that work, @optarg must not start with ',' (or else a + * To make that work, @list must not start with ',' (or else a * separating ',' preceding it gets escaped), and it must not end with * an odd number of ',' (or else a separating ',' following it gets * escaped), or be empty (or else a separating ',' preceding it can * escape a separating ',' following it). * */ -static bool is_valid_option_list(const char *optarg) +static bool is_valid_option_list(const char *list) { - size_t len = strlen(optarg); + size_t len = strlen(list); size_t i; - if (!optarg[0] || optarg[0] == ',') { + if (!list[0] || list[0] == ',') { return false; } - for (i = len; i > 0 && optarg[i - 1] == ','; i--) { + for (i = len; i > 0 && list[i - 1] == ','; i--) { } if ((len - i) % 2) { return false; @@ -262,19 +262,19 @@ static bool is_valid_option_list(const char *optarg) return true; } -static int accumulate_options(char **options, char *optarg) +static int accumulate_options(char **options, char *list) { char *new_options; - if (!is_valid_option_list(optarg)) { - error_report("Invalid option list: %s", optarg); + if (!is_valid_option_list(list)) { + error_report("Invalid option list: %s", list); return -1; } if (!*options) { - *options = g_strdup(optarg); + *options = g_strdup(list); } else { - new_options = g_strdup_printf("%s,%s", *options, optarg); + new_options = g_strdup_printf("%s,%s", *options, list); g_free(*options); *options = new_options; } From patchwork Fri Oct 6 11:36:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729991 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp457745wrp; Fri, 6 Oct 2023 04:42:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeE3CB7F/MJR+5wUxrg/m/RbSSvJMK2jrgaMua3GIvF6VWv+HvLK2BhpuGRtS2/VLOJvTO X-Received: by 2002:a05:6214:3d06:b0:656:5441:a13f with SMTP id ol6-20020a0562143d0600b006565441a13fmr8481085qvb.45.1696592561482; Fri, 06 Oct 2023 04:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592561; cv=none; d=google.com; s=arc-20160816; b=YqP/2JKqQMrnKH4WZkIWCIBi5tmelvKXNDWwe/W7LyNwu6F5VewwGi9nJLorc/0kfS yArueisMW6lqiqogAFqxx+LI5zvUCLmZdLckB/OCsnmGRm8emv/qaJfLJSVTc69LMjWA nEqrObWbIhXyAxkTjOE92t1JkNqrOY+ZmDxHThyNM0qMvmxY2bjjBMlxa7hq0RiZAiGG eKx7XJQk5b+JYAVBvuL2XNhjba1rSAMzk/zP8To+JCUtOvLp93bGPDyyGUVjkWvz6jDF 9N94KgPG0t2CiZiK+hik7JS/RdxUOTDhdV54pGuHv/lZ0I/YN+hhQQUvk2RUmSM+SV+5 CcrA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UcknsHua8YgZyyV7nIDQ/TchOkuc6nnQyZPLvod9uD4=; fh=i1pZRuKD5MhOXg6DnHnBvYF8Xhy7p4U+yXFYiz2hjRc=; b=CjtgDcvOZ27vhhIwgxgxjtQx0WTWtdnPdKAHA/0V1rXukN644A5+Vg+NqVVXnulp8/ 0U7hOrb2EAgyktK6zA7hweZCglT+uny0annM+363NJMCs+o4MOOhTpzwQgaj0qdHtNu7 XxdBnNiwE1F6kBhfIxgC1WDLhe3ArOFZ/XtdpZjafERS1qhwjCVLBJ+l5iHABJSmcdp7 GA5WstXzHzQUcFg9Z9yjXF7PsKcjWTNdMbchorl9ZCgrlKjUr4cQ+MXOoHteazzeBMZl 7XQMlaFlkLOD22VRX8InmRnUVq5SyIKgWiHWIIKr5Q37rHhXg61jfB2X+x+rMbeltOmI ymPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JB5ZLYv5; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o8-20020a05620a2a0800b00774383c131dsi2288655qkp.121.2023.10.06.04.42.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:42:41 -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=@redhat.com header.s=mimecast20190719 header.b=JB5ZLYv5; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9H-00057K-HI; Fri, 06 Oct 2023 07:37:39 -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 1qoj8w-00051m-CR for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-0000Ao-7L for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=UcknsHua8YgZyyV7nIDQ/TchOkuc6nnQyZPLvod9uD4=; b=JB5ZLYv5Alzm204ha/9nbCWoM9QKxAQtzOQVMPs6J6cpmThcaCYq4CClM4qxRbk6ywzTJ+ HLjYsrPemA+Q5gqcJzjuIPexBATziJRip9qm+dCr1ECn+acwr++3cLytqbOLSHspDTsD23 xhQsPu4uOyplCZaspJFF9cPVI9RUuCo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-0yn3IVeBMgy__mbPnEaeVw-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: 0yn3IVeBMgy__mbPnEaeVw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D75E818175A1; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 957A91054FC0; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 835C321E691C; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 16/32] qemu-io: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:41 +0200 Message-ID: <20231006113657.3803180-17-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: qemu-io.c:478:36: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void add_user_command(char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-8-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- qemu-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 2bd7bfb650..050c70835f 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -475,10 +475,10 @@ static int command_loop(void) return last_error; } -static void add_user_command(char *optarg) +static void add_user_command(char *user_cmd) { cmdline = g_renew(char *, cmdline, ++ncmdline); - cmdline[ncmdline-1] = optarg; + cmdline[ncmdline - 1] = user_cmd; } static void reenable_tty_echo(void) From patchwork Fri Oct 6 11:36:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729988 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp457372wrp; Fri, 6 Oct 2023 04:41:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEudvVxc471j2mb+OQUjQkAqfh5d8ROXXxOgITBHiGY9HVe1+CYZ9KxbKeMnoPaaIOptM3h X-Received: by 2002:ac8:5b0c:0:b0:419:4bdf:756b with SMTP id m12-20020ac85b0c000000b004194bdf756bmr9444544qtw.36.1696592505380; Fri, 06 Oct 2023 04:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592505; cv=none; d=google.com; s=arc-20160816; b=s6LojNkP9d1ffubzcwIJ92bYI9SxrkYtQfWRqW31DQDkBjXiNHTa5PDhiI76pYWPI+ L1mmBhAc4ZubmN7zq0OvhuQZS/6/51UqsxXetpQOusDtCUlEpaWd9SBXkO+hO/tFpu3G tBbfvyputPpAiYIO4tc09bEDPTPoAqHlTzazt20y+h3DB13D360AGgyUsntbkbyNI/7k HqgjUwpmwFqQUT80hplw9/w81TjlomsbETF+divCBneQjHrzdwAZ8/Wgh2TxLaw0aC/4 BGVoN0N2qxY9ydkFzOw1gA+di8oDPf/jLfwOhPDmZrJUkKGODaiE8ixaeHXu7q5rMyFt p7Zg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kQ+pT3ow6c+WuoVGzJFiDX22KI3j54JHlCbDNYJLjwE=; fh=kFeeQCZHOWMjM3PvFVR/cFiybISAQy4MaQRyjN/+tkQ=; b=sCI/sSITT+XEjt6Ioa8IB7eMulbOvBVE7iwm8sgczr1iMU3QqtF+looTv5nWlK4UX/ NWEEUFcVsuIu0Xj+rMngJvuIPdIzRN/kUFEdQ+dWkrOeSWGWSX2+tA65SgnOk2h3CXKf 20Ac/9QL/RL1rinz0g57E9LZXQ2WE8XHLGxZfqkDsMBuXZASf0vr3CgJ53p7a4U6K18N CWKlF7a8svD0vY+m8Zu37eKFCfDnN9bDk9tOpoFjQ06mVlA7uPsWMyDgaKNxTIJZNHcW BjzCxsveutjzD5oiGphY+hL9IOpz7+FMOltYU+G4wKEJPgf/NhW9u7Afw/O7/vVmLyMa t90w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OwaMSJV1; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n8-20020a05622a040800b00418142e801csi2249027qtx.485.2023.10.06.04.41.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:41:45 -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=@redhat.com header.s=mimecast20190719 header.b=OwaMSJV1; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9L-0005A9-Ee; Fri, 06 Oct 2023 07:37:43 -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 1qoj96-00054E-Vi for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj92-0000EK-Of for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592239; 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=kQ+pT3ow6c+WuoVGzJFiDX22KI3j54JHlCbDNYJLjwE=; b=OwaMSJV1Iwybc4yhdPGG8V0+qPCj1pOZps1VbmbcFvr5prR4xbTVP4X1LVXzC84sgi9uTp 0QENm4AZkPo3AM6529Cx8brpCmCYxDRf28NF/0D4OlWhMj/0bGkBClFS/pLMIqkfVL6leK Eg1jB+ZcQdNjwfRboIkOM6VcDQhkrt0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-418-UuB_B-BbNG25SXr0P506Yg-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: UuB_B-BbNG25SXr0P506Yg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3C35101A58B; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 956A72156711; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8644C21E6880; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 17/32] qom/object_interfaces: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:42 +0200 Message-ID: <20231006113657.3803180-18-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: qom/object_interfaces.c:262:53: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:298:46: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] bool user_creatable_add_from_str(const char *optarg, Error **errp) ^ qom/object_interfaces.c:313:49: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void user_creatable_process_cmdline(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-9-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/qom/object_interfaces.h | 16 ++++++++-------- qom/object_interfaces.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/qom/object_interfaces.h b/include/qom/object_interfaces.h index 81541e2080..02b11a7ef0 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -99,7 +99,7 @@ void user_creatable_add_qapi(ObjectOptions *options, Error **errp); /** * user_creatable_parse_str: - * @optarg: the object definition string as passed on the command line + * @str: the object definition string as passed on the command line * @errp: if an error occurs, a pointer to an area to store the error * * Parses the option for the user creatable object with a keyval parser and @@ -110,14 +110,14 @@ void user_creatable_add_qapi(ObjectOptions *options, Error **errp); * Returns: ObjectOptions on success, NULL when an error occurred (*errp is set * then) or help was printed (*errp is not set). */ -ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp); +ObjectOptions *user_creatable_parse_str(const char *str, Error **errp); /** * user_creatable_add_from_str: - * @optarg: the object definition string as passed on the command line + * @str: the object definition string as passed on the command line * @errp: if an error occurs, a pointer to an area to store the error * - * Create an instance of the user creatable object by parsing optarg + * Create an instance of the user creatable object by parsing @str * with a keyval parser and implicit key 'qom-type', converting the * result to ObjectOptions and calling into qmp_object_add(). * @@ -126,13 +126,13 @@ ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp); * Returns: true when an object was successfully created, false when an error * occurred (*errp is set then) or help was printed (*errp is not set). */ -bool user_creatable_add_from_str(const char *optarg, Error **errp); +bool user_creatable_add_from_str(const char *str, Error **errp); /** * user_creatable_process_cmdline: - * @optarg: the object definition string as passed on the command line + * @cmdline: the object definition string as passed on the command line * - * Create an instance of the user creatable object by parsing optarg + * Create an instance of the user creatable object by parsing @cmdline * with a keyval parser and implicit key 'qom-type', converting the * result to ObjectOptions and calling into qmp_object_add(). * @@ -141,7 +141,7 @@ bool user_creatable_add_from_str(const char *optarg, Error **errp); * This function is only meant to be called during command line parsing. * It exits the process on failure or after printing help. */ -void user_creatable_process_cmdline(const char *optarg); +void user_creatable_process_cmdline(const char *cmdline); /** * user_creatable_print_help: diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 7d31589b04..e0833c8bfe 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -259,7 +259,7 @@ static void user_creatable_print_help_from_qdict(QDict *args) } } -ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) +ObjectOptions *user_creatable_parse_str(const char *str, Error **errp) { ERRP_GUARD(); QObject *obj; @@ -267,14 +267,14 @@ ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) Visitor *v; ObjectOptions *options; - if (optarg[0] == '{') { - obj = qobject_from_json(optarg, errp); + if (str[0] == '{') { + obj = qobject_from_json(str, errp); if (!obj) { return NULL; } v = qobject_input_visitor_new(obj); } else { - QDict *args = keyval_parse(optarg, "qom-type", &help, errp); + QDict *args = keyval_parse(str, "qom-type", &help, errp); if (*errp) { return NULL; } @@ -295,12 +295,12 @@ ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp) return options; } -bool user_creatable_add_from_str(const char *optarg, Error **errp) +bool user_creatable_add_from_str(const char *str, Error **errp) { ERRP_GUARD(); ObjectOptions *options; - options = user_creatable_parse_str(optarg, errp); + options = user_creatable_parse_str(str, errp); if (!options) { return false; } @@ -310,9 +310,9 @@ bool user_creatable_add_from_str(const char *optarg, Error **errp) return !*errp; } -void user_creatable_process_cmdline(const char *optarg) +void user_creatable_process_cmdline(const char *cmdline) { - if (!user_creatable_add_from_str(optarg, &error_fatal)) { + if (!user_creatable_add_from_str(cmdline, &error_fatal)) { /* Help was printed */ exit(EXIT_SUCCESS); } From patchwork Fri Oct 6 11:36:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729982 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456262wrp; Fri, 6 Oct 2023 04:39:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErbnUVluSVvpAQdPwW3kLrHiTJIhXO8R9glDH0fnBI/9+3rCNS+6gVnrNssJ4O1dqVXJuW X-Received: by 2002:ac8:5a4e:0:b0:405:464d:5bb0 with SMTP id o14-20020ac85a4e000000b00405464d5bb0mr8355161qta.32.1696592347667; Fri, 06 Oct 2023 04:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592347; cv=none; d=google.com; s=arc-20160816; b=unNslffrkOo5KxCA87nzfCBvMpjhGI3mizTc0VahMN2mDXx059CqR6vn69bCkeR2PR Gi08oMHuNx0td9KHsBhaDHTGBArE/5WwCdyp0O5P6kF0pwAd7x+MufMub72g1WM5wboV qKj6pAFX+oBwsYKWAoe0RBCJZJ1mnECBxAm/5TLPeVXGgesshzX6T6GPDxtWy+z28AkT YNMUWpw7f3sly2U2GFMnJGyr4i0DMCa4THMxmgyL3NHXeZDOwr2gzfChn3q4E3w/XFfm yufAz/CQ4CbnM2QQhTBUij+vjwucJlFRO0+Lo556/rHGJ9t1X54ImqhOvFuExbxSBFvr eTjA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E0/SmeVkKQwC85Yi9z735skKKvyYk8aaSrlBFMMKON8=; fh=cMN3UMXV46LDoC93McQlOI1ylKXTcR5CnghT4eHEg8Y=; b=tvxjW1p4wsc1pb4Rk7kEKoUpfiI0lAHyUVcS8cNSEmWrcStiOzu5YqXuY2qkVjo1zD OXGCJZec9jLg6g6m3YfI2qSK1aIRX46ZV735hw5yyovw4OOtRtyYwP7oti7nPpjqLFvf ZoN94i3VlHJmN7ew2taP+RGpV4UG/7yl/iHKWN/gfFb6M+IxcSmfpHktOHXRm/Rq84+F v1TWf2Y//tinbFuPZONcMs5nyoRsiOMFaXyXbu2AwH7D7dPwumdO+FjZiQtbTWE0aQ2N 61uLcSWrq0C+5EpysZQ0okOlyVxzGXu5qXV8fCNQhurH11+f5eW/tqSBOjPC6K/8mMXw aQeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cGcp62DK; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m18-20020a05622a055200b004199dd36307si2236265qtx.484.2023.10.06.04.39.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:07 -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=@redhat.com header.s=mimecast20190719 header.b=cGcp62DK; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9E-000557-4D; Fri, 06 Oct 2023 07:37:36 -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 1qoj8t-00050l-Lr for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8n-00007B-UC for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592222; 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=E0/SmeVkKQwC85Yi9z735skKKvyYk8aaSrlBFMMKON8=; b=cGcp62DKW/hNGMXMM4WlkPkwL5d4ZErAW0KWOH1oFMnOXGBJvA2QRY/A7CppF9VR2BZeuh /Spttx/p8kPRNHyApM1ztcEghKHCTsVlEU6+uPcpeKN29CjIyPco6y0BIpuQ/73hVIMgyQ D7g5CXOhHQfD/IKsLEEkYFe0OqDselI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-57-GUgSinHLNO6mKmG-zgCWcQ-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: GUgSinHLNO6mKmG-zgCWcQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8A191C06367; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95DC440C6EA8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8934E21E6882; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Richard Henderson Subject: [PULL 18/32] semihosting: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:43 +0200 Message-ID: <20231006113657.3803180-19-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: semihosting/config.c:134:49: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] int qemu_semihosting_config_options(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-10-philmd@linaro.org> Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/semihosting/semihost.h | 2 +- semihosting/config.c | 8 ++++---- stubs/semihost.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/semihosting/semihost.h b/include/semihosting/semihost.h index efd2efa25a..97d2a2ba99 100644 --- a/include/semihosting/semihost.h +++ b/include/semihosting/semihost.h @@ -66,7 +66,7 @@ const char *semihosting_get_cmdline(void); void semihosting_arg_fallback(const char *file, const char *cmd); /* for vl.c hooks */ void qemu_semihosting_enable(void); -int qemu_semihosting_config_options(const char *opt); +int qemu_semihosting_config_options(const char *optstr); void qemu_semihosting_chardev_init(void); void qemu_semihosting_console_init(Chardev *); #endif /* CONFIG_USER_ONLY */ diff --git a/semihosting/config.c b/semihosting/config.c index 8ca569735d..e826457733 100644 --- a/semihosting/config.c +++ b/semihosting/config.c @@ -131,10 +131,10 @@ void qemu_semihosting_enable(void) semihosting.target = SEMIHOSTING_TARGET_AUTO; } -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { QemuOptsList *opt_list = qemu_find_opts("semihosting-config"); - QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optarg, false); + QemuOpts *opts = qemu_opts_parse_noisily(opt_list, optstr, false); semihosting.enabled = true; @@ -155,7 +155,7 @@ int qemu_semihosting_config_options(const char *optarg) semihosting.target = SEMIHOSTING_TARGET_AUTO; } else { error_report("unsupported semihosting-config %s", - optarg); + optstr); return 1; } } else { @@ -165,7 +165,7 @@ int qemu_semihosting_config_options(const char *optarg) qemu_opt_foreach(opts, add_semihosting_arg, &semihosting, NULL); } else { - error_report("unsupported semihosting-config %s", optarg); + error_report("unsupported semihosting-config %s", optstr); return 1; } diff --git a/stubs/semihost.c b/stubs/semihost.c index aad7a70353..b3c61935b3 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -36,7 +36,7 @@ void qemu_semihosting_enable(void) { } -int qemu_semihosting_config_options(const char *optarg) +int qemu_semihosting_config_options(const char *optstr) { return 1; } From patchwork Fri Oct 6 11:36:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729983 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456273wrp; Fri, 6 Oct 2023 04:39:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPIHl1Q2nbpiQhzgLnplqkH/L804JKL9b6c+xzcNhr8Eli+IoUTQQC6JhICye/cEzB0lqG X-Received: by 2002:a05:620a:370f:b0:76c:e86f:ffe3 with SMTP id de15-20020a05620a370f00b0076ce86fffe3mr9228099qkb.5.1696592348927; Fri, 06 Oct 2023 04:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592348; cv=none; d=google.com; s=arc-20160816; b=Us1QQuEsqbOWYkGnBHOseMNT1mBvag+4Xsr7myaRAqnhl4Z2FezVsm8vye3/Zcf5c9 a3ZW/136VZwZURTf/Ti9vlYvRz2enWQI4IMAz4GZ2R92X73daiAZKdwVAnLmGNkWwU/c bfNfWu3WTuKbED5rldt/lQENLzJ2ZSLU7SyFUOul+M7F+j3N0BFVKWw3KBd2UTbnNOzX aN/8FbpWThkKFvLZ0S0JehRtfKBlFcCYxk9H4/1Pk7jg8P2RL3LlsnjkyQ3Bbi5ukcjM jWnworMB2MI5A2e6H4zyEN7PQ7EN6EoqIwyI2qR0O1vNdbn4CT7vN+R8VYgQCt2+Q4U4 ZAvg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TcMr9UNXIYVFqDWLs8PuAu50D7wm7GFqqHd0XuLYOis=; fh=is1x/bOinSpEUrx6mak76+V61LupJNqcRYtwgFOxafg=; b=kezRj9GujdwaSXJkGTxbs1RC8OSdW0/VgIfyegA107RPPxEujltU/JUb8qQUN3FDiO wB0eBa5gRMeQe4yynDfjbngcpjl61mnj6edDtnC7zQKzyhu7spysbvKPWuZnFVnS986c 6L/M51SfcdzZkEBjPODTpGW7j3GTiRNcB7qq9giyJvhVavd7NWQjcST/DyxvbUVMPZG3 q2kodXKzYGl0gCO3r8oGzDSDUKtAiQ71J6fBNDpgxzXQI1MZcyG4EiH7hvvWgGjP03OU Vt6rsFhyQuHrS9wlcDi5oVYPY5wTgPEx/45E0Lxm6di66TTeW4vYA5MlCKuTf1PbmwiP FGYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fgRPhZdj; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id tx5-20020a05620a3f0500b00767e30f501asi2134682qkn.402.2023.10.06.04.39.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:08 -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=@redhat.com header.s=mimecast20190719 header.b=fgRPhZdj; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9S-0005CS-Jc; Fri, 06 Oct 2023 07:37:50 -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 1qoj8w-00051t-Vc for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-00007c-8O for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592223; 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=TcMr9UNXIYVFqDWLs8PuAu50D7wm7GFqqHd0XuLYOis=; b=fgRPhZdjR/8wkI0PoZ2k+Jbx3DrJvLfvJUbWGTxWwfXl1qXNXJ1Z62ugw5jSG6GJSlapCL ij8S09V09lpLqG6D/fkXPd0rggPxaUCxNBxk72NU2qCn9T5IH0cm7jhNxZXL+SF+zt+Bcc hhBHq7uaXOQmaixMzbSibH+yWC+91k4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-nRiQqCyxN2iP440Z7DHFJQ-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: nRiQqCyxN2iP440Z7DHFJQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D764A811E8D; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B88F1054FC1; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8C0DD21E6883; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Akihiko Odaki Subject: [PULL 19/32] ui/cocoa: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:44 +0200 Message-ID: <20231006113657.3803180-20-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: ui/cocoa.m:346:20: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] QemuCocoaView *cocoaView = userInfo; ^ ui/cocoa.m:342:16: note: previous declaration is here QemuCocoaView *cocoaView; ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-11-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Akihiko Odaki Signed-off-by: Markus Armbruster --- ui/cocoa.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 145f42d190..d95276013c 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -343,9 +343,9 @@ - (void) raiseAllKeys; static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEventRef cgEvent, void *userInfo) { - QemuCocoaView *cocoaView = userInfo; + QemuCocoaView *view = userInfo; NSEvent *event = [NSEvent eventWithCGEvent:cgEvent]; - if ([cocoaView isMouseGrabbed] && [cocoaView handleEvent:event]) { + if ([view isMouseGrabbed] && [view handleEvent:event]) { COCOA_DEBUG("Global events tap: qemu handled the event, capturing!\n"); return NULL; } From patchwork Fri Oct 6 11:36:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729986 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456631wrp; Fri, 6 Oct 2023 04:39:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwxT+r7zq1NF4LkIXsG3PmssSoe9TLdltux18QOm20/IwPGluBfCGbOHT6X1PZNOsCWX+Q X-Received: by 2002:a0c:f14b:0:b0:655:d6ff:891f with SMTP id y11-20020a0cf14b000000b00655d6ff891fmr7718733qvl.60.1696592396414; Fri, 06 Oct 2023 04:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592396; cv=none; d=google.com; s=arc-20160816; b=wOHswGBx6m0XfSwkJ04dOHX7tf4a5y+vEZgWza4QzEoSq2OIFpWzTAwBQNoQ+VWQXa nYKvZSZb6n+PjYX+TqHyExdRiSfLdRleF2fJunYZE4YH+496M8xyv9Gtjf72Tr2lpz29 lI69u+ZXqXC2vU7MlD4Wqaa4RG3fBp15jVEnrL4fP7iXezrNdmDccOU6q/OIOvtrydwN gxxt6vYQpX0yDuczm35y0Kum0HMcbfOkqz8KcNatfqs6h0qcQuUq9J2mMcyh5bP9isY+ 0g1U6jaMKwyQAVN7jHCkT5feFF/BbPr19UfrW9IqabwPGKlBmXGsmlac1dc/49vZwbSe IQNQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PmF1lPTY/N4yZXnoI95jbT0XyzCg+nV6j51RKZahf70=; fh=i1pZRuKD5MhOXg6DnHnBvYF8Xhy7p4U+yXFYiz2hjRc=; b=SZhgS1kTaGzTsQNINB0qFsMfTawornJRNnbK1tWAeb6tmHMZvhCPT2jQTnbrChC2k/ TDL/Z5c2wa8XJASe1jlAOb3yCqgVHdgT2aqX5gSjqtRBG8TViLkZBEcbM2eE8FH6LJtF oa61L+vqwzmRyMAdupDUw1EvomyMX4MZRkkzAupNsOvD/L0IOyOga8a6t2EilmZi6kOI m6J14I145NrHSxDhKEVimDARwfNNJVCylG13HX6Dq4P5L1gqnkCdC4eQ6Z+Zpgimj/o0 49IO7afFH6DaHvhQ6clGjcsXqT+urohokjku2es5IKbOo3I32fms0wPDz2hkMJn1VXRV 2onQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VuQBsMfb; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k13-20020a0cf58d000000b006472db95085si2154787qvm.544.2023.10.06.04.39.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:56 -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=@redhat.com header.s=mimecast20190719 header.b=VuQBsMfb; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9I-00057o-J7; Fri, 06 Oct 2023 07:37:40 -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 1qoj8z-00052v-AG for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-0000Ar-8d for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=PmF1lPTY/N4yZXnoI95jbT0XyzCg+nV6j51RKZahf70=; b=VuQBsMfbNTj2RPTNVW0d3rgbEb3z3eoyvrKZo86fEelaki7cwT2ieOxHhDIWVy4y/m4Cwa r/zSHdjz1GPLJIeKL/siHJszDYkecoptx2QgpPpmiiXht7tVtulQAuM6zDsnmvhq/DDQJj lCU2EROBQGn7cSe1TxILrgVfpp+UahQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-FRB752AhO7i51ut9_CXhsQ-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: FRB752AhO7i51ut9_CXhsQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8385811E8E; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96C8640C6EC0; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8EF3421E6884; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Blake , Richard Henderson Subject: [PULL 20/32] util/cutils: Clean up global variable shadowing in get_relocated_path() Date: Fri, 6 Oct 2023 13:36:45 +0200 Message-ID: <20231006113657.3803180-21-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: util/cutils.c:1147:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const char *exec_dir = qemu_get_exec_dir(); ^ util/cutils.c:1035:20: note: previous declaration is here static const char *exec_dir; ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-12-philmd@linaro.org> Reviewed-by: Eric Blake Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- util/cutils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index 25373198ad..b44718a6a2 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -1144,7 +1144,6 @@ char *get_relocated_path(const char *dir) { size_t prefix_len = strlen(CONFIG_PREFIX); const char *bindir = CONFIG_BINDIR; - const char *exec_dir = qemu_get_exec_dir(); GString *result; int len_dir, len_bindir; From patchwork Fri Oct 6 11:36:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729989 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp457375wrp; Fri, 6 Oct 2023 04:41:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqJffUbGXwvRQezADX2QfL8hWFa8WCs/LNT6LG8P2yLDnJFd3p2g0V7kfbtY7S4PA7Nzlx X-Received: by 2002:a0c:8c8e:0:b0:65b:765:254 with SMTP id p14-20020a0c8c8e000000b0065b07650254mr6743229qvb.4.1696592505520; Fri, 06 Oct 2023 04:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592505; cv=none; d=google.com; s=arc-20160816; b=a0qa5mjLVy5mryVMUqbWaZiaYIGRDtkG5mVciW/j0TLssSlTZVMHGik2i3UqfktOUj EFOzkFFoUWkp/ECqgCVFkDBX/8RpepAJ5znnkviiTsYkqV8VeKMmYnRCvoqfJ5a9eRJU JGtOW11agevdUkaLnxU9gd6DjIlK85wWsYkuwMBw4BXkZr+8AVj0S4FBBz5jDi5GO7Q2 zphZOiBMnagRQSLjphWtXSby+hrvJFj//ZYv2FIoJrGEgpgb7bgydDh5C2CJXMLxbWGS RKFFQOBNJmXVJJtYdCLaYVvkrylfJO7XWZMh9xfJvUl5g2q04bqHNvBZo+RERR7s9JSL ywUA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+n7FavU8lRQasqyJ6zeG5ii/6CvqBflzCFUIfyjdja4=; fh=kFeeQCZHOWMjM3PvFVR/cFiybISAQy4MaQRyjN/+tkQ=; b=GUbXPVTB4jCEPbJ/A0PhnL6OhbpTfyXri5woqsMtA+AuH1gjplbR92Ih2x8+BAFstY qUHLlOxoYBlbJBaCOSUsZSRtCZtQOvtdGUfz6DpOYMJiORUDNJYGz91oROaRUV84LL/a eK6JpQHZmmlY2UrcIT/Lx8zPSx6Nj6cuJoqvC3/iRu2V278/vMmXxlZ0kElOP+J0Ltxj q6TWstvtd+kFSthZsgwtaRp/7vGeYDymA2tQ4ADrkzrNbLVqwImzpUMEUI8HEbT+vAF0 mKtWGcrmnMUiG/lBB88RPWg6gR+vKcVxal0EJcyF1Ss2vpkU0snc1ViUL+epDbFWjKHq D+Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qef8mxyn; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z1-20020a0cf001000000b0064f80d285e7si2197602qvk.275.2023.10.06.04.41.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:41:45 -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=@redhat.com header.s=mimecast20190719 header.b=Qef8mxyn; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9H-00056v-6h; Fri, 06 Oct 2023 07:37:39 -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 1qoj8q-0004zn-L4 for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8m-00007u-9j for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592224; 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=+n7FavU8lRQasqyJ6zeG5ii/6CvqBflzCFUIfyjdja4=; b=Qef8mxynfu2Lf9YbP4OVntVCuEAsPq1RocHnHMMKCM3g7KGU/+BOPjwKHOs5ROyTdw3RIi blTSDU+LNJ34Hs+JEpDLsgD5EG3jwfRveLrwpkAWyJw8Htmmyysr2OYC+eP5yGkTm4zTRJ jBlqpEBoq4NN2yCO0C8c0euN86btBC0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-65-X-hnvj4XOtCa_kcywqJiXA-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: X-hnvj4XOtCa_kcywqJiXA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BA32029A9D42; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97D2240D1EA; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 91BEB21E6885; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 21/32] util/guest-random: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:46 +0200 Message-ID: <20231006113657.3803180-22-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: util/guest-random.c:90:45: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] int qemu_guest_random_seed_main(const char *optarg, Error **errp) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-13-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/qemu/guest-random.h | 8 ++++---- util/guest-random.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/qemu/guest-random.h b/include/qemu/guest-random.h index 09ff9c2236..5060d49d60 100644 --- a/include/qemu/guest-random.h +++ b/include/qemu/guest-random.h @@ -13,16 +13,16 @@ #define QEMU_GUEST_RANDOM_H /** - * qemu_guest_random_seed_main(const char *optarg, Error **errp) - * @optarg: a non-NULL pointer to a C string + * qemu_guest_random_seed_main(const char *seedstr, Error **errp) + * @seedstr: a non-NULL pointer to a C string * @errp: an error indicator * - * The @optarg value is that which accompanies the -seed argument. + * The @seedstr value is that which accompanies the -seed argument. * This forces qemu_guest_getrandom into deterministic mode. * * Returns 0 on success, < 0 on failure while setting *errp. */ -int qemu_guest_random_seed_main(const char *optarg, Error **errp); +int qemu_guest_random_seed_main(const char *seedstr, Error **errp); /** * qemu_guest_random_seed_thread_part1(void) diff --git a/util/guest-random.c b/util/guest-random.c index 9465dda085..33607d5ff2 100644 --- a/util/guest-random.c +++ b/util/guest-random.c @@ -87,11 +87,11 @@ void qemu_guest_random_seed_thread_part2(uint64_t seed) } } -int qemu_guest_random_seed_main(const char *optarg, Error **errp) +int qemu_guest_random_seed_main(const char *seedstr, Error **errp) { uint64_t seed; - if (parse_uint_full(optarg, 0, &seed)) { - error_setg(errp, "Invalid seed number: %s", optarg); + if (parse_uint_full(seedstr, 0, &seed)) { + error_setg(errp, "Invalid seed number: %s", seedstr); return -1; } else { deterministic = true; From patchwork Fri Oct 6 11:36:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729994 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp458322wrp; Fri, 6 Oct 2023 04:44:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0KlnEaIixSVamHz1s2dYXEWFIDQCeB1D8VNvwawb+xU7dBklrVqVE3T3a4ilds0jzmHh8 X-Received: by 2002:a05:6102:3016:b0:452:bf74:bcec with SMTP id s22-20020a056102301600b00452bf74bcecmr7505793vsa.10.1696592652016; Fri, 06 Oct 2023 04:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592651; cv=none; d=google.com; s=arc-20160816; b=jL+uIs+7zU4A/INFqMfgnrMPqcmJ14nynjLsQsbKjkcbo+basqA8E/lhFUqvkQKX35 1S7A4D9A+SRRRUdpLX1+C6Mck48bj6QCKpxrP7HYCJ/7rC1jXa4JaJ0MV5EW+VccQmQV UAr7ficUtlMJDkxFt3+UIMszybNAhxlviSYEJGISV6aZiGFI9knFlFvw5fcMo6ZTMhzm lJh20f56XpoCDoYZKKaOWeQZQ41eFUapjVqmal00+H5bqzORwiMpySU9S2O2UbVOPF6s P3xSfsBvtLOb4zbe0cM5gZFoZmxevJXgLLkpT0SuNvSHiCiLjQWjmd2AHLYU0I7a9Ym8 QbFA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B7A1/6yu6677WxLat5yg/pN/jN8LiDjpr3rH9i+lSaQ=; fh=kFeeQCZHOWMjM3PvFVR/cFiybISAQy4MaQRyjN/+tkQ=; b=kvxj1h2/LkTM6mf0JBFiYcmNO+AUb8jogqtyetaQA78WZgeFYepXPktx+hO2k6KuaK w3W2O0yHHJKt69tYmeomrtyZPWoZtOaN2YIsqvhHyTbqNkA8mTLli5ZXApaA3tAcO75O kuKsgJOhGILDN2AKGVKh1G4+FVSauYtJZycX3u7zV9sLHu03FS1uu1S24VbdQnYXoZu5 xNh07QfJiQcyfkpPKLgqcnKm0bA8n8xebvr39PpaRkp2fsZPwtKTrrQPt1IOFyc1aW+C EHysYNQ/hF/DruhklwleFlY0Tktj1fclBpNU2h2q6iZI/uI5O9XJxaEEJFUxPX+7IMUz BP1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RbwaSWx6; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h9-20020ac87d49000000b0041950c7c11esi2209804qtb.78.2023.10.06.04.44.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:44:11 -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=@redhat.com header.s=mimecast20190719 header.b=RbwaSWx6; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9K-00059S-BS; Fri, 06 Oct 2023 07:37:42 -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 1qoj8w-00051s-VV for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-0000A0-8V for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592232; 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=B7A1/6yu6677WxLat5yg/pN/jN8LiDjpr3rH9i+lSaQ=; b=RbwaSWx6yu7B5NF8rPPZfhjyYeLIf61AHtY0ujszE5kOzW8ryRqPQ99dk0vLz6moe1WHyY xmOtNjunOEuiSiHb/UbrVZLuI3vIuMH23cuJIpHu84uIZZcBTLq4dLXZHCoT9gscouGu+d 9/qYtr2g9UJsxJx5bF26swlucojNmOg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-BFMu70v_N3uHpPxO6vuk9g-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: BFMu70v_N3uHpPxO6vuk9g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BAAD8185A797; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A321215671F; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9483121E6886; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 22/32] semihosting/arm-compat: Clean up local variable shadowing Date: Fri, 6 Oct 2023 13:36:47 +0200 Message-ID: <20231006113657.3803180-23-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: semihosting/arm-compat-semi.c: In function ‘do_common_semihosting’: semihosting/arm-compat-semi.c:379:13: warning: declaration of ‘ret’ shadows a previous local [-Wshadow=local] 379 | int ret, err = 0; | ^~~ semihosting/arm-compat-semi.c:370:14: note: shadowed declaration is here 370 | uint32_t ret; | ^~~ semihosting/arm-compat-semi.c:682:27: warning: declaration of ‘ret’ shadows a previous local [-Wshadow=local] 682 | abi_ulong ret; | ^~~ semihosting/arm-compat-semi.c:370:9: note: shadowed declaration is here 370 | int ret; | ^~~ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-14-philmd@linaro.org> Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- semihosting/arm-compat-semi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 29c5670fdf..ec959b3e01 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -367,7 +367,6 @@ void do_common_semihosting(CPUState *cs) target_ulong ul_ret; char * s; int nr; - uint32_t ret; int64_t elapsed; nr = common_semi_arg(cs, 0) & 0xffffffffU; @@ -725,6 +724,9 @@ void do_common_semihosting(CPUState *cs) case TARGET_SYS_EXIT: case TARGET_SYS_EXIT_EXTENDED: + { + uint32_t ret; + if (common_semi_sys_exit_extended(cs, nr)) { /* * The A64 version of SYS_EXIT takes a parameter block, @@ -752,6 +754,7 @@ void do_common_semihosting(CPUState *cs) } gdb_exit(ret); exit(ret); + } case TARGET_SYS_ELAPSED: elapsed = get_clock() - clock_start; From patchwork Fri Oct 6 11:36:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729987 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456649wrp; Fri, 6 Oct 2023 04:39:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGh1ASZdStIE5HpSyUcjkXWKVUSHdVEHNlm8k4UFds56I9MYNXCz5PnZ8NhrUNMeTVrBstb X-Received: by 2002:a05:6214:4253:b0:655:935b:ca85 with SMTP id ne19-20020a056214425300b00655935bca85mr7463484qvb.48.1696592398962; Fri, 06 Oct 2023 04:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592398; cv=none; d=google.com; s=arc-20160816; b=Xh3nDt2KhiIosBSP0kouzo8mRJ01bt/V0FWP6wj0sOUO0IAq9X+qS4TbWXwc08aj2O StSvIgubwPpQkdA7KsAPqZVaps6PuPX3P+tUSybmNvodztmNWXuXI8kdgRcUERxRKEXJ BJPViqjv3jsSwNWV1HljMaLNiUs1H3QGLErYSGrIxTyver7/hgBQaPaM8zN9Q9hlYi8j +F25wilmHF0iBso0YiLnbiHncT7YA8gZtx5IB7LcIJafrleldIwnp1n4deD9Q4brFnXt fcwXfYNL2mgo/7zXh+5+I7imS+fA/R+esu1DebHdL0s8livqw/y/wLQ7ZUgBa3wQDthP gbVg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dp18yDfa0xSGbMJbUgqL8hFOVcmn22n/M/o33Bq6pZ0=; fh=kFeeQCZHOWMjM3PvFVR/cFiybISAQy4MaQRyjN/+tkQ=; b=TvvyY/Vz3IdGIBh0i9lFfGQewzqhhy+ARQj3dkLD11SNzbY8ffrQDj+nRLU2IIjs3z N6JYzHeJY8j2b1QJb1emgFepilNyWlMN+ZpP0ieMufkq68TbvtolzVgPx2le46ifl4xi /qJVIo5MhSii7xg1opgolb4UMgq6n8Jx1+pul0Z+KFzcJwuBbupdHttCTlHd2IeEVhvf +n2VbRGJZLrfzHJUIh99HaFyAF/3DLV3s+vnGMGi2lai7fed50BVXc9MT7q0VRBNjx9z 8wgSCkBTsbuU/6IK2jn+w1PmsbTo/llbZWI3qEfHj5fklGNuMfG9lj0c67yGf+RSJjzo 3KWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hihujg3d; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n3-20020a0c8c03000000b0065afe121fc8si2190699qvb.150.2023.10.06.04.39.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:58 -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=@redhat.com header.s=mimecast20190719 header.b=hihujg3d; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9T-0005D8-Cv; Fri, 06 Oct 2023 07:37: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 1qoj93-00053B-0O for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8u-00008g-0Q for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592227; 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=Dp18yDfa0xSGbMJbUgqL8hFOVcmn22n/M/o33Bq6pZ0=; b=hihujg3d4DHhLlA+F13p3bAIWAqtv/4LaC0mb0zjipbhbqBRKSMVBZPmg6lpnBI6J3Weae 3K2ScDJT4RhNahry79ILO4yqnHUE7ciftqjTq4oKgGVUzRkPP5AoybZCmvC8umQZfDVi/p ozD9Bs9w/Jh0QhgTvW5qre02ZeBDj5Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-571-QtCohzAOPA6tYsfsq0Ty-Q-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: QtCohzAOPA6tYsfsq0Ty-Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DC039858F1C; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FC8A140E963; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9766821E6887; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 23/32] softmmu/vl: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:48 +0200 Message-ID: <20231006113657.3803180-24-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: softmmu/vl.c:1069:44: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void parse_display_qapi(const char *optarg) ^ softmmu/vl.c:1224:39: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void monitor_parse(const char *optarg, const char *mode, bool pretty) ^ softmmu/vl.c:1634:17: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] const char *optarg = qdict_get_try_str(qdict, "type"); ^ softmmu/vl.c:1784:45: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] static void object_option_parse(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-15-philmd@linaro.org> Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster [Tweak two parameter names] Signed-off-by: Markus Armbruster --- softmmu/vl.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 98e071e63b..13c1b24706 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1066,12 +1066,12 @@ static void select_vgahw(const MachineClass *machine_class, const char *p) } } -static void parse_display_qapi(const char *optarg) +static void parse_display_qapi(const char *str) { DisplayOptions *opts; Visitor *v; - v = qobject_input_visitor_new_str(optarg, "type", &error_fatal); + v = qobject_input_visitor_new_str(str, "type", &error_fatal); visit_type_DisplayOptions(v, NULL, &opts, &error_fatal); QAPI_CLONE_MEMBERS(DisplayOptions, &dpy, opts); @@ -1221,21 +1221,21 @@ static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp) return monitor_init_opts(opts, errp); } -static void monitor_parse(const char *optarg, const char *mode, bool pretty) +static void monitor_parse(const char *str, const char *mode, bool pretty) { static int monitor_device_index = 0; QemuOpts *opts; const char *p; char label[32]; - if (strstart(optarg, "chardev:", &p)) { + if (strstart(str, "chardev:", &p)) { snprintf(label, sizeof(label), "%s", p); } else { snprintf(label, sizeof(label), "compat_monitor%d", monitor_device_index); - opts = qemu_chr_parse_compat(label, optarg, true); + opts = qemu_chr_parse_compat(label, str, true); if (!opts) { - error_report("parse error: %s", optarg); + error_report("parse error: %s", str); exit(1); } } @@ -1631,13 +1631,13 @@ static const QEMUOption *lookup_opt(int argc, char **argv, static MachineClass *select_machine(QDict *qdict, Error **errp) { - const char *optarg = qdict_get_try_str(qdict, "type"); + const char *machine_type = qdict_get_try_str(qdict, "type"); GSList *machines = object_class_get_list(TYPE_MACHINE, false); MachineClass *machine_class; Error *local_err = NULL; - if (optarg) { - machine_class = find_machine(optarg, machines); + if (machine_type) { + machine_class = find_machine(machine_type, machines); qdict_del(qdict, "type"); if (!machine_class) { error_setg(&local_err, "unsupported machine type"); @@ -1781,20 +1781,20 @@ static void object_option_add_visitor(Visitor *v) QTAILQ_INSERT_TAIL(&object_opts, opt, next); } -static void object_option_parse(const char *optarg) +static void object_option_parse(const char *str) { QemuOpts *opts; const char *type; Visitor *v; - if (optarg[0] == '{') { - QObject *obj = qobject_from_json(optarg, &error_fatal); + if (str[0] == '{') { + QObject *obj = qobject_from_json(str, &error_fatal); v = qobject_input_visitor_new(obj); qobject_unref(obj); } else { opts = qemu_opts_parse_noisily(qemu_find_opts("object"), - optarg, true); + str, true); if (!opts) { exit(1); } From patchwork Fri Oct 6 11:36:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729984 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp456354wrp; Fri, 6 Oct 2023 04:39:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKFxHQDCfMoDljP1sb0eeQ49aF08fBLiC0vNbpseFPhO3kN9ur8yZBoceeOV4nGdC5F3jT X-Received: by 2002:a05:622a:48e:b0:417:de7d:f64e with SMTP id p14-20020a05622a048e00b00417de7df64emr8839814qtx.62.1696592359076; Fri, 06 Oct 2023 04:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592359; cv=none; d=google.com; s=arc-20160816; b=pzdYAxN/4uF8eX3NCTZrMg/dutYYt3ZGTauWotB2VW3ZLTpnploVshZqxa0wv2dTyP qd4yHl2a2SnXT9/wydMRo2kBAdoDs1jG5VI9THuHmdizjL2OAzDn8M5YzfzFHOBNoD6q oQ2CJWOV79F6kNMmt59DOqMsFCb6+qrAh5NFmVP15RgBlAmxGUj2L+YTE6rnn9nEJOP2 1yHMq5Jy4K7142mLB8w5BAxLCIfJ5/RL5rsxR0OMeeXgkbQKrz2P66PiSWvp7K0S0urS IiptYKolfrsgp+9Rpq9k9YTFOPFaFXy7XChT1i5pde0wCRmjQ8VjcJOXOhV07ZJ4auQt XDJg== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GGCzqdXxW4X7LjlOPUJQlBqL1VydtpWMZvfIPJEozd4=; fh=vVMqVWgjlBXKu/oiRjuq59ISAKQHkBKrAiRxjup148g=; b=MXuFXSuaJF1uq4fvxvMDv5uW3TWTFGZhycgk9VFz1ZCHrpKeQDchjOnMCqNTKa3ZLp JcallMX0cK+lpqSqXYaLWj/I+euE12A5Y7s6h+XF7bGem7O36iBFCa3R6nmunVWoklyA Hy2eLKzXMqntoaLQEMU9wuZwHLZ8I1b++G6vTfo+Gl9ZZb0VpOFbbT0s7twrXsl3CYLT 7cFrK5QKbV9rvl+jmS1y/nIJYQCfBx+ce3r9kkQsZAHLLWnRoyhJwesrjBx4rXL3x9tY /zNVg64CaIdSuUW9i4MkVnaWpNseZZSzNkuNoitbo1S+52qio1Cu3cPEtBIKFLuhvwOY OyKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="IO6v/3w8"; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e15-20020ac85dcf000000b004039c492533si2246762qtx.181.2023.10.06.04.39.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:39:19 -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=@redhat.com header.s=mimecast20190719 header.b="IO6v/3w8"; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9U-0005E0-Mf; Fri, 06 Oct 2023 07:37:52 -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 1qoj8x-00051v-1D for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-00007q-9K for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592224; 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=GGCzqdXxW4X7LjlOPUJQlBqL1VydtpWMZvfIPJEozd4=; b=IO6v/3w8tYnhGekNJRXt9j/+l5BjF0rU2pfHkZFUIKpx5n4GXJe+/qZ3fhcYx68BHx+WcW Q0ISAwcjaWrtieL/X+j49kbx+a9Mciddph7jtA+EoqZ4ty7R8b3XN+xaR1llDoFloh6HN8 IMx+2juLjwFSEC7fv4PIoxpqnfSfbMc= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-65-xYxz1MWhNaiNUzSPpw65Pg-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: xYxz1MWhNaiNUzSPpw65Pg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C53C529A9D43; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1367C15BB8; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9A54421E6888; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Berger , Richard Henderson Subject: [PULL 24/32] sysemu/tpm: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:49 +0200 Message-ID: <20231006113657.3803180-25-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: softmmu/tpm.c:178:59: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-16-philmd@linaro.org> Reviewed-by: Stefan Berger Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- include/sysemu/tpm.h | 2 +- softmmu/tpm.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 66e3b45f30..1ee568b3b6 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -17,7 +17,7 @@ #ifdef CONFIG_TPM -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); +int tpm_config_parse(QemuOptsList *opts_list, const char *optstr); int tpm_init(void); void tpm_cleanup(void); diff --git a/softmmu/tpm.c b/softmmu/tpm.c index 578563f05a..7164ea7ff1 100644 --- a/softmmu/tpm.c +++ b/softmmu/tpm.c @@ -175,15 +175,15 @@ int tpm_init(void) * Parse the TPM configuration options. * To display all available TPM backends the user may use '-tpmdev help' */ -int tpm_config_parse(QemuOptsList *opts_list, const char *optarg) +int tpm_config_parse(QemuOptsList *opts_list, const char *optstr) { QemuOpts *opts; - if (!strcmp(optarg, "help")) { + if (!strcmp(optstr, "help")) { tpm_display_backend_drivers(); return -1; } - opts = qemu_opts_parse_noisily(opts_list, optarg, true); + opts = qemu_opts_parse_noisily(opts_list, optstr, true); if (!opts) { return -1; } From patchwork Fri Oct 6 11:36:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 729995 Delivered-To: patch@linaro.org Received: by 2002:a5d:4005:0:b0:31d:da82:a3b4 with SMTP id n5csp458325wrp; Fri, 6 Oct 2023 04:44:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEP6J3+L9Twm5DkeXAL1yqZKBEVam02WNIaw/2TZZpXgGXXDkP/4RAekHLxPEPmoa5k/fv X-Received: by 2002:a81:8d52:0:b0:5a5:575:b222 with SMTP id w18-20020a818d52000000b005a50575b222mr6040231ywj.23.1696592652246; Fri, 06 Oct 2023 04:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696592652; cv=none; d=google.com; s=arc-20160816; b=fzOm3rVR50gPSYtEFYq19+6cDPjgqw7G1NOdmkUujoq1a1qZhS7Umg5uvv5in82/z4 T7V5KyzMBYronTZN2PgdXBZV4GCLmuEaRJwVV2jL+e/h2aSm7qLl+43nO6AfkvfcdKRY HnQVgBVlL0LMT/8+wEhyl6rXKO72IMxpLLpskYbg3IBS524As0rSGkwQbI4t9Gu00aUS 9iEw2/7ddXGFuOco4gFzkON7eVCspSD5jiMlSTgv43BPMWr0/bEpDrvCh3khuh5ZbFQl ewu+lw2rPFjC0ns+2t32jgmKmXYjhozqVXrtecHSInXXVxAzeQJY9DnrusWy4uUj2+M0 OmOA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z+R5zaDK5SKD1cw+72zd9/gWLPUgkdgnoxFy8d3lUu8=; fh=kFeeQCZHOWMjM3PvFVR/cFiybISAQy4MaQRyjN/+tkQ=; b=Jf5k/wz0GuhHJ7CHyxtJBbdq/qxc7SsVo0pw7HmJfgfljay2gIBtcqyXo6LeLBZMVZ j3ZJND2Aj353bPjWjOZ+pxLCIyXVJxeAXVeUvZX+20uGYFZRTaRD/hQzABd+8I5+R+MD 0hiNCQQgaev5G67cidRnZmMLROwir6jdij/gEokdbS65dq+Eeki4rxkmXOJdC8Zg6EDh eq5Pd5bGBuGtVOlLVDjsgZDkmh+xib30kVUbjTivmG3RvTD1c14WfpREPWbY2xIu61k6 ghgkVNQsRRZZ5zpewKJalvtJxrdpu0nFqpT6I16/UufTpXWVbl9x8OZom01f38xa8D6X Rsgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AdJlP6YW; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b12-20020ac87fcc000000b003eb14b07a6dsi2295078qtk.125.2023.10.06.04.44.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Oct 2023 04:44:12 -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=@redhat.com header.s=mimecast20190719 header.b=AdJlP6YW; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoj9Q-0005BT-65; Fri, 06 Oct 2023 07:37:48 -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 1qoj90-000531-3Y for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoj8t-0000Az-Vn for qemu-devel@nongnu.org; Fri, 06 Oct 2023 07:37:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696592234; 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=z+R5zaDK5SKD1cw+72zd9/gWLPUgkdgnoxFy8d3lUu8=; b=AdJlP6YW4PaRR0bwES2lQbIboDzVr/Z3chHBvUmLfdDERQgLMvt6SEJg6ON/GZYo6K/kd0 5mfa01unda9uWchhbxkd+n3RbIUwEMoi1h2vABjtdqiabkKQBND4HbtX694HlLBAh0k9sD REUZ8pvfQ4OtOuEpSORvTbC9ip1vixg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-418-EUOtDV6VPkeRLdOqQZeeaQ-1; Fri, 06 Oct 2023 07:37:01 -0400 X-MC-Unique: EUOtDV6VPkeRLdOqQZeeaQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D795F800045; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A99C5170EE; Fri, 6 Oct 2023 11:37:00 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9D43B21E688A; Fri, 6 Oct 2023 13:36:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 25/32] trace/control: Clean up global variable shadowing Date: Fri, 6 Oct 2023 13:36:50 +0200 Message-ID: <20231006113657.3803180-26-armbru@redhat.com> In-Reply-To: <20231006113657.3803180-1-armbru@redhat.com> References: <20231006113657.3803180-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@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.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 From: Philippe Mathieu-Daudé Fix: trace/control.c:288:34: error: declaration shadows a variable in the global scope [-Werror,-Wshadow] void trace_opt_parse(const char *optarg) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/getopt.h:77:14: note: previous declaration is here extern char *optarg; /* getopt(3) external variables */ ^ Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231004120019.93101-17-philmd@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Markus Armbruster --- trace/control.h | 4 ++-- trace/control.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trace/control.h b/trace/control.h index dfd209edd8..6754bfe052 100644 --- a/trace/control.h +++ b/trace/control.h @@ -197,11 +197,11 @@ extern QemuOptsList qemu_trace_opts; /** * trace_opt_parse: - * @optarg: A string argument of --trace command line argument + * @optstr: A string argument of --trace command line argument * * Initialize tracing subsystem. */ -void trace_opt_parse(const char *optarg); +void trace_opt_parse(const char *optstr); /** * trace_get_vcpu_event_count: diff --git a/trace/control.c b/trace/control.c index 1a48a7e266..ef107829ac 100644 --- a/trace/control.c +++ b/trace/control.c @@ -285,10 +285,10 @@ bool trace_init_backends(void) return true; } -void trace_opt_parse(const char *optarg) +void trace_opt_parse(const char *optstr) { QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("trace"), - optarg, true); + optstr, true); if (!opts) { exit(1); }