From nobody Mon Feb 9 19:52:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1665585810; cv=none; d=zohomail.com; s=zohoarc; b=hu0ktoZR4yeKFLczQGRKszPY0VpE5LXpV4Y6+94rcMHpTQiDCDGK9AKb/nK6I16uHh4tTitdhGqJaHQq1of0T6C9Rt6ZEPgJtGAliFoYKU022Qm0K8PtJfjIuSVVaGqMgPsKPFM4P/u+6hksahJMvFozrViFvlLGbX054Lhr6p0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1665585810; 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:References:Sender:Subject:To; bh=K+r7FoNRng7S7CamvjytFYw+Qi/t6Rd9iRxSKlwvyjk=; b=iknLwdSlNRU2GFj0flw5I+VsZNNoh9gXRPGUdHrinBgMfwwJC6FQKuzoyErpI8QPimWSy8fQ9ouMZU74sHK17zU/q6hyWUm5pz8N0JLKZnoSJSSMJ2y/8fgYyQx+Bfb6YsiU5hEjaV4IeYtfKb5AFhqs1rg0JhTY7w0+LmlilMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1665585810660478.20712664246093; Wed, 12 Oct 2022 07:43:30 -0700 (PDT) Received: from localhost ([::1]:32912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oicxF-0007VB-75 for importer@patchew.org; Wed, 12 Oct 2022 10:43:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicni-0005EC-3M for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oicnb-0006kh-MA for qemu-devel@nongnu.org; Wed, 12 Oct 2022 10:33:37 -0400 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-304-xdTcHrvUMyC-kYysIs6B8A-1; Wed, 12 Oct 2022 10:33:29 -0400 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 9967A1C068CA; Wed, 12 Oct 2022 14:33:29 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id D30722144B20; Wed, 12 Oct 2022 14:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665585211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K+r7FoNRng7S7CamvjytFYw+Qi/t6Rd9iRxSKlwvyjk=; b=BStcrZW73FcA+NZ0q6I9glDZmC8LKRcO+0Ybm9HlH1lQhsd5U0y95z6KngioRe+jhtlfoQ 3vK8TpOmysR5sZXo6Pm2EE8g50krkGq+SjDNugYmusD3fs4weWH+Ipl5J89dm/YpNkACtk nmK+sg8F1ky6SkDFgS+z+xjGaK8cxxc= X-MC-Unique: xdTcHrvUMyC-kYysIs6B8A-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 09/16] tests/x86: replace snprint() by g_strdup_printf() in drive_del-test Date: Wed, 12 Oct 2022 16:33:09 +0200 Message-Id: <20221012143316.988561-10-thuth@redhat.com> In-Reply-To: <20221012143316.988561-1-thuth@redhat.com> References: <20221012143316.988561-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1665585811819100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Using g_autofree char* and g_strdup_printf(...) instead of ugly snprintf on stack array. Signed-off-by: Michael Labiuk Message-Id: <20220929223547.1429580-8-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-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.31.1