From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b33Yn-00076F-4V for qemu-devel@nongnu.org; Wed, 18 May 2016 11:38:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b33Yj-0004Wl-Ur for qemu-devel@nongnu.org; Wed, 18 May 2016 11:38:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b33Yj-0004Wg-OO for qemu-devel@nongnu.org; Wed, 18 May 2016 11:38:53 -0400 Date: Wed, 18 May 2016 09:38:52 -0600 From: Alex Williamson Message-ID: <20160518093852.62e3154a@t450s.home> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] device_del List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bret Ketchum Cc: qemu-devel@nongnu.org On Wed, 18 May 2016 10:13:56 -0500 Bret Ketchum wrote: > Should device_del work with a vfio device and qemu-2.3? I > configure a pass-through device in a q35 machine: > > -device ioh3420,slot=3,bus=pcie.0,addr=1b.0,port=3,chassis=3,multifunction=on,id=root.1 > \ > -device vfio-pci,host=84:00.0,bus=root.1,addr=00.0,rombar=0,id=SAS.2 > > And try to delete the device through the monitor: > > virsh qemu-monitor-command scos --hmp --cmd 'device_del SAS.2' > > There are not complaints but the device did not go away: > > bus: root.1 > type PCIE > dev: vfio-pci, id "SAS.2" > host = "0000:84:00.0" > x-intx-mmap-timeout-ms = 1100 (0x44c) > x-vga = false > x-req = true > bootindex = -1 (0xffffffffffffffff) > x-mmap = true > addr = 00.0 > romfile = "" > rombar = 0 (0x0) > multifunction = false > command_serr_enable = true > class SAS controller, addr 04:00.0, pci id 1000:0097 (sub 1028:1fbd) > bar 0: i/o at 0x5000 [0x50ff] > bar 1: mem at 0xfe640000 [0xfe64ffff] > bar 3: mem at 0xfe600000 [0xfe63ffff] > > Or is this a job for object_del? It should work, but PCI hot-unplug is a cooperative process with the guest. If PCI hotplug is not supported on the root port or the guest does not eject the device, nothing happens, much like you're seeing. So you might first try ejecting the device from the guest to see if it gets unplugged that way. Thanks, Alex