From patchwork Fri Nov 12 06:29:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cam Macdonell X-Patchwork-Id: 70929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5C8D1B7119 for ; Fri, 12 Nov 2010 17:32:17 +1100 (EST) Received: from localhost ([127.0.0.1]:41284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGnBG-0005d7-1d for incoming@patchwork.ozlabs.org; Fri, 12 Nov 2010 01:32:14 -0500 Received: from [140.186.70.92] (port=54677 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGn8p-000587-Hl for qemu-devel@nongnu.org; Fri, 12 Nov 2010 01:29:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGn8o-0003CY-As for qemu-devel@nongnu.org; Fri, 12 Nov 2010 01:29:43 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:34164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGn8n-0003CS-Ub for qemu-devel@nongnu.org; Fri, 12 Nov 2010 01:29:42 -0500 Received: by wwe15 with SMTP id 15so2019412wwe.10 for ; Thu, 11 Nov 2010 22:29:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.11.205 with SMTP id 55mr1615399wex.51.1289543379509; Thu, 11 Nov 2010 22:29:39 -0800 (PST) Received: by 10.216.19.5 with HTTP; Thu, 11 Nov 2010 22:29:39 -0800 (PST) Date: Thu, 11 Nov 2010 23:29:39 -0700 X-Google-Sender-Auth: 1U9VjP_qsuKH1ZtfDeh2w1boUZ0 Message-ID: From: Cam Macdonell To: "qemu-devel@nongnu.org Developers" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Isaku Yamahata , "Michael S. Tsirkin" Subject: [Qemu-devel] Cannot not unplug cold-plugged devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Hi, I was trying to do a "device_del" on my ivshmem device and it won't work unless the device is added via hotplug. If the device is coldplugged (added at startup) then nothing happens. I think I tracked this behaviour to the patch below. Is not allowing coldplugged devices to be unplugged the desired behaviour? Thanks, Cam commit 5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 Author: Isaku Yamahata Date: Mon Sep 6 16:46:18 2010 +0900 pci: call hotplug callback even when not hotplug case for later use. call hotplug callback even when not hotplug case for later use. And move hotplug check into hotplug callback. PCIE slot needs this for card presence detection. Signed-off-by: Isaku Yamahata Signed-off-by: Michael S. Tsirkin if (state) { diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index bfa1d9a..24dfcf2 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -611,6 +611,9 @@ static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev, int state) PIIX4PMState *s = DO_UPCAST(PIIX4PMState, dev, DO_UPCAST(PCIDevice, qdev, qdev)); + if (!dev->qdev.hotplugged) + return 0; + s->pci0_status.up = 0; s->pci0_status.down = 0;