From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StxZy-0002GG-8M for qemu-devel@nongnu.org; Wed, 25 Jul 2012 05:08:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StxZx-0004J5-0V for qemu-devel@nongnu.org; Wed, 25 Jul 2012 05:08:26 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:60779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StxZw-0004It-Qh for qemu-devel@nongnu.org; Wed, 25 Jul 2012 05:08:24 -0400 Received: by pbbro12 with SMTP id ro12so1075175pbb.4 for ; Wed, 25 Jul 2012 02:08:23 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <500FB77E.9010703@redhat.com> Date: Wed, 25 Jul 2012 11:08:14 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1343187070-27371-1-git-send-email-qemulist@gmail.com> <1343187070-27371-2-git-send-email-qemulist@gmail.com> In-Reply-To: <1343187070-27371-2-git-send-email-qemulist@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] qom: adopt rwlock to protect accessing dev from removing it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: kvm@vger.kernel.org, Stefan Hajnoczi , Marcelo Tosatti , qemu-devel@nongnu.org, Avi Kivity , Anthony Liguori , Jan Kiszka Il 25/07/2012 05:31, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > rwlock: > qemu_device_tree_mutex > > rd side: > --device_del(destruction of device will be postphoned until unplug > ack from guest), > --pci hot-unplug > --iteration (qdev_reset_all) > > wr side: > --device_add > > Signed-off-by: Liu Ping Fan > --- > hw/pci-hotplug.c | 4 ++++ > hw/qdev-monitor.c | 17 ++++++++++++++++- > hw/qdev.c | 2 ++ > 3 files changed, 22 insertions(+), 1 deletions(-) > > diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c > index e7fb780..b3b88c1 100644 > --- a/hw/pci-hotplug.c > +++ b/hw/pci-hotplug.c > @@ -265,9 +265,11 @@ static int pci_device_hot_remove(Monitor *mon, const char *pci_addr) > return -1; > } > > + qemu_rwlock_rdlock_devtree(); This is not defined anywhere, is a piece missing in the patch? Paolo