From patchwork Thu Jan 9 15:21:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11325975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82F6592A for ; Thu, 9 Jan 2020 15:24:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 617812072E for ; Thu, 9 Jan 2020 15:24:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="awADI+23" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732397AbgAIPYN (ORCPT ); Thu, 9 Jan 2020 10:24:13 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:39566 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732359AbgAIPYN (ORCPT ); Thu, 9 Jan 2020 10:24:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578583452; 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=4kUKKeAf2s8djmV5zny/Aq4FrGtcS96wgzcVBqpzxsI=; b=awADI+23+mRuH3DuMavjWTmLx4Rsz9WqVlveitTGbOnsJZd2ZgGekd6zbLvrfW0zkpq6jE pHXHCqMZjAJGluzZoZTmcyfR6jrr9/1gGIm02vO+cbJ8zfx/tAlzfcFfFRx3Uv0XvCTom3 GckhdnhRiS2ulFYp2UKvgIatTXeRZsY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-105--h2u7_6uOF6RjR-my6orjA-1; Thu, 09 Jan 2020 10:23:45 -0500 X-MC-Unique: -h2u7_6uOF6RjR-my6orjA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E57231800D4E; Thu, 9 Jan 2020 15:23:43 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-180.brq.redhat.com [10.40.204.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE46980608; Thu, 9 Jan 2020 15:23:36 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcelo Tosatti , Peter Maydell , qemu-arm@nongnu.org, Eduardo Habkost , Juan Quintela , kvm@vger.kernel.org, Paolo Bonzini , Marcel Apfelbaum , Alistair Francis , qemu-ppc@nongnu.org, "Dr. David Alan Gilbert" , Richard Henderson , David Gibson , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 15/15] vl: Make current_machine a local variable Date: Thu, 9 Jan 2020 16:21:33 +0100 Message-Id: <20200109152133.23649-16-philmd@redhat.com> In-Reply-To: <20200109152133.23649-1-philmd@redhat.com> References: <20200109152133.23649-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Since we now only use current_machine in vl.c, stop exporting it as a global variable in "hw/board.h", and make it static to vl.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- include/hw/boards.h | 2 -- vl.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 61f8bb8e5a..b0c0d4376d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -59,8 +59,6 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, #define MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE) -extern MachineState *current_machine; - void machine_run_board_init(MachineState *machine); bool machine_usb(MachineState *machine); int machine_phandle_start(MachineState *machine); diff --git a/vl.c b/vl.c index 3ff3548183..7a69af4bef 100644 --- a/vl.c +++ b/vl.c @@ -214,6 +214,8 @@ static int default_sdcard = 1; static int default_vga = 1; static int default_net = 1; +static MachineState *current_machine; + static struct { const char *driver; int *flag; @@ -1164,8 +1166,6 @@ static int usb_parse(const char *cmdline) /***********************************************************/ /* machine registration */ -MachineState *current_machine; - static MachineClass *find_machine(const char *name, GSList *machines) { GSList *el;