From patchwork Mon Jan 30 13:39:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 721485 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vBrJ865b3z9sDF for ; Tue, 31 Jan 2017 00:45:44 +1100 (AEDT) Received: from localhost ([::1]:60735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYCH8-0001HZ-E4 for incoming@patchwork.ozlabs.org; Mon, 30 Jan 2017 08:45:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cYCCF-00045s-D6 for qemu-devel@nongnu.org; Mon, 30 Jan 2017 08:40:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cYCCE-0006cQ-Hm for qemu-devel@nongnu.org; Mon, 30 Jan 2017 08:40:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33702) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cYCCE-0006cI-43 for qemu-devel@nongnu.org; Mon, 30 Jan 2017 08:40:38 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F95F81240 for ; Mon, 30 Jan 2017 13:40:38 +0000 (UTC) Received: from localhost (ovpn-116-36.phx2.redhat.com [10.3.116.36]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0UDeZMS029331; Mon, 30 Jan 2017 08:40:37 -0500 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 30 Jan 2017 17:39:22 +0400 Message-Id: <20170130133954.31353-10-marcandre.lureau@redhat.com> In-Reply-To: <20170130133954.31353-1-marcandre.lureau@redhat.com> References: <20170130133954.31353-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 30 Jan 2017 13:40:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 09/41] char-ringbuf: convert to finalize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- qemu-char.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index fecebde87a..74e78b56d1 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3550,9 +3550,9 @@ static int ringbuf_chr_read(Chardev *chr, uint8_t *buf, int len) return i; } -static void ringbuf_chr_free(struct Chardev *chr) +static void char_ringbuf_finalize(Object *obj) { - RingBufChardev *d = RINGBUF_CHARDEV(chr); + RingBufChardev *d = RINGBUF_CHARDEV(obj); g_free(d->cbuf); } @@ -3982,7 +3982,6 @@ static void char_ringbuf_class_init(ObjectClass *oc, void *data) cc->open = qemu_chr_open_ringbuf; cc->chr_write = ringbuf_chr_write; - cc->chr_free = ringbuf_chr_free; } static const TypeInfo char_ringbuf_type_info = { @@ -3990,6 +3989,7 @@ static const TypeInfo char_ringbuf_type_info = { .parent = TYPE_CHARDEV, .class_init = char_ringbuf_class_init, .instance_size = sizeof(RingBufChardev), + .instance_finalize = char_ringbuf_finalize, }; /* Bug-compatibility: */