From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUzAP-0006TS-MH for qemu-devel@nongnu.org; Tue, 01 Apr 2014 09:56:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUzAG-00030K-K5 for qemu-devel@nongnu.org; Tue, 01 Apr 2014 09:55:53 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:44385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUzAF-000309-VU for qemu-devel@nongnu.org; Tue, 01 Apr 2014 09:55:44 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Apr 2014 14:55:41 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4CFD017D8047 for ; Tue, 1 Apr 2014 14:56:27 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s31DtQSw5439844 for ; Tue, 1 Apr 2014 13:55:26 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s31Dtbe5029574 for ; Tue, 1 Apr 2014 07:55:37 -0600 From: Heinz Graalfs Date: Tue, 1 Apr 2014 15:55:37 +0200 Message-Id: <1396360537-12520-1-git-send-email-graalfs@linux.vnet.ibm.com> Subject: [Qemu-devel] drive_del vs. device_del: what should come first? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kwolf@redhat.com Cc: qemu-devel@nongnu.org, stefanha@redhat.com Hi Kevin, doing a virsh detach-device ... ends up in the following QEMU monitor commands: 1. device_del ... 2. drive_del ... qmp_device_del() performs the device unplug path. In case of a block device do_drive_del() tries to prevent further IO against the host device. However, bdrv_find() during drive_del() results in an error, because the device is already gone. Due to this error all the bdrv_xxx calls to quiesce the block driver as well as all other processing is skipped. Is the sequence that libvirt triggers OK? Shouldn't drive_del be executed first? Thanks, Heinz