From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfg8i-0005Wa-5S for qemu-devel@nongnu.org; Fri, 02 Sep 2016 00:31:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfg8e-0001Sm-U9 for qemu-devel@nongnu.org; Fri, 02 Sep 2016 00:31:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfg8e-0001SV-OP for qemu-devel@nongnu.org; Fri, 02 Sep 2016 00:31:36 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 254F1635C6 for ; Fri, 2 Sep 2016 04:31:36 +0000 (UTC) References: <20160901171148.697e696b@t450s.home> From: Michal Privoznik Message-ID: <5abeb25c-a8a9-9144-cb6f-724647c5f35a@redhat.com> Date: Fri, 2 Sep 2016 06:31:33 +0200 MIME-Version: 1.0 In-Reply-To: <20160901171148.697e696b@t450s.home> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [libvirt] qapi DEVICE_DELETED event issued *before* instance_finalize?! List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson , qemu-devel Cc: libvir-list@redhat.com On 02.09.2016 01:11, Alex Williamson wrote: > Hey, > > > It appears that DEVICE_DELETED only means the VM is done with the > device but libvirt is interpreting it as QEMU is done with the device. > Which is correct? Do we need a new event or do we need to fix the > ordering of this event? An ordering fix would be more compatible with > existing libvirt. Thanks, What an interesting race. I think the even should be sent only after both guest and qemu are done with the device. Having two events looks like too much granularity to me. I mean, even if libvirt learns that guest has detached device, it still can't do anything until qemu clears its internal state. On the other hand, it is clearly documented that the DEVICE_DELETED event is sent as soon as guest acknowledges completion of device removal. So libvirt's buggy if we'd follow documentation strictly. But then again, I don't see much information value in "guest has detached device but qemu hasn't yet" event. Libvirt would ignore such event. Michal