qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-s390x@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr
Date: Fri,  3 Jun 2022 08:59:02 +0200	[thread overview]
Message-ID: <20220603065905.23805-10-thuth@redhat.com> (raw)
In-Reply-To: <20220603065905.23805-1-thuth@redhat.com>

From: Alex Bennée <alex.bennee@linaro.org>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220524154056.2896913-12-alex.bennee@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/vhost-user-test.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index a2cec87684..8bf390be20 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -524,14 +524,13 @@ static void chr_event(void *opaque, QEMUChrEvent event)
 
 static void test_server_create_chr(TestServer *server, const gchar *opt)
 {
-    gchar *chr_path;
+    g_autofree gchar *chr_path = g_strdup_printf("unix:%s%s",
+                                                 server->socket_path, opt);
     Chardev *chr;
 
-    chr_path = g_strdup_printf("unix:%s%s", server->socket_path, opt);
     chr = qemu_chr_new(server->chr_name, chr_path, server->context);
-    g_free(chr_path);
+    g_assert(chr);
 
-    g_assert_nonnull(chr);
     qemu_chr_fe_init(&server->chr, chr, &error_abort);
     qemu_chr_fe_set_handlers(&server->chr, chr_can_read, chr_read,
                              chr_event, NULL, server, server->context, true);
-- 
2.31.1



  parent reply	other threads:[~2022-06-03  7:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
2022-06-03  6:58 ` [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH Thomas Huth
2022-06-03  6:58 ` [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string Thomas Huth
2022-06-03  6:58 ` [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation Thomas Huth
2022-06-03  6:58 ` [PULL 04/12] MAINTAINERS: Update s390 vhost entries Thomas Huth
2022-06-03  6:58 ` [PULL 05/12] tests/tcg: Test overflow conditions Thomas Huth
2022-06-03  6:58 ` [PULL 06/12] MAINTAINERS: Change my email address Thomas Huth
2022-06-03  6:59 ` [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs Thomas Huth
2022-06-03  6:59 ` [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set Thomas Huth
2022-06-03  6:59 ` Thomas Huth [this message]
2022-06-03  6:59 ` [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option Thomas Huth
2022-06-03  6:59 ` [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser Thomas Huth
2022-06-03  6:59 ` [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses" Thomas Huth
2022-06-03 15:16 ` [PULL 00/12] s390x and misc patches Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603065905.23805-10-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).