From patchwork Tue Oct 15 14:52:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 283654 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 6F93F2C0199 for ; Wed, 16 Oct 2013 01:54:59 +1100 (EST) Received: from localhost ([::1]:42328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW61Q-00006x-6G for incoming@patchwork.ozlabs.org; Tue, 15 Oct 2013 10:54:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW60l-0008Le-Qu for qemu-devel@nongnu.org; Tue, 15 Oct 2013 10:54:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW60g-00012a-9g for qemu-devel@nongnu.org; Tue, 15 Oct 2013 10:54:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW60g-00012O-1G; Tue, 15 Oct 2013 10:54:10 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9FEs5Nh008935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Oct 2013 10:54:06 -0400 Received: from playground.com (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9FEr2Bf020982; Tue, 15 Oct 2013 10:53:57 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 15 Oct 2013 16:52:48 +0200 Message-Id: <1381848773-689-8-git-send-email-pbonzini@redhat.com> In-Reply-To: <1381848773-689-1-git-send-email-pbonzini@redhat.com> References: <1381848773-689-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: cornelia.huck@de.ibm.com, qemu-stable@nongnu.org, afaerber@suse.de, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 07/12] virtio-serial: switch exit callback to VirtioDeviceClass 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 This ensures hot-unplug is handled properly by the proxy. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- hw/char/virtio-serial-bus.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 703f026..a7ede90 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -987,12 +987,11 @@ static const TypeInfo virtio_serial_port_type_info = { .class_init = virtio_serial_port_class_init, }; -static int virtio_serial_device_exit(DeviceState *dev) +static void virtio_serial_device_exit(VirtIODevice *vdev) { - VirtIOSerial *vser = VIRTIO_SERIAL(dev); - VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VirtIOSerial *vser = VIRTIO_SERIAL(vdev); - unregister_savevm(dev, "virtio-console", vser); + unregister_savevm(DEVICE(vdev), "virtio-console", vser); g_free(vser->ivqs); g_free(vser->ovqs); @@ -1004,7 +1003,6 @@ static int virtio_serial_device_exit(DeviceState *dev) g_free(vser->post_load); } virtio_cleanup(vdev); - return 0; } static Property virtio_serial_properties[] = { @@ -1016,10 +1014,10 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); - dc->exit = virtio_serial_device_exit; dc->props = virtio_serial_properties; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); vdc->init = virtio_serial_device_init; + vdc->exit = virtio_serial_device_exit; vdc->get_features = get_features; vdc->get_config = get_config; vdc->set_config = set_config;