From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [SeaBIOS PATCH] hotplug: Add device per func in ACPI DSDT tables Date: Tue, 20 Sep 2011 08:42:41 -0300 Message-ID: <20110920114241.GA25141@amt.cnet> References: <20110919162725.GA8337@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , seabios@seabios.org, kvm@vger.kernel.org, jasowang@redhat.com, alex williamson , "Michael S. Tsirkin" To: Amos Kong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33578 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753351Ab1ITLrx (ORCPT ); Tue, 20 Sep 2011 07:47:53 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Sep 20, 2011 at 06:44:54AM -0400, Amos Kong wrote: > ----- Original Message ----- > > On Mon, Sep 19, 2011 at 01:02:59PM +0300, Michael S. Tsirkin wrote: > > > On Mon, Sep 19, 2011 at 12:57:33PM +0300, Gleb Natapov wrote: > > > > On Mon, Sep 19, 2011 at 03:27:38AM -0400, Amos Kong wrote: > > > > > > > > > > Only func 0 is registered to guest driver (we can > > > > > only found func 0 in slot->funcs list of driver), > > > > > the other functions could not be cleaned when > > > > > hot-removing the whole slot. This patch adds > > > > > device per function in ACPI DSDT tables. > > > > > > > > > You can't unplug a single function. Guest surely knows that. > > > > > > Looking at guest code, it's clear that > > > at least a Linux guest doesn't know that. > > > > acpiphp_disable_slot function appears to eject all functions. > > > > > > > Have tested with linux/winxp/win7, hot-adding/hot-remving, > > > > > single/multiple function device, they are all fine. > > > > > > > > > Does not work for me (FC12 guest). > > what's your problem? only func 0 can be added? > I hotplug/hot-remove device by this script(add func 1~7, then add func 0): > > j=6 > for i in `seq 1 7` 0;do > qemu-img create /tmp/resize$j$i.qcow2 10M -f qcow2 > echo drive_add 0x$j.$i id=drv$j$i,if=none,file=/tmp/resize$j$i.qcow2 | nc -U /tmp/a > echo device_add virtio-blk-pci,id=dev$j$i,drive=drv$j$i,addr=0x$j.$i,multifunction=on | nc -U /tmp/monitor > done > sleep 5; > echo device_del dev60 | nc -U /tmp/monitor > > > As mentioned previously, Linux driver > > looks for function 0 when injection request is seen (see > > enable_device > > function in acpiphp_glue.c). > > > > > > What was not fine before? > > When hot-removing multifunc device, only func 0 can be removed from guest. Ah OK, musunderstood the patch was aiming for per-function hotplug.