From patchwork Fri Jun 3 06:59:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 578486 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp1238202max; Fri, 3 Jun 2022 00:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy03WBoSli0xKWGTf6NocaEs3V1CnIKQNoUz8TTAFBQNfV41N8A/5djQWKDXmU7ZggTg2np X-Received: by 2002:ad4:5c4a:0:b0:464:5920:7c1a with SMTP id a10-20020ad45c4a000000b0046459207c1amr16739210qva.58.1654239898555; Fri, 03 Jun 2022 00:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654239898; cv=none; d=google.com; s=arc-20160816; b=YmC3WCcTAarGyWFmc8X8Dv5rvAMd/HrKCyw/wu8NK1bkyx/8V7NMN6JBPRdiyMVuGb nY1fEPa6WVEcIa4eH+YFNUD9Jx9OrrOA6Rv8vcm/Tbxp4Z9SQJE/+hKYHHHDqTbJKBVN riUi8ivOjjLFpdSzZI/qUU6YGchxqcdUmLsz1liOkylqHnQaUYYYrlhgiKka5hBJkvlT 5DR1ngHTm2bfwU7uxjWMFMA5zAqrkbscww+SO2Wc4Go6AYg/vjjQOR36lXDl87zQgcB5 AtwUVfjJOnS7hVMHq5dqAO+pyt1QDdPdVSXuVypXQ71n2FWzaM82j7PDctavN9sOhd6W 6HsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r5bcGBvLaUmdTRJRcSD2ZBtxrphhpjSjepeJdlSaS3o=; b=jYha7umiAo4riBcb6DEt0HYe2MJxOloT1yU1VX1n/QRiYbLHBGf3FsB+zeKoOqN3CC s0cDj3xyOnXjEwWghTKdG4BqtxjE/Tr5SW9U3IS/1W9pHoTVP03rX3cw3YMBB5sbGWHJ /5zW941JrZWZgDi6cgxLNP85o4ukjjkwbDQtX36t0P7h/sb4SE7lN1ENuS/meyE2CEEd DUAPhbw/1B3b0ZfLStBYiSZcOAUdAvwCz9ZARc0Dz1v5EFnLlfs4nsops83fekOCLCqU bt/yCOVjfb2ymT7uxMlTD3UMV9fEb0VTyy4ka3SfW4mOvDUD7QzizS2zVK4jJIFIizMk YOFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H40p0OXL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y15-20020ac85f4f000000b002f3743e363fsi2890795qta.752.2022.06.03.00.04.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jun 2022 00:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H40p0OXL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:34450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nx1Me-0007C5-9W for patch@linaro.org; Fri, 03 Jun 2022 03:04:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx1HU-0005g8-Dr for qemu-devel@nongnu.org; Fri, 03 Jun 2022 02:59:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nx1HS-0003LM-Vm for qemu-devel@nongnu.org; Fri, 03 Jun 2022 02:59:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654239574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r5bcGBvLaUmdTRJRcSD2ZBtxrphhpjSjepeJdlSaS3o=; b=H40p0OXLT9p6Vw+unRwXtQ3lFLw0wRzdzZatbUfT36r0i8KDjcCb3QJsPfMP8UqMsEK+Uq C1fuaBEgvImBHEffRNVYTNM8uyyA0kridMXxHvTtBUYHU6G+ex7EAO8+63Z0oBNpZwVjjq WVdbCxtLzF5NV0/sFlVYT7uNwX9VIgY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-380-W0m8mjcmOMOHyAugJWL2KQ-1; Fri, 03 Jun 2022 02:59:30 -0400 X-MC-Unique: W0m8mjcmOMOHyAugJWL2KQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF5951C06EDD; Fri, 3 Jun 2022 06:59:29 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C2BB2166B26; Fri, 3 Jun 2022 06:59:27 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: qemu-s390x@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr Date: Fri, 3 Jun 2022 08:59:02 +0200 Message-Id: <20220603065905.23805-10-thuth@redhat.com> In-Reply-To: <20220603065905.23805-1-thuth@redhat.com> References: <20220603065905.23805-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20220524154056.2896913-12-alex.bennee@linaro.org> Signed-off-by: Thomas Huth --- 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);