From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39356 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHZYM-0000OG-1D for qemu-devel@nongnu.org; Sun, 14 Nov 2010 05:11:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHZYK-0004kG-Rc for qemu-devel@nongnu.org; Sun, 14 Nov 2010 05:11:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHZYK-0004k9-Hy for qemu-devel@nongnu.org; Sun, 14 Nov 2010 05:11:16 -0500 Date: Sun, 14 Nov 2010 12:11:05 +0200 From: "Michael S. Tsirkin" Message-ID: <20101114101105.GA32122@redhat.com> References: <20101112072411.GG29605@valinux.co.jp> <20101112091857.GH7631@redhat.com> <20101112095952.GA23183@valinux.co.jp> <20101112112630.GD11354@redhat.com> <20101112125030.GB27722@valinux.co.jp> <20101113205915.GA23361@redhat.com> <20101114025752.GC27722@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101114025752.GC27722@valinux.co.jp> Subject: [Qemu-devel] Re: Cannot not unplug cold-plugged devices List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Cam Macdonell , "qemu-devel@nongnu.org Developers" On Sun, Nov 14, 2010 at 11:57:52AM +0900, Isaku Yamahata wrote: > On Sat, Nov 13, 2010 at 10:59:15PM +0200, Michael S. Tsirkin wrote: > > On Fri, Nov 12, 2010 at 09:50:30PM +0900, Isaku Yamahata wrote: > > > On Fri, Nov 12, 2010 at 01:26:30PM +0200, Michael S. Tsirkin wrote: > > > > No, I am just trying to understand why is hotplug event dangerous. > > > > We still get it if we do device add before starting the VM, right? > > > > > > I'm not sure if it's safe to call enable/disable_device() and > > > pm_update_sci() before starting VM. > > > So I'd like to avoid to call them instead of making sure it. > > > If someone else ensures its safety, I'm willing to eliminate the if clause. > > > > Well I don't think it's dangerous. > > Why? Because the same effect can be achieved by starting qemu with vm stopped, adding device, then starting qemu. > > I guess it makes sense for whatever is supplied on qemu command line > > to not cause a hotplug event. > > But, those functions inject a hot plug event into a guest. That's why I think your patch is correct. Just the comment is a bit misleading in saying it's dangerous. It's just more correct without the event. > -- > yamahata