From nobody Tue Oct 7 05:00:58 2025 Delivered-To: importer@patchew.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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1594477537; cv=none; d=zohomail.com; s=zohoarc; b=LFBV7YWOXHQjhrF3YZVhced6SIOQ9jRQp6HFBW80NESveWSz26XPHkiovMlP7f3x+uXp5Tks3NY144jvB/ffPUds/wQjomwln5iSrf3noLK+TSV6o6Veycr4izHskXVUDy8oDye61oZgnjul37EJ087N2lMA560FAzULipYhTxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594477537; h=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=kolLNOF8HbmShs7MFqOPOeHyZEKPtyACOZco1qtAgjA=; b=TkjNzAbWiCNX7EDqXjk1CzdMaTF6/u8cGvcU8v2WR4bxL2bAv3NHsKhctphtkmGGS5987pKRJD1A25U1WpCkZzo/RixjZQrnpxvZ9s7zAX+F+C9ed/tK9/1xvZtSaFBMk8JwncLjfK8DiEu0k+Paz3+yd2gpiT+1yxxeLqaYcqk= 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 1594477537812490.6184263816615; Sat, 11 Jul 2020 07:25:37 -0700 (PDT) Received: from localhost ([::1]:55214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1juGRc-0001qq-MH for importer@patchew.org; Sat, 11 Jul 2020 10:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1juGQc-0000c3-3o for qemu-devel@nongnu.org; Sat, 11 Jul 2020 10:24:34 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:55585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1juGQa-0003uq-3b for qemu-devel@nongnu.org; Sat, 11 Jul 2020 10:24:33 -0400 Received: by mail-wm1-x343.google.com with SMTP id g75so8915032wme.5 for ; Sat, 11 Jul 2020 07:24:31 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id u10sm13448525wml.29.2020.07.11.07.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jul 2020 07:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kolLNOF8HbmShs7MFqOPOeHyZEKPtyACOZco1qtAgjA=; b=T6mAo2vIRplaYfgeGCLB5L9J2BiLpudNUDgUa9hF6DUzmJ5xDioQ3vUToKHZNcjcXF 23dSyXKklCPiAqUPiomqaIOMq+BVb1yTAjTOcUij5GGc+x26tJpcaAm6nPcnCYB7XX8g OaLAolqoQ8m3pX7uY9jVquB1ZyLbnCDVd30OKOUfOh2g11a/OJJsepzdcsyRTR+coNas gW6drFlV96U3tKSGjWocvGyMlditXg35UZUGHoXIvjN4vNRLIx0ZN8WIGla4mDc8OX7H cJKs0YOY9SY5Hl0ilTNMO9Y3NilwA7h/814/+zWJmBTq/9Zu3ZTGMPbu1rMWvd3AQqnr ocmQ== 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=kolLNOF8HbmShs7MFqOPOeHyZEKPtyACOZco1qtAgjA=; b=seaHJOYjX4fggp/4t7iZZjYl6o9vBLjl0Xtr4hUrFwRLGOp6qjfjhggSBzWXkTdA4f 4AfXzG/Gdad8S3LjFvzW4YopuRV2niUqvqz9S/C/4kFVhDrvSV53ggzQv+M+GZtzndn2 0p13SCnwNuON9FDrQDHv2i2P3fa3m4PgweblHsEpm8IgWuHHCgi6li9Q02XhzkINInZE c0gnWimqJk2xfKUl+K9QXMtB8ic3ew1vU4LGd1VuBbBqUwumdOeS/grKwZ31WQ0wy73x 9yyHydZmAtBuAhVaSfYRlT31f0F8l/BHxAz+jogoBnDPHZ5SPO9e6yw6qaHigK4kXIZQ UqpQ== X-Gm-Message-State: AOAM532owi/cHFG4QWPrPsxzlgPWF/60wAIYzZItBFXH6TsmzxiA1f40 DJV3XOjOFQv7W6PHc1gImQgj5j1xskMc+g== X-Google-Smtp-Source: ABdhPJzf22tmT/drucjzOpYgvFUFfniEipb8rGnIw+mpmVg6xerTHGKga2v8ZZsfVWmFPJdLjMLQYA== X-Received: by 2002:a1c:9a81:: with SMTP id c123mr9873663wme.46.1594477470515; Sat, 11 Jul 2020 07:24:30 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH for-5.1 2/3] qdev: Document qdev_unrealize() Date: Sat, 11 Jul 2020 15:24:24 +0100 Message-Id: <20200711142425.16283-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200711142425.16283-1-peter.maydell@linaro.org> References: <20200711142425.16283-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Add a doc comment for qdev_unrealize(), to go with the new documentation for the realize part of the qdev lifecycle. Signed-off-by: Peter Maydell --- include/hw/qdev-core.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 2d441d1fb2e..1d2bf5f37da 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -381,6 +381,25 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Err= or **errp); * would be incorrect. For that use case you want qdev_realize(). */ bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp); +/** + * qdev_unrealize: Unrealize a device + * @dev: device to unrealize + * + * This function will "unrealize" a device, which is the first phase + * of correctly destroying a device that has been realized. It will: + * + * - unrealize any child buses by calling qbus_unrealize() + * (this will recursively unrealize any devices on those buses) + * - call the the unrealize method of @dev + * + * The device can then be freed by causing its reference count to go + * to zero. + * + * Warning: most devices in QEMU do not expect to be unrealized. Only + * devices which are hot-unpluggable should be unrealized (as part of + * the unplugging process); all other devices are expected to last for + * the life of the simulation and should not be unrealized and freed. + */ void qdev_unrealize(DeviceState *dev); void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version); --=20 2.20.1