From patchwork Tue Jun 4 18:52:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 248829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E49BD2C009A for ; Wed, 5 Jun 2013 05:01:49 +1000 (EST) Received: from localhost ([::1]:37553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjwUN-00045I-RP for incoming@patchwork.ozlabs.org; Tue, 04 Jun 2013 15:01:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjwMk-0000H9-Lk for qemu-devel@nongnu.org; Tue, 04 Jun 2013 14:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjwMj-0007sC-Jh for qemu-devel@nongnu.org; Tue, 04 Jun 2013 14:53:54 -0400 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]:59046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjwMj-0007rp-Dc for qemu-devel@nongnu.org; Tue, 04 Jun 2013 14:53:53 -0400 Received: by mail-wg0-f54.google.com with SMTP id j13so547450wgh.21 for ; Tue, 04 Jun 2013 11:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=UtBBzPqshOAwVKHkFBl9Ee9fK3xZExg6EL7pO1dN1rs=; b=Pso59ndvNsDeNtY6O9M55OcC89IC+4l8iK9of0D3cNh/DFsyR56cr46kE9hGBuonMt LAuydksDH13n2nshkGv7OW/Am6vJl+mhT0sR3UMualmP5gPidpB9d4ZRQTniyFGh5ikI tg+SQ3ScMhVTzrQKoYy3hlWkBNHAE7QpiyJ5yPv/ihkVgp93+Lyx/vCx0AWi3lmXoiIs LdGw4LTp6JHao5+Koi3m56Xrvv/ohPj26HISXTG++r2xK2N9vG5otCOTuQ+PBdwDqEME R2t6uN9c56+j0fOthRP1bsIgI0qrmrhZ0H34eIjBG/n4wH7lmU2YDHX+xEuIQUj8Wei/ QZRQ== X-Received: by 10.180.109.195 with SMTP id hu3mr2970924wib.13.1370372032746; Tue, 04 Jun 2013 11:53:52 -0700 (PDT) Received: from playground.lan (net-37-116-217-184.cust.dsl.vodafone.it. [37.116.217.184]) by mx.google.com with ESMTPSA id fx7sm4590484wic.11.2013.06.04.11.53.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Jun 2013 11:53:51 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jun 2013 20:52:29 +0200 Message-Id: <1370371954-8479-35-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> References: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::236 Cc: mst@redhat.com Subject: [Qemu-devel] [PATCH 34/39] pvscsi: split exit and instance_finalize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini --- hw/scsi/vmw_pvscsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index eb2270f..5e97555 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -1100,9 +1100,18 @@ pvscsi_uninit(PCIDevice *pci_dev) PVSCSIState *s = PVSCSI(pci_dev); trace_pvscsi_state("uninit"); - qemu_bh_delete(s->completion_worker); pvscsi_cleanup_msi(s); +} + +static void +pvscsi_instance_finalize(Object *obj) +{ + PVSCSIState *s = PVSCSI(obj); + + trace_pvscsi_state("finalize"); + + qemu_bh_delete(s->completion_worker); memory_region_destroy(&s->io_space); } @@ -1205,6 +1214,7 @@ static const TypeInfo pvscsi_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PVSCSIState), .class_init = pvscsi_class_init, + .instance_finalize = pvscsi_instance_finalize, }; static void