Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j6KrZ-0007DG-9w for mharc-qemu-riscv@gnu.org; Mon, 24 Feb 2020 16:02:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53341) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6KrW-000785-QW for qemu-riscv@nongnu.org; Mon, 24 Feb 2020 16:01:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6KrV-0007eJ-OW for qemu-riscv@nongnu.org; Mon, 24 Feb 2020 16:01:58 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:20520 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6KrV-0007dr-K4 for qemu-riscv@nongnu.org; Mon, 24 Feb 2020 16:01:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582578117; 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=1VSR9kygTTReaCRIBAeG2Orj1G8eqxnIXlzuyJCEoZ4=; b=YD3Q6d3aYLiM9irlNLCGYV0Hdwrou26ExAkhQ/nehD9RCFfdcyyFO33ys+an5/7TBPCYpj KGjIZRnMMYN+wFNgt1CUs3d/LGNJ4JfIJqQ8X+/Tm1kKbfX8y88E9X7J2XQGNjdRYYm5nh o8R2N05cOzbp8lYA0FGTbRFj7ZPtYJA= 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-64-KtlOQdrDNIqNkAe5mYpYMw-1; Mon, 24 Feb 2020 16:01:55 -0500 X-MC-Unique: KtlOQdrDNIqNkAe5mYpYMw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0F682800D50; Mon, 24 Feb 2020 21:01:51 +0000 (UTC) Received: from x1w.redhat.com (ovpn-205-162.brq.redhat.com [10.40.205.162]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B8005C297; Mon, 24 Feb 2020 21:01:41 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Paolo Bonzini , Peter Maydell Cc: Kevin Wolf , Alistair Francis , qemu-block@nongnu.org, Marcel Apfelbaum , Joel Stanley , qemu-ppc@nongnu.org, Alistair Francis , Sagar Karandikar , Magnus Damm , Aleksandar Markovic , Aleksandar Rikalo , Jason Wang , Igor Mitsyanko , Bastian Koppelmann , Laurent Vivier , Palmer Dabbelt , Peter Chubb , Max Reitz , Subbaraya Sundeep , KONRAD Frederic , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Andrzej Zaborowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-arm@nongnu.org, Aurelien Jarno , Michael Walle , Artyom Tarasenko , Eduardo Habkost , "Michael S. Tsirkin" , Richard Henderson , David Gibson , Jean-Christophe Dubois , "Edgar E. Iglesias" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Fabien Chouteau Subject: [PATCH RESEND v2 26/32] hw/display: Let devices own the MemoryRegion they create Date: Mon, 24 Feb 2020 21:55:27 +0100 Message-Id: <20200224205533.23798-27-philmd@redhat.com> In-Reply-To: <20200224205533.23798-1-philmd@redhat.com> References: <20200224205533.23798-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2020 21:02:00 -0000 Avoid orphan memory regions being added in the /unattached QOM container. This commit was produced with the Coccinelle script scripts/coccinelle/memory-region-housekeeping.cocci. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/g364fb.c | 3 ++- hw/display/macfb.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c index 55185c95c6..adcba96e34 100644 --- a/hw/display/g364fb.c +++ b/hw/display/g364fb.c @@ -477,7 +477,8 @@ static void g364fb_init(DeviceState *dev, G364State *s) =20 s->con =3D graphic_console_init(dev, 0, &g364fb_ops, s); =20 - memory_region_init_io(&s->mem_ctrl, NULL, &g364fb_ctrl_ops, s, "ctrl",= 0x180000); + memory_region_init_io(&s->mem_ctrl, OBJECT(dev), &g364fb_ctrl_ops, s, + "ctrl", 0x180000); memory_region_init_ram_ptr(&s->mem_vram, NULL, "vram", s->vram_size, s->vram); vmstate_register_ram(&s->mem_vram, dev); diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 8bff16d535..b68faff4bb 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -362,8 +362,8 @@ static void macfb_common_realize(DeviceState *dev, Macf= bState *s, Error **errp) return; } =20 - memory_region_init_io(&s->mem_ctrl, NULL, &macfb_ctrl_ops, s, "macfb-c= trl", - 0x1000); + memory_region_init_io(&s->mem_ctrl, OBJECT(dev), &macfb_ctrl_ops, s, + "macfb-ctrl", 0x1000); =20 memory_region_init_ram_nomigrate(&s->mem_vram, OBJECT(s), "macfb-vram"= , MACFB_VRAM_SIZE, errp); --=20 2.21.1