qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 28/54] char-win: convert to finalize


From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH 28/54] char-win: convert to finalize
Date: Tue, 13 Dec 2016 01:42:59 +0300

Signed-off-by: Marc-André Lureau <address@hidden>
---
 qemu-char.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 63b254f632..939c598c35 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2145,8 +2145,9 @@ typedef struct {
 static int win_chr_poll(void *opaque);
 static int win_chr_pipe_poll(void *opaque);
 
-static void win_chr_free(Chardev *chr)
+static void char_win_finalize(Object *obj)
 {
+    Chardev *chr = CHARDEV(obj);
     WinChardev *s = WIN_CHARDEV(chr);
 
     if (s->skip_free) {
@@ -2236,7 +2237,6 @@ static int win_chr_init(Chardev *chr, const char 
*filename, Error **errp)
     return 0;
 
  fail:
-    win_chr_free(chr);
     return -1;
 }
 
@@ -2411,7 +2411,6 @@ static int win_chr_pipe_init(Chardev *chr, const char 
*filename,
     return 0;
 
  fail:
-    win_chr_free(chr);
     return -1;
 }
 
@@ -2442,13 +2441,13 @@ static void char_win_class_init(ObjectClass *oc, void 
*data)
     ChardevClass *cc = CHARDEV_CLASS(oc);
 
     cc->chr_write = win_chr_write;
-    cc->chr_free = win_chr_free;
 }
 
 static const TypeInfo char_win_type_info = {
     .name = TYPE_CHARDEV_WIN,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(WinChardev),
+    .instance_finalize = char_win_finalize,
     .class_init = char_win_class_init,
     .abstract = true,
 };
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]