From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Slaby Subject: Re: [PATCH] virtio: make PCI devices take a virtio_pci module ref Date: Thu, 04 Dec 2008 23:46:15 +0100 Message-ID: <49385DB7.4060306@gmail.com> References: <1228394671.3732.77.camel@blaa> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit Cc: Rusty Russell , linux-kernel , kvm , Anthony Liguori , Michael Tokarev To: Mark McLoughlin Return-path: Received: from gv-out-0910.google.com ([216.239.58.189]:28343 "EHLO gv-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756580AbYLDWqU (ORCPT ); Thu, 4 Dec 2008 17:46:20 -0500 Received: by gv-out-0910.google.com with SMTP id e6so922750gvc.37 for ; Thu, 04 Dec 2008 14:46:18 -0800 (PST) In-Reply-To: <1228394671.3732.77.camel@blaa> Sender: kvm-owner@vger.kernel.org List-ID: On 12/04/2008 01:44 PM, Mark McLoughlin wrote: > Nothing takes a ref on virtio_pci, so even if you have > devices in use, rmmod will attempt to unload the module. It unbinds the device properly as any other driver. So what's the problem here? > Fix by simply making each device take a ref on the module. > > Signed-off-by: Mark McLoughlin > Reported-by: Michael Tokarev > --- > drivers/virtio/virtio_pci.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-)