From nobody Tue Feb 10 01:34:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1664491130; cv=none; d=zohomail.com; s=zohoarc; b=bs3WCidYgZ6pER50heXqOZcARlVLSfpW+6LGgeUo/lxG1zzSHR8uppAUbtNs8iYB5Bri0tJ7Vd8CR3xk+u1cQw3Mrvwe2FJ7YBODDYIQ0ShnkqM85jO2U0hgKx/JEvAmdyjlVn61RfHZaqkTF/76Dk6mv+UUDNqy96/axKsbLEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664491130; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=X650jS1xD3bxP0rG+MDdT14xtj11UhIgqy55QoKuScE=; b=cMjVCPNz7AIQi6Etsso7s1w4Z2IhtPR/nLrLiTzixx1nwPPpdHZ9ejVoNz0NHtsbdAzk8ZtYN/NC5WyipTzd6NB/1I/hGLtxGvZMoj4+NQcXMZURUIYz9dKlTLfap9IPgjO/qmATrmNUtINwotIrVXN3XOEtAO9p7G6caw89V6g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664491130745253.13083822466012; Thu, 29 Sep 2022 15:38:50 -0700 (PDT) Received: from localhost ([::1]:38160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oe2B6-0000Yn-Ge for importer@patchew.org; Thu, 29 Sep 2022 18:38:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oe28m-00064T-RJ for qemu-devel@nongnu.org; Thu, 29 Sep 2022 18:36:24 -0400 Received: from relay.virtuozzo.com ([130.117.225.111]:42754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oe28j-0001xg-IV for qemu-devel@nongnu.org; Thu, 29 Sep 2022 18:36:24 -0400 Received: from [192.168.16.158] (helo=mikewrk.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.95) (envelope-from ) id 1oe25j-0071e8-Uq; Fri, 30 Sep 2022 00:35:40 +0200 To: qemu-devel@nongnu.org Cc: Thomas Huth , Laurent Vivier , Paolo Bonzini , "Dr . David Alan Gilbert" , den@virtuozzo.com Subject: [PATCH v5 7/9] tests/x86: replace snprint() by g_strdup_printf() in drive_del-test Date: Fri, 30 Sep 2022 01:35:45 +0300 Message-Id: <20220929223547.1429580-8-michael.labiuk@virtuozzo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220929223547.1429580-1-michael.labiuk@virtuozzo.com> References: <20220929223547.1429580-1-michael.labiuk@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=130.117.225.111; envelope-from=michael.labiuk@virtuozzo.com; helo=relay.virtuozzo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Reply-to: Michael Labiuk From: Michael Labiuk via X-ZM-MESSAGEID: 1664491132742100003 Content-Type: text/plain; charset="utf-8" Using g_autofree char* and g_strdup_printf(...) instead of ugly snprintf on stack array. Signed-off-by: Michael Labiuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/qtest/drive_del-test.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/qtest/drive_del-test.c b/tests/qtest/drive_del-test.c index 44b9578801..106c613f4f 100644 --- a/tests/qtest/drive_del-test.c +++ b/tests/qtest/drive_del-test.c @@ -123,12 +123,10 @@ static const char *qvirtio_get_dev_type(void) =20 static void device_add(QTestState *qts) { - QDict *response; - char driver[32]; - snprintf(driver, sizeof(driver), "virtio-blk-%s", - qvirtio_get_dev_type()); - - response =3D qtest_qmp(qts, "{'execute': 'device_add'," + g_autofree char *driver =3D g_strdup_printf("virtio-blk-%s", + qvirtio_get_dev_type()); + QDict *response =3D + qtest_qmp(qts, "{'execute': 'device_add'," " 'arguments': {" " 'driver': %s," " 'drive': 'drive0'," --=20 2.34.1