From nobody Tue Feb 10 01:19:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584386355; cv=none; d=zohomail.com; s=zohoarc; b=NIwcdAQkveQi7hHVzyzEBRNJHtj62BB+kOkOlWsGm6//YMwVajlSjUoQi8crXeTKdoB/t1ItB3BbI2cvfnU2R2lfclOw6a6wRPN3HMLfocnlGMdj6VNnOFdvFry48UWZBZ7dTjf6Y2cANCuzq7uhCy0cfQiYSkWA+b3M6ob+uz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584386355; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=d82MUeKk+/4B02rjdl6yI9CuL1FxqpOnif29vr+0CBA=; b=d0zI2i0KK4RsZf0ICAhyZLUGikNRNgevXT++2GEz9uRXYiJoDplHdR0DUnujhVVbp/tNbyVbz3VxJhlz1tskcPpK/twgnWPw3A56P6Ey1+bT6TuPokJMkk+bruKhjs00iMpNb9IGWYbDAF7gfEj8yUBQHvtnVIbnFjv2/8DaqSg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584386355269491.08512844515894; Mon, 16 Mar 2020 12:19:15 -0700 (PDT) Received: from localhost ([::1]:47418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDvGc-0007eK-66 for importer@patchew.org; Mon, 16 Mar 2020 15:19:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39675) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDupz-0001Z3-Cu for qemu-devel@nongnu.org; Mon, 16 Mar 2020 14:51:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDupy-0000dL-EP for qemu-devel@nongnu.org; Mon, 16 Mar 2020 14:51:43 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:25984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDupy-0000bn-Ay for qemu-devel@nongnu.org; Mon, 16 Mar 2020 14:51:42 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-111-EoRbDIeLM-Gv0q2u8EdyGQ-1; Mon, 16 Mar 2020 14:51:37 -0400 Received: by mail-wr1-f72.google.com with SMTP id p2so6924790wrw.8 for ; Mon, 16 Mar 2020 11:51:37 -0700 (PDT) Received: from localhost.localdomain (96.red-83-59-163.dynamicip.rima-tde.net. [83.59.163.96]) by smtp.gmail.com with ESMTPSA id y11sm1102956wrd.65.2020.03.16.11.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 11:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584384702; 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=d82MUeKk+/4B02rjdl6yI9CuL1FxqpOnif29vr+0CBA=; b=XmUHB5zhQTc9V88/yje31225NdT/twiLBR37qnx/a/2UyTRSgWPrXp6x7V8lJf1T+EZks6 k1cPgm4PEa4F7tht/vAfY2hq+KmoLYzsN1SrYEsuSa/njR2FKjJ5BSdu30kf0ztUVjWbg6 Rx/DSKawUKcQGZE3QyjK0EtAZB50i8c= X-MC-Unique: EoRbDIeLM-Gv0q2u8EdyGQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S/FBDGV/15lXYdA91sXPdJa+d5WfDFcmkJ3uIRUkYtg=; b=WTBng64nSNy12v73yt4+zjosBS0krwp/AJpEE5KF43lRpZqfzzvt5DEQjyg0Wnn72K d3KW+IRUbFjdrp1Vkdxw68VIdx9qOYXPNy7sOCVoU1qPKLv1fOb6y6mu+NxeuWivQv/Y Ubh1VfV49Ea2txadijSBBYzO5yo4W/maCKXsmjBI+dOdrL2Qsj5za9oKHhjFANlj+go7 G8uCQ2eGsXgsnUuzuuG7rzJIWv79C+buFx5eWN+cdbB1JuDjSmbsZ4FnKXpT4iZgbBAe RijX71asGEl8kW/JrblM5YDX5AEJx9V7SZ/S7RUKrN5vromP4cEGEwfKCOVMostLbu6f Baog== X-Gm-Message-State: ANhLgQ3uh00H4kvJzBUPfyo+vPrmN/lujHU5bR7eY/5jC+65KmU5FuvQ 2ZSiADWWlolX3LlRGD5EBoRrwZcFGlZkqyki/Zwklwq9N1JOjs/P5eUq9Xn4GbwTUNEYrAAFaAd HZtAuO3/ceCPr0po= X-Received: by 2002:adf:ec4f:: with SMTP id w15mr819152wrn.106.1584384696511; Mon, 16 Mar 2020 11:51:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuMJCY6sWlRrJ/mFfOn5ylCypiBCw1oT6GumW7HgBf2HYpkbKc+2TF6mlV/AlK4WQbxyG8nZA== X-Received: by 2002:adf:ec4f:: with SMTP id w15mr819137wrn.106.1584384696350; Mon, 16 Mar 2020 11:51:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , qemu-devel@nongnu.org Subject: [PATCH v3 17/25] hw/core: Let devices own the MemoryRegion they create Date: Mon, 16 Mar 2020 19:49:58 +0100 Message-Id: <20200316185006.576-18-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200316185006.576-1-philmd@redhat.com> References: <20200316185006.576-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 216.205.24.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" 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/core/platform-bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c index 22c5f76dd0..d494e5cec1 100644 --- a/hw/core/platform-bus.c +++ b/hw/core/platform-bus.c @@ -187,7 +187,8 @@ static void platform_bus_realize(DeviceState *dev, Erro= r **errp) d =3D SYS_BUS_DEVICE(dev); pbus =3D PLATFORM_BUS_DEVICE(dev); =20 - memory_region_init(&pbus->mmio, NULL, "platform bus", pbus->mmio_size); + memory_region_init(&pbus->mmio, OBJECT(dev), "platform bus", + pbus->mmio_size); sysbus_init_mmio(d, &pbus->mmio); =20 pbus->used_irqs =3D bitmap_new(pbus->num_irqs); --=20 2.21.1