From nobody Mon May 20 16:07:49 2024 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=1664350911; cv=none; d=zohomail.com; s=zohoarc; b=N+FJNje9i6bvTGYs8927nVJGCACrAvPCdvxDW4qbreKVIzFzbaciRtz8R5y7ng5oShmpCA4Wb+r2i9lBAiE9am/VKHjq7Xc/BnKKyYTJm5E1YBiaf++LCbyEhVAZYhcMBN5NNIXxfA2M4fD0TARke4iPEVHEwP95e3kcip0UIJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664350911; h=Content-Type: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=S2Ui2OpeTwQj51CzteIj3lNBFTymyVVDOfEP7OQNEXk=; b=nxwO2nOj/1i8+Upg15EG1qkr8vEdxGIDgQcwje8VD16Z1OE0F2j1yqeuINl+277waVc7PFsi85w2JfrJNBWucC7AU9IlEdHqvhnYpD5JO7ednA+IuqUoExHa6YBlbroe+rCo8/pVmBK0EC4+giJTnfWHpHBnAtZkyxjd58CYVh4= 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 16643509115561015.4776386907408; Wed, 28 Sep 2022 00:41:51 -0700 (PDT) Received: from localhost ([::1]:47794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odRhV-0004Jb-Gj for importer@patchew.org; Wed, 28 Sep 2022 03:41:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLQ-0000tI-4U for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLO-0008RE-8K for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:18:59 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-464-D8hEf2YiPoyzaHvSW3ok7Q-1; Wed, 28 Sep 2022 03:18:50 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 37A53101A528; Wed, 28 Sep 2022 07:18:50 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03AC240C83BB; Wed, 28 Sep 2022 07:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349536; 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=S2Ui2OpeTwQj51CzteIj3lNBFTymyVVDOfEP7OQNEXk=; b=fjr3HpR0ARMOa9EZO3W7HFrwTNJ7mZdBkdlfk4KsIZN/ork3VlRTrMN8JZmEzAgOZQlNOs kDfAKodpIOHEkijhnytN7vet0LYl7Lff/TV6ZsCUaMnDS6WiyYgMtoDYuXtECoScPMgXdy MSoXKjsw8z4Ktj/H0Py9jZ0LVn6fe/g= X-MC-Unique: D8hEf2YiPoyzaHvSW3ok7Q-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 01/37] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable Date: Wed, 28 Sep 2022 09:18:07 +0200 Message-Id: <20220928071843.1468323-2-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664350912730100001 From: Bin Meng Previously request_{bios, pflash} cases were skipped on win32, mainly due to create_blob_file() calling mmap() which does not exist on win32. This rewirtes create_blob_file() to be portable, so that we can enable these cases on Windows. Suggested-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-2-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/i440fx-test.c | 54 ++++++++++----------------------------- 1 file changed, 14 insertions(+), 40 deletions(-) diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c index 3890f1237c..795fd85343 100644 --- a/tests/qtest/i440fx-test.c +++ b/tests/qtest/i440fx-test.c @@ -278,56 +278,34 @@ static void test_i440fx_pam(gconstpointer opaque) qtest_end(); } =20 -#ifndef _WIN32 - #define BLOB_SIZE ((size_t)65536) #define ISA_BIOS_MAXSZ ((size_t)(128 * 1024)) =20 -/* Create a blob file, and return its absolute pathname as a dynamically +/* + * Create a blob file, and return its absolute pathname as a dynamically * allocated string. * The file is closed before the function returns. - * In case of error, NULL is returned. The function prints the error messa= ge. + * In case of error, the function aborts and prints the error message. */ static char *create_blob_file(void) { - int ret, fd; + int i, fd; char *pathname; GError *error =3D NULL; + g_autofree uint8_t *buf =3D g_malloc(BLOB_SIZE); =20 - ret =3D -1; fd =3D g_file_open_tmp("blob_XXXXXX", &pathname, &error); - if (fd =3D=3D -1) { - fprintf(stderr, "unable to create blob file: %s\n", error->message= ); - g_error_free(error); - } else { - if (ftruncate(fd, BLOB_SIZE) =3D=3D -1) { - fprintf(stderr, "ftruncate(\"%s\", %zu): %s\n", pathname, - BLOB_SIZE, strerror(errno)); - } else { - void *buf; - - buf =3D mmap(NULL, BLOB_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); - if (buf =3D=3D MAP_FAILED) { - fprintf(stderr, "mmap(\"%s\", %zu): %s\n", pathname, BLOB_= SIZE, - strerror(errno)); - } else { - size_t i; - - for (i =3D 0; i < BLOB_SIZE; ++i) { - ((uint8_t *)buf)[i] =3D i; - } - munmap(buf, BLOB_SIZE); - ret =3D 0; - } - } - close(fd); - if (ret =3D=3D -1) { - unlink(pathname); - g_free(pathname); - } + g_assert_no_error(error); + close(fd); + + for (i =3D 0; i < BLOB_SIZE; i++) { + buf[i] =3D i; } =20 - return ret =3D=3D -1 ? NULL : pathname; + g_file_set_contents(pathname, (char *)buf, BLOB_SIZE, &error); + g_assert_no_error(error); + + return pathname; } =20 static void test_i440fx_firmware(FirmwareTestFixture *fixture, @@ -398,8 +376,6 @@ static void request_pflash(FirmwareTestFixture *fixture, fixture->is_bios =3D false; } =20 -#endif /* _WIN32 */ - int main(int argc, char **argv) { TestData data; @@ -410,10 +386,8 @@ int main(int argc, char **argv) =20 qtest_add_data_func("i440fx/defaults", &data, test_i440fx_defaults); qtest_add_data_func("i440fx/pam", &data, test_i440fx_pam); -#ifndef _WIN32 add_firmware_test("i440fx/firmware/bios", request_bios); add_firmware_test("i440fx/firmware/pflash", request_pflash); -#endif =20 return g_test_run(); } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664355712; cv=none; d=zohomail.com; s=zohoarc; b=hDpfSfJEoc0xv3UzgZfT4RkcaA8rfpIvhty5cxmxJrokw0m0H0blSLwamKucUjv/PsbokBtogJ4I86E4F2Al+WKFt1078dT9gEFphHGmaaDv3kAEAlqrrEFOhtXyCv2X1+uVPND8tyVACskNkC8x/2wrMWHgUddOq3KjmIXAerc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664355712; 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=icYOHzCKPT4tZ28xawFjkohy3v7aTvDH9bPp19lPMRo=; b=bcMNdTn0LulrapvyTl1J+Uumf2HmYkEm/cFoNGUF4zUO0lbS8L3ydrZtqKYr2zBXpnIwu8FA2EAma9YA0n8DfKNXBqIZ3zY0T1t3jCOUHgLh/lyWOVgb/3BuGRWfUgu8OGrqZH0XpAaC2FVEDy4nIooBx1R6bGiid29k7ep78Lg= 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 1664355712316980.8698637181404; Wed, 28 Sep 2022 02:01:52 -0700 (PDT) Received: from localhost ([::1]:57728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSww-0007Dk-W4 for importer@patchew.org; Wed, 28 Sep 2022 05:01:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLP-0000sP-8y for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:18:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:35060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLM-0008R7-Di for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:18:58 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-413-rr37SpbYMoKwbflr3qwICw-1; Wed, 28 Sep 2022 03:18:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A3826858F13; Wed, 28 Sep 2022 07:18:51 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9AFC240C83BB; Wed, 28 Sep 2022 07:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349535; 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=icYOHzCKPT4tZ28xawFjkohy3v7aTvDH9bPp19lPMRo=; b=cSscallQO6K5pqJMQw9K0qzPjaqSxljhs9RRG7yRnW3cmTlucU1Sdheo29yKYiMMQQ6EEI JJzQu+xeuqFu5oB7jeyc9NwgieuMsQbgB0oZMO7RoEQzL+0J87ptEPz6r5Tkco6EObYJGL B2k+0iToE59YbasKJ6LFWBbtkD9zgp8= X-MC-Unique: rr37SpbYMoKwbflr3qwICw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 02/37] tests/qtest: ahci-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:08 +0200 Message-Id: <20220928071843.1468323-3-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664355713878100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-6-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/ahci-test.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index f1e510b0ac..1d5929d8c3 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -44,9 +44,9 @@ #define TEST_IMAGE_SIZE_MB_SMALL 64 =20 /*** Globals ***/ -static char tmp_path[] =3D "/tmp/qtest.XXXXXX"; -static char debug_path[] =3D "/tmp/qtest-blkdebug.XXXXXX"; -static char mig_socket[] =3D "/tmp/qtest-migration.XXXXXX"; +static char *tmp_path; +static char *debug_path; +static char *mig_socket; static bool ahci_pedantic; static const char *imgfmt; static unsigned test_image_size_mb; @@ -1437,10 +1437,10 @@ static void test_ncq_simple(void) =20 static int prepare_iso(size_t size, unsigned char **buf, char **name) { - char cdrom_path[] =3D "/tmp/qtest.iso.XXXXXX"; + g_autofree char *cdrom_path =3D NULL; unsigned char *patt; ssize_t ret; - int fd =3D mkstemp(cdrom_path); + int fd =3D g_file_open_tmp("qtest.iso.XXXXXX", &cdrom_path, NULL); =20 g_assert(fd !=3D -1); g_assert(buf); @@ -1872,7 +1872,7 @@ int main(int argc, char **argv) } =20 /* Create a temporary image */ - fd =3D mkstemp(tmp_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &tmp_path, NULL); g_assert(fd >=3D 0); if (have_qemu_img()) { imgfmt =3D "qcow2"; @@ -1889,12 +1889,12 @@ int main(int argc, char **argv) close(fd); =20 /* Create temporary blkdebug instructions */ - fd =3D mkstemp(debug_path); + fd =3D g_file_open_tmp("qtest-blkdebug.XXXXXX", &debug_path, NULL); g_assert(fd >=3D 0); close(fd); =20 /* Reserve a hollow file to use as a socket for migration tests */ - fd =3D mkstemp(mig_socket); + fd =3D g_file_open_tmp("qtest-migration.XXXXXX", &mig_socket, NULL); g_assert(fd >=3D 0); close(fd); =20 @@ -1947,8 +1947,11 @@ int main(int argc, char **argv) =20 /* Cleanup */ unlink(tmp_path); + g_free(tmp_path); unlink(debug_path); + g_free(debug_path); unlink(mig_socket); + g_free(mig_socket); =20 return ret; } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664356376; cv=none; d=zohomail.com; s=zohoarc; b=P9TaOk4csAWcFmBiNXLs2cK1We/qtmpCmeh8+UOufUQ1g/fFj8n8evJWSqrBI4u2RdpJK3281vDvZZf++UJd8QSI89NLEq6aZO7U9PD9tm9Tart9FdKBhxjjDIcjkDpxLFpzfHGqnfZdAKTtXkQbww7C/Gb/Ewkf3f2SSlCg+Gs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664356376; h=Content-Type: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=/UsJhLzu0nitUvLy8VWmP9xG5F2iel+EKXGwE+FAw14=; b=TrBuQn3IugqOq5m2+MK6z7dESLi/eiBYFnirBtl3oxizB4Xuw8PPMZ16+Dd8MvIcR8KIp8TCbvuhVdIlAUdpGIWvwLYhamv4u3Fz6DBWChXJeqAVC0s46iDdk8ozMuX4RSSPh/pROJ2n3xI+bxTGr9ek0MXpN3bKz6rT0KjQNKk= 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 1664356376948462.30989021941343; Wed, 28 Sep 2022 02:12:56 -0700 (PDT) Received: from localhost ([::1]:59980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odT7f-0005H4-PX for importer@patchew.org; Wed, 28 Sep 2022 05:12:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLQ-0000tm-Fv for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:22555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLO-0008RH-IP for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:00 -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-597-xb8V2QpWOQis3xblP3Ezeg-1; Wed, 28 Sep 2022 03:18:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 634623800C25; Wed, 28 Sep 2022 07:18:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B01840C83BB; Wed, 28 Sep 2022 07:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349537; 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=/UsJhLzu0nitUvLy8VWmP9xG5F2iel+EKXGwE+FAw14=; b=Sb5oS7esAFJT6ToaisOgHFY1NdLpRtkIckT35kkTZU1r7X2pFJWUpfdTkSMUV45Bvqknqw a1JQCy8uPyBdr6ORIyeqvtFpKldA3V90CnYElA9S+CwaBbKeYgrv2fC08AOX1wAxFMJIKp tN4efszg34t65dm2AvKEWvXqwChbpt8= X-MC-Unique: xb8V2QpWOQis3xblP3Ezeg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 03/37] tests/qtest: aspeed_smc-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:09 +0200 Message-Id: <20220928071843.1468323-4-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664356378941100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Reviewed-by: C=C3=A9dric Le Goater Message-Id: <20220925113032.1949844-7-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/aspeed_smc-test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/qtest/aspeed_smc-test.c b/tests/qtest/aspeed_smc-test.c index 05ce941566..c713a3700b 100644 --- a/tests/qtest/aspeed_smc-test.c +++ b/tests/qtest/aspeed_smc-test.c @@ -608,16 +608,15 @@ static void test_write_block_protect_bottom_bit(void) flash_reset(); } =20 -static char tmp_path[] =3D "/tmp/qtest.m25p80.XXXXXX"; - int main(int argc, char **argv) { + g_autofree char *tmp_path =3D NULL; int ret; int fd; =20 g_test_init(&argc, &argv, NULL); =20 - fd =3D mkstemp(tmp_path); + fd =3D g_file_open_tmp("qtest.m25p80.XXXXXX", &tmp_path, NULL); g_assert(fd >=3D 0); ret =3D ftruncate(fd, FLASH_SIZE); g_assert(ret =3D=3D 0); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664351373; cv=none; d=zohomail.com; s=zohoarc; b=kd7jj8yJHONaU/ekx4QjEbR07FcH8PIKoXr8fdgBPnMcj352Tdw89JP+7FGuNEfMBGRqgkUBsnKw8WuIUK/N2Fb7FVJuCc/CBHXnR2ewuScGMkQHVZSUffTTjq8iJgvOUS7zbqovV8GErkaah49OU2BS5HDnCHhaMgilzekhKUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664351373; 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=DiXSYRKVY/K37b0MnbCYz/QSL2IO2/H/ATo4+OcCqv4=; b=T+Sk4hgaPjP5MMRkJFBzutKPgCq+bcWDO4ztr/3K6nJciQu82kbfIHmtQX3bHvuYJd5Crw+jVnd1yqK3jlKwKbbWz/DYU6NzN3xcV465EpF50lSmFsXCs7synbn1zi7HlTo/xaUYVGNjVDLk1MdAd6IgxVaOdCdbWvotBla6wVM= 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 166435137331468.70678582588448; Wed, 28 Sep 2022 00:49:33 -0700 (PDT) Received: from localhost ([::1]:50328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odRox-0002B9-Qw for importer@patchew.org; Wed, 28 Sep 2022 03:49:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLS-0000ui-4R for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:39686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLP-0008RX-Az for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:00 -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-449-yJpx6LX0Nx2RCPi-gS9HbQ-1; Wed, 28 Sep 2022 03:18:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 106293800C20; Wed, 28 Sep 2022 07:18:55 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8E7340C83BB; Wed, 28 Sep 2022 07:18:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349538; 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=DiXSYRKVY/K37b0MnbCYz/QSL2IO2/H/ATo4+OcCqv4=; b=OgKEGP4MGFcJPyylDJygD1DJA5WgnY2IznImMPZgT9hRsXWToJjEe81DzYUrOTyLAdHaBY V3gVltQGWP6PyspAp2RR4z4KbFFk/4PW8hipVn1iANMUtR2Cd3lKztJOSKFVZ6MsE7pJFk CLbrGfWxeEB2BC/ZJIJCR9V7/Fm463Q= X-MC-Unique: yJpx6LX0Nx2RCPi-gS9HbQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 04/37] tests/qtest: boot-serial-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:10 +0200 Message-Id: <20220928071843.1468323-5-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664351374951100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-8-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/boot-serial-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 2f99d71cab..72310ba30e 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -224,14 +224,14 @@ static bool check_guest_output(QTestState *qts, const= testdef_t *test, int fd) static void test_machine(const void *data) { const testdef_t *test =3D data; - char serialtmp[] =3D "/tmp/qtest-boot-serial-sXXXXXX"; - char codetmp[] =3D "/tmp/qtest-boot-serial-cXXXXXX"; + g_autofree char *serialtmp =3D NULL; + g_autofree char *codetmp =3D NULL; const char *codeparam =3D ""; const uint8_t *code =3D NULL; QTestState *qts; int ser_fd; =20 - ser_fd =3D mkstemp(serialtmp); + ser_fd =3D g_file_open_tmp("qtest-boot-serial-sXXXXXX", &serialtmp, NU= LL); g_assert(ser_fd !=3D -1); =20 if (test->kernel) { @@ -246,7 +246,7 @@ static void test_machine(const void *data) ssize_t wlen; int code_fd; =20 - code_fd =3D mkstemp(codetmp); + code_fd =3D g_file_open_tmp("qtest-boot-serial-cXXXXXX", &codetmp,= NULL); g_assert(code_fd !=3D -1); wlen =3D write(code_fd, code, test->codesize); g_assert(wlen =3D=3D test->codesize); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664356839; cv=none; d=zohomail.com; s=zohoarc; b=MvqX4ODnWLNAncApvvauwfi6tp67VzurVROWYMqTOiqn8H6gEY3Th387vFADN1Qj+97sN9oywipsyDvrz30+H5M8J+QLHDkl4MxGhVYAobU+hP9tyELnolmxexGch+H4sTiI3UthyjMM+U28ndymYibs0SsjF2X4VC7p70cqHyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664356839; h=Content-Type: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=ZoEDCSw4xYTrv72BG6q3jqBdnLXfwig/ukmMFjh8lXg=; b=UZ/IP+VeDFdQDsX9UUgTty3m3vjhRBVn97xucxRjOrF27E0Qz1mrszoIkSxIpznm1geXiNsD+HT1Qu67R4o/Veyjbvu2utr+E52XYSGQnuY3KGOS6z+9qreo/sJScSH9NnwIpa1o6Tpkqr+oSHKHWGrck2ZK/YUDcpz6SSTjJjU= 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 16643568393731008.9571288763397; Wed, 28 Sep 2022 02:20:39 -0700 (PDT) Received: from localhost ([::1]:38866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTF7-0002q2-FO for importer@patchew.org; Wed, 28 Sep 2022 05:20:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLU-0000wo-5A for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLS-0008SD-HG for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:03 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-pxV-hzn5N1WkSc6iKvnDpw-1; Wed, 28 Sep 2022 03:18:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C489101CC67; Wed, 28 Sep 2022 07:18:56 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C1AE40C83BB; Wed, 28 Sep 2022 07:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349541; 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=ZoEDCSw4xYTrv72BG6q3jqBdnLXfwig/ukmMFjh8lXg=; b=fzlziSgKDZRBczROlOjAvp8CcacG9kv8yIxEJp2pMAGzEt7uzf5jAKPkDEUhBzp4ykGhB6 HV0c5WmAvt98UPhMWHsUQzOz2p//oshywWOVzU52jLQ+TnymXIyAqsGZNn0xE3gvRVEh4A Hd0Rc/OhH+SAAvFdJTka8XJRujg9sTo= X-MC-Unique: pxV-hzn5N1WkSc6iKvnDpw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 05/37] tests/qtest: cxl-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:11 +0200 Message-Id: <20220928071843.1468323-6-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664356840849100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-9-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/cxl-test.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c index 2e14da7dee..cbe0fb549b 100644 --- a/tests/qtest/cxl-test.c +++ b/tests/qtest/cxl-test.c @@ -93,10 +93,9 @@ static void cxl_2root_port(void) static void cxl_t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); - char template[] =3D "/tmp/cxl-test-XXXXXX"; - const char *tmpfs; + g_autofree const char *tmpfs =3D NULL; =20 - tmpfs =3D g_mkdtemp(template); + tmpfs =3D g_dir_make_tmp("cxl-test-XXXXXX", NULL); =20 g_string_printf(cmdline, QEMU_PXB_CMD QEMU_RP QEMU_T3D, tmpfs, tmpfs); =20 @@ -107,10 +106,9 @@ static void cxl_t3d(void) static void cxl_1pxb_2rp_2t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); - char template[] =3D "/tmp/cxl-test-XXXXXX"; - const char *tmpfs; + g_autofree const char *tmpfs =3D NULL; =20 - tmpfs =3D g_mkdtemp(template); + tmpfs =3D g_dir_make_tmp("cxl-test-XXXXXX", NULL); =20 g_string_printf(cmdline, QEMU_PXB_CMD QEMU_2RP QEMU_2T3D, tmpfs, tmpfs, tmpfs, tmpfs); @@ -122,10 +120,9 @@ static void cxl_1pxb_2rp_2t3d(void) static void cxl_2pxb_4rp_4t3d(void) { g_autoptr(GString) cmdline =3D g_string_new(NULL); - char template[] =3D "/tmp/cxl-test-XXXXXX"; - const char *tmpfs; + g_autofree const char *tmpfs =3D NULL; =20 - tmpfs =3D g_mkdtemp(template); + tmpfs =3D g_dir_make_tmp("cxl-test-XXXXXX", NULL); =20 g_string_printf(cmdline, QEMU_2PXB_CMD QEMU_4RP QEMU_4T3D, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664350626; cv=none; d=zohomail.com; s=zohoarc; b=S/3Itja7SAuMo3zZU8fSAz4BhYOarFoIYYzIccUEL2FZFqbVPUrl6GYJpVkk8tTYPWFmWsDKsHvm9Qjp4Kgmtpk5ux+5JvON4TQ1tUEthNkdrGaeUPlzCipiMTNq4uXIQZHVznrFf+/BngAr0vVCfRQdGS55gRDr/GmVGicwdMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664350626; h=Content-Type: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=nsT/MYvq1C+hW8KNERyVSGCrtj4yc5rro7ngvowcej4=; b=mNkb0REQHb533fbgIl7iVmBCCB212SsUUEqbezysLnybbrerBCZj8OIuUvt7gQSYeFT/4Y1A3TIxYBJiaxZsCvpT5UFKkLeKlDW8FPpiv3t30jMyJg1CsfLwLCaYXYGwTLvj97mTo6esRE2mrkzIovzP0JSgtzJvY7rPHOQjyFc= 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 1664350626155244.84084900223627; Wed, 28 Sep 2022 00:37:06 -0700 (PDT) Received: from localhost ([::1]:55730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odRcs-0001rR-6J for importer@patchew.org; Wed, 28 Sep 2022 03:37:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLS-0000vi-RX for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58221) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLQ-0008Rr-JG for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:01 -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-82-3p88ceqnMUCd9hbvy3899g-1; Wed, 28 Sep 2022 03:18:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2447A2999B4C; Wed, 28 Sep 2022 07:18:58 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id E164A40C83BB; Wed, 28 Sep 2022 07:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349539; 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=nsT/MYvq1C+hW8KNERyVSGCrtj4yc5rro7ngvowcej4=; b=S6qa1ONbvyfqCTHm85lXP6f9UmTF3gtYyHglRp19VMM5n/pdpl3Gj/IfPEQW2qSYNsHaYT YsGfFX2jmCA0wVXtIcF28WjyL/TPP/ulinQaHd9v7S5k7nvEo8Lyjr0J8YpTIzUzTqGs4P kJGrgMoB15XZAjD3EjUd60thpT1c4lw= X-MC-Unique: 3p88ceqnMUCd9hbvy3899g-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 06/37] tests/qtest: fdc-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:12 +0200 Message-Id: <20220928071843.1468323-7-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664350628452100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-10-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/fdc-test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qtest/fdc-test.c b/tests/qtest/fdc-test.c index 52ade90a7d..1f9b99ad6d 100644 --- a/tests/qtest/fdc-test.c +++ b/tests/qtest/fdc-test.c @@ -68,7 +68,7 @@ enum { DSKCHG =3D 0x80, }; =20 -static char test_image[] =3D "/tmp/qtest.XXXXXX"; +static char *test_image; =20 #define assert_bit_set(data, mask) g_assert_cmphex((data) & (mask), =3D=3D= , (mask)) #define assert_bit_clear(data, mask) g_assert_cmphex((data) & (mask), =3D= =3D, 0) @@ -608,7 +608,7 @@ int main(int argc, char **argv) int ret; =20 /* Create a temporary raw image */ - fd =3D mkstemp(test_image); + fd =3D g_file_open_tmp("qtest.XXXXXX", &test_image, NULL); g_assert(fd >=3D 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); g_assert(ret =3D=3D 0); @@ -640,6 +640,7 @@ int main(int argc, char **argv) /* Cleanup */ qtest_end(); unlink(test_image); + g_free(test_image); =20 return ret; } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664352170; cv=none; d=zohomail.com; s=zohoarc; b=OpaXY1NKdK8dFyZGMICQ5cZ5JAXiwnoeaLzch+F62DwEUmwaCggSq/3I07AqaNJPYkrV3Pzl/sY61vkhrjzsvKHY8FC20SoWpiCXuc+Klm6p+njL5782sI/oWqyEAD3cItGonwl3bojJw+O2eNaUchkLhfGARiln+PgerDXNVw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664352170; h=Content-Type: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=gRsTZD5ut4SlcZ+0GqEfXYADRhy1Qd2Fzh5xQj0mzPg=; b=UvivD+U9Bm/sdUJ+Y/OOYda9tWhHnPJUr4+OxMtGm3enZSBRH5rS5PavV0cLtFlBWdkkNIjxwbLUuEsBT0UN2J/gqsl4Th/SfmH2dfNrFCVgJrEpTjkL4nj1J2qibsJI6BOtFTHo7mh3E+I4vKry1aXJFIf3Pt3DLZKH6fHV25o= 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 1664352170790831.9101290548433; Wed, 28 Sep 2022 01:02:50 -0700 (PDT) Received: from localhost ([::1]:52866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odS1p-0008MQ-Aj for importer@patchew.org; Wed, 28 Sep 2022 04:02:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLW-0000xL-0l for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLT-0008SO-Rp for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:05 -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-350-5T8h2dslOyGLPeLGCo9KAg-1; Wed, 28 Sep 2022 03:18:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9EA7B2999B48; Wed, 28 Sep 2022 07:18:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79B9540C83BB; Wed, 28 Sep 2022 07:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349543; 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=gRsTZD5ut4SlcZ+0GqEfXYADRhy1Qd2Fzh5xQj0mzPg=; b=J2Ga02GM9O9rD1hUKZly0WBsdDoJ4Nvq1uZFAvnY3ZV/+gFkADV+NISDPRUbQ/L/6nSdHB aHGTUgT52aPMYETuS2uYQ4nTjV6rukz6FayjtObvDtaZyZ5TjGEVXQLTxBYv2ps9x6xI1O DdUbY/DKYGrwIw9pxddi/2WWxfSSWmQ= X-MC-Unique: 5T8h2dslOyGLPeLGCo9KAg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 07/37] tests/qtest: generic_fuzz: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:13 +0200 Message-Id: <20220928071843.1468323-8-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664352172556100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-11-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/fuzz/generic_fuzz_configs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/gen= eric_fuzz_configs.h index 0775e6702b..a825b78c14 100644 --- a/tests/qtest/fuzz/generic_fuzz_configs.h +++ b/tests/qtest/fuzz/generic_fuzz_configs.h @@ -20,8 +20,8 @@ typedef struct generic_fuzz_config { } generic_fuzz_config; =20 static inline gchar *generic_fuzzer_virtio_9p_args(void){ - char tmpdir[] =3D "/tmp/qemu-fuzz.XXXXXX"; - g_assert_nonnull(g_mkdtemp(tmpdir)); + g_autofree char *tmpdir =3D g_dir_make_tmp("qemu-fuzz.XXXXXX", NULL); + g_assert_nonnull(tmpdir); =20 return g_strdup_printf("-machine q35 -nodefaults " "-device virtio-9p,fsdev=3Dhshare,mount_tag=3Dhshare " --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664353980; cv=none; d=zohomail.com; s=zohoarc; b=nsw1bU2N9wL3hggWvBK1PD2HSrJrWQuLGpKY7NU6Da9bL8PEVZsaeBRQYOZJLkEse4l2OYnK4T0ctLlSIJ3BLwjv6GmjpTwZqDe36KCqTJitDSSO3ymX+5IdxDv1B8H/12wfSP+WD04Zv3NV4PwIaOXDgLTRsiZ9KuJl8FxcNWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664353980; h=Content-Type: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=nmcRQxWNZIRXhqqU/q+zGbE9O3Xdmft09Sq/zrDJ8co=; b=Y/fDbpy1DCIL8yZ2PvUKEmVqw1zpleex5duiE98mW+3qHzSN6MxNAKx2AaZGDl0L4wgkqEsqDHfo+LS7aLW4F4vXiKodWtQhiqX3WllMbqjxlAcMOObJBlnAO4XgrT98qoj/7l2mUlJS9ljGaZ8VELmSRPH9ijntqSa35ccm8PU= 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 1664353980163268.469438510003; Wed, 28 Sep 2022 01:33:00 -0700 (PDT) Received: from localhost ([::1]:51454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSV1-0001sh-40 for importer@patchew.org; Wed, 28 Sep 2022 04:32:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yL-Nk for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLW-0008Sd-LB for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:08 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-bElRwiI4OT2Ffu8GmHhOaQ-1; Wed, 28 Sep 2022 03:19:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7A3F1882823; Wed, 28 Sep 2022 07:19:01 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D79240C83BB; Wed, 28 Sep 2022 07:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349545; 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=nmcRQxWNZIRXhqqU/q+zGbE9O3Xdmft09Sq/zrDJ8co=; b=Q/yz4L2oPGVT+tyg3GtVH41cTih0ayRmjp3hYPWVWkIT/Z9zrkiGC8IqK6WPH4qFSv2JIX KC3QDFDbf7v7grvIY5pwcnDfz+mtejM4Y7BbTQ7KvrBI0clvRcryGT2Ugbn1l9L5yWDcVr 2eIjMo/DEuC6SbLNcUo5ydP76k4vkyQ= X-MC-Unique: bElRwiI4OT2Ffu8GmHhOaQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 08/37] tests/qtest: virtio_blk_fuzz: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:14 +0200 Message-Id: <20220928071843.1468323-9-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664353981759100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-12-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/fuzz/virtio_blk_fuzz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/fuzz/virtio_blk_fuzz.c b/tests/qtest/fuzz/virtio_b= lk_fuzz.c index 236d078cc8..a9fb9ecf6c 100644 --- a/tests/qtest/fuzz/virtio_blk_fuzz.c +++ b/tests/qtest/fuzz/virtio_blk_fuzz.c @@ -181,10 +181,10 @@ static void drive_destroy(void *path) static char *drive_create(void) { int fd, ret; - char *t_path =3D g_strdup("/tmp/qtest.XXXXXX"); + char *t_path; =20 /* Create a temporary raw image */ - fd =3D mkstemp(t_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &t_path, NULL); g_assert_cmpint(fd, >=3D, 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); g_assert_cmpint(ret, =3D=3D, 0); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664354524; cv=none; d=zohomail.com; s=zohoarc; b=ViHYFXqqy7oN8SE3H9xAjLICnxhJQWfZYhASU6GTDdobJWWzSCm6/X3vUwgSW03b50qewZDN8JXDnTe/K4khWGIt0P1DbN/N6l1WqZoKuObZYAK4n/4JanQtmZZyDs6ho5WcgD78YsHNv9OQ+hbVwlS/gE7GQQXvXNgSYhRq+gg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664354524; h=Content-Type: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=d7S+a/NPPz5Pdw3vVRItqYkq+YsyiaI0EzdUXzDOmMg=; b=XkYsnQGX686bq9MA5KtfyErNVco0brf+3Paz3U1k4ZIvLL+rjxsy0Guq6TZu1huDCsEo8/YWKIZS0C50m2czleXt0BByg3SJ1FuGEQYzHApo2s4xImBxj2Kb9iylIlbTWb/SoBQ9ujWzq8RItVz49j4S5teZzqEauOpbntetp70= 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 1664354524019132.44362000878527; Wed, 28 Sep 2022 01:42:04 -0700 (PDT) Received: from localhost ([::1]:41214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSdm-0008HL-RF for importer@patchew.org; Wed, 28 Sep 2022 04:42:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yM-OA for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLX-0008Sq-43 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:09 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-587-yFTQ52xrNlW8B2Zr7Tv2ag-1; Wed, 28 Sep 2022 03:19:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E2123811E67; Wed, 28 Sep 2022 07:19:02 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id C916340C83BB; Wed, 28 Sep 2022 07:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349546; 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=d7S+a/NPPz5Pdw3vVRItqYkq+YsyiaI0EzdUXzDOmMg=; b=TXECj1a777byUxBv9iU8Dm++ksY5bS2vhxAqRc8c0bJM7UGm32gVw2ex3DG2OgcwGgEYE4 Vc2WBVWe9jZiQs2Ez/Ss1DCIbYHmP4YyzOLc7m9acdYnZ2LDWGK+YPq6PriOAF1uOqC+aK 4KEXO9s8qGS2T4FE1Ok054EFYsjNK8k= X-MC-Unique: yFTQ52xrNlW8B2Zr7Tv2ag-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 09/37] tests/qtest: ide-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:15 +0200 Message-Id: <20220928071843.1468323-10-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664354525707100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-14-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/ide-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 5bcb75a7e5..25302be6dc 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -121,8 +121,8 @@ enum { static QPCIBus *pcibus =3D NULL; static QGuestAllocator guest_malloc; =20 -static char tmp_path[] =3D "/tmp/qtest.XXXXXX"; -static char debug_path[] =3D "/tmp/qtest-blkdebug.XXXXXX"; +static char *tmp_path; +static char *debug_path; =20 static QTestState *ide_test_start(const char *cmdline_fmt, ...) { @@ -1015,12 +1015,12 @@ int main(int argc, char **argv) int ret; =20 /* Create temporary blkdebug instructions */ - fd =3D mkstemp(debug_path); + fd =3D g_file_open_tmp("qtest-blkdebug.XXXXXX", &debug_path, NULL); g_assert(fd >=3D 0); close(fd); =20 /* Create a temporary raw image */ - fd =3D mkstemp(tmp_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &tmp_path, NULL); g_assert(fd >=3D 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); g_assert(ret =3D=3D 0); @@ -1049,7 +1049,9 @@ int main(int argc, char **argv) =20 /* Cleanup */ unlink(tmp_path); + g_free(tmp_path); unlink(debug_path); + g_free(debug_path); =20 return ret; } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664352906; cv=none; d=zohomail.com; s=zohoarc; b=jsf2W5O6Gya/C86JMbxySsBKn3VVdPADV4L+F4RpGGPa5qJVJnijtIjALhH8XFL9+g7B/X164YCdOScm4fGgG91zSOuMjbjKpbvRL+kTcRFPJrxPlI25PNxKCTXZKX3Au60a0iUgHYicNBlRukApe99/yuOxk2NPgl81yu2aae8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664352906; h=Content-Type: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=D9FLL6FSCHGyvQHSVgUQjkD9HZeeRLUKjgpMC/By/Eo=; b=QZu1RlSYHMtsDMzTgKJscKWyGIbRIpwXbxx5pvbBtZjGH4Ry8As7o0oeMwLvYZHdGqLjYG2AFOhUxp0ojH41s5ncT1AqtZ/FR8cFQ3N1LlJMuyxd1czQ0vFGh3LmaNz7Ea/FZDLjYnqJA5wQG4s7xi429ssSyj1YBXtQ96A6v0A= 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 1664352906294585.6918657277755; Wed, 28 Sep 2022 01:15:06 -0700 (PDT) Received: from localhost ([::1]:42776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSDh-0006Wx-2v for importer@patchew.org; Wed, 28 Sep 2022 04:15:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yP-OY for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLa-0008TI-E5 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:11 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-75-0-ARupMbPvCIiwW9NPKsmw-1; Wed, 28 Sep 2022 03:19:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F154868A21; Wed, 28 Sep 2022 07:19:04 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5303140C83BB; Wed, 28 Sep 2022 07:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349549; 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=D9FLL6FSCHGyvQHSVgUQjkD9HZeeRLUKjgpMC/By/Eo=; b=gDlY+lwj2Za34vU+9wQ3M7h2EomAGkcoaQeKJsQmPLbIIrgNgBjWUo6Ly9jGiIO6ng8UK/ zOI0rfGxxTWWRwGX20K67WotYUC1b8qx84N0x+58rwHgTUIc+MwWG5mTswArXwcTix+hTs JFIxVAwXasPiIPDgIitS4EKIQGULccU= X-MC-Unique: 0-ARupMbPvCIiwW9NPKsmw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 10/37] tests/qtest: vhost-user-blk-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:16 +0200 Message-Id: <20220928071843.1468323-11-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664352907986100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-18-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/vhost-user-blk-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/vhost-user-blk-test.c b/tests/qtest/vhost-user-blk= -test.c index a81c2a2715..07a4c2d500 100644 --- a/tests/qtest/vhost-user-blk-test.c +++ b/tests/qtest/vhost-user-blk-test.c @@ -841,7 +841,8 @@ static char *create_listen_socket(int *fd) char *path; =20 /* No race because our pid makes the path unique */ - path =3D g_strdup_printf("/tmp/qtest-%d-sock.XXXXXX", getpid()); + path =3D g_strdup_printf("%s/qtest-%d-sock.XXXXXX", + g_get_tmp_dir(), getpid()); tmp_fd =3D mkstemp(path); g_assert_cmpint(tmp_fd, >=3D, 0); close(tmp_fd); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664353459; cv=none; d=zohomail.com; s=zohoarc; b=IWxo5cHEDVBCnkxwAJeBtN/SqKtlFmYh8hO0QmxH3w3NAUpPDkWqQYCan2rcUeRgw6gpgpFBhrJ9R2RKZGCwLJvmAmJ3F3pFzuL7O1zpFBQtdvbEkNJ1ruZJvt90j+6qKYXIctii1bnP/6+5MJ9xvsnqhJfN5mznfU4w2XQ1keM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664353459; h=Content-Type: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=CzF0Gr+rnt43R6ngltYl2vSGN3la25xAMhez/ygFCvk=; b=QAYi2C/xvVRmOKppgCceqkiQD1P1cabpC4w1uhLiuGkXpqcuQSkdQx4aI0/pM08xfdIxAdC7MY113pXDnmsxCfLFmTmxxVwOWAF/QrkKAkXdwh47RF+GjmLMDv1uBNSxcONa9TGLuGyy9HlOZ8AcFsQGgZx76/ofqUZ6qOL/bsU= 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 1664353459659306.7494295577461; Wed, 28 Sep 2022 01:24:19 -0700 (PDT) Received: from localhost ([::1]:52862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSMc-0004Kl-7d for importer@patchew.org; Wed, 28 Sep 2022 04:24:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yN-Ng for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLY-0008TB-R5 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:10 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-93-uzVz7fujN9Ky9sqnhgnX-Q-1; Wed, 28 Sep 2022 03:19:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E01B0882820; Wed, 28 Sep 2022 07:19:05 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id B42C440C83BB; Wed, 28 Sep 2022 07:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349548; 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=CzF0Gr+rnt43R6ngltYl2vSGN3la25xAMhez/ygFCvk=; b=KwvCXoXUUpEEQsBE9udseHQ4M82zrMjWk10Mpq7GCmW4GuzkBkLg5nlXn8st5r+qij9lIJ Q416Ilgm2XJGDeam4XU/d1Tgaqdkh/Axy1VXOB5jFHumjrZo/dMr8PdWvvjAFtAxBHKJbp x+z2jb0mC2ljQEWcxVwT0FY2FCFmCT8= X-MC-Unique: uzVz7fujN9Ky9sqnhgnX-Q-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 11/37] tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:17 +0200 Message-Id: <20220928071843.1468323-12-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664353462020100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-20-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/virtio-blk-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/virtio-blk-test.c b/tests/qtest/virtio-blk-test.c index dc5eed31c8..19c01f808b 100644 --- a/tests/qtest/virtio-blk-test.c +++ b/tests/qtest/virtio-blk-test.c @@ -49,10 +49,10 @@ static void drive_destroy(void *path) static char *drive_create(void) { int fd, ret; - char *t_path =3D g_strdup("/tmp/qtest.XXXXXX"); + char *t_path; =20 /* Create a temporary raw image */ - fd =3D mkstemp(t_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &t_path, NULL); g_assert_cmpint(fd, >=3D, 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); g_assert_cmpint(ret, =3D=3D, 0); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664357855; cv=none; d=zohomail.com; s=zohoarc; b=BTOoUEF/IrC6F71Iz6n0Hm1MZsCxLb7N9feKqx6EK6Lcp+vSW47OW2QcRXL1fqCQokNntBG/9HizvsFOsuVmokxgArwv1gcOc9zGW9zK3nMyxV5YKq+ABoMuX5gtvudCeZvPR7d06A6zZiy8Wgt5KULLLAp5g5sz0nMwPEfN1m4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664357855; h=Content-Type: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=KXRCW//bY6nAjGO76dMuQ3l8tE0Jqz23zyP9s+wwXEo=; b=b//Or+vMV0C8fLsBiqsVXsVb7irutxm6nH//SOeMf5XrrArMd2NwDEPsO+LdzMF7sKZN1oEhjRsDQblA/5D+v55Y1e3mwcRSp2fyVqCHB6WEMa/8mOhIvVXOrgwKUoCZc4BtWfuRXa5G5CbnewR8HemSxGk6R8yzxyp/uZKzLGI= 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 1664357855471507.20900806663076; Wed, 28 Sep 2022 02:37:35 -0700 (PDT) Received: from localhost ([::1]:33690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTVV-0006k8-3v for importer@patchew.org; Wed, 28 Sep 2022 05:37:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yQ-Oj for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLa-0008TP-Oo for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:12 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-7Zm9VCxYPIiGnwP1NPuCxg-1; Wed, 28 Sep 2022 03:19:08 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2CC6868A21; Wed, 28 Sep 2022 07:19:07 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F86540C83BB; Wed, 28 Sep 2022 07:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349550; 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=KXRCW//bY6nAjGO76dMuQ3l8tE0Jqz23zyP9s+wwXEo=; b=HrrwNgw+lsFTQcTGjQCA0QMnqGW9tqoS2TLFyN90k7d3+8tfnl7IFoI4vJCCw87ConbygE FHMaTMQHL+GjuWJFIBSOq9GFwHe5jPo4uPjS9JU/SeodRdE/UlKvnZMQJBOU74/GprXtNb Lb9zIzt4P4v89QmpM6c3OXKW2GIaGQk= X-MC-Unique: 7Zm9VCxYPIiGnwP1NPuCxg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 12/37] tests/qtest: virtio-scsi-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:18 +0200 Message-Id: <20220928071843.1468323-13-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664357856893100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-21-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/virtio-scsi-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c index 8ceb12aacd..ceaa7f2415 100644 --- a/tests/qtest/virtio-scsi-test.c +++ b/tests/qtest/virtio-scsi-test.c @@ -268,7 +268,7 @@ static void test_iothread_attach_node(void *obj, void *= data, QVirtioSCSIPCI *scsi_pci =3D obj; QVirtioSCSI *scsi =3D &scsi_pci->scsi; QVirtioSCSIQueues *vs; - char tmp_path[] =3D "/tmp/qtest.XXXXXX"; + g_autofree char *tmp_path =3D NULL; int fd; int ret; =20 @@ -282,7 +282,7 @@ static void test_iothread_attach_node(void *obj, void *= data, vs =3D qvirtio_scsi_init(scsi->vdev); =20 /* Create a temporary qcow2 overlay*/ - fd =3D mkstemp(tmp_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &tmp_path, NULL); g_assert(fd >=3D 0); close(fd); =20 --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664357320; cv=none; d=zohomail.com; s=zohoarc; b=Nt2NmbA434Q/QJZZlCxsvcAf2Gb7fud+x/om+ed9xzE8kmxqDI2Ug3RdD/cDIMmPA2zXfVdnz6c2k3Xzn7qbqnhknrNaeEMO13/dOPAc4kOgzRA1aKCqczxz4GdUlcrsT96NtdyvHci+ktpc78my+qpi3W6cHe3VUcaTLhufCAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664357320; h=Content-Type: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=Rkz4eAcNK9l5w17uw7T4P7FC90vfCuJmxhWJJAstGqk=; b=UrqSxRYj2/sl1hrVX4yKyGHh1YlV3vOeBFrDh7dTPJcM29eFtOvFsee8eRjTjUcPMmz231uUiVYlvsZuP4+Tqr0gEqB+X3sxrLU1RH1Mqo0HYDvipolgK1X35y5GgZW02Bsizk+hgtVsKMQDNJxIUxNJIFPylrDUUfCuItecngg= 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 1664357320623654.8056269860939; Wed, 28 Sep 2022 02:28:40 -0700 (PDT) Received: from localhost ([::1]:48080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTMt-0000qr-Db for importer@patchew.org; Wed, 28 Sep 2022 05:28:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yR-PB for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLd-0008Tt-NZ for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-bVF1rKzMNxiX6QBIS52sIA-1; Wed, 28 Sep 2022 03:19:09 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1767E185A792; Wed, 28 Sep 2022 07:19:09 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFF7940C83C5; Wed, 28 Sep 2022 07:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349552; 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=Rkz4eAcNK9l5w17uw7T4P7FC90vfCuJmxhWJJAstGqk=; b=eeKA0yhh9klDf/ut6TxbOe2Jm/esq1eNwUEJOG8rii5UTT2mYTCtxfUcNxOal1tKgl1WMp fps+zj1D4Z8ViwiAvpGPdp6/B6FtFeqM7cWUvEmJytTQkjNcucUsLOTkx4avuXwdpLXVbV mqlt3tPRxouy0mDK20A2PvNplzYp7rw= X-MC-Unique: bVF1rKzMNxiX6QBIS52sIA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 13/37] tests/qtest: libqtest: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:19 +0200 Message-Id: <20220928071843.1468323-14-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664357322696100001 From: Bin Meng The qtest library was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() and g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-22-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqtest.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 7c9fc07de4..d8ffa0e7b1 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -265,8 +265,10 @@ QTestState *qtest_init_without_qmp_handshake(const cha= r *extra_args) =20 s =3D g_new(QTestState, 1); =20 - socket_path =3D g_strdup_printf("/tmp/qtest-%d.sock", getpid()); - qmp_socket_path =3D g_strdup_printf("/tmp/qtest-%d.qmp", getpid()); + socket_path =3D g_strdup_printf("%s/qtest-%d.sock", + g_get_tmp_dir(), getpid()); + qmp_socket_path =3D g_strdup_printf("%s/qtest-%d.qmp", + g_get_tmp_dir(), getpid()); =20 /* It's possible that if an earlier test run crashed it might * have left a stale unix socket lying around. Delete any @@ -390,10 +392,12 @@ QTestState *qtest_initf(const char *fmt, ...) QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd) { int sock_fd_init; - char *sock_path, sock_dir[] =3D "/tmp/qtest-serial-XXXXXX"; + g_autofree char *sock_dir =3D NULL; + char *sock_path; QTestState *qts; =20 - g_assert_true(g_mkdtemp(sock_dir) !=3D NULL); + sock_dir =3D g_dir_make_tmp("qtest-serial-XXXXXX", NULL); + g_assert_true(sock_dir !=3D NULL); sock_path =3D g_strdup_printf("%s/sock", sock_dir); =20 sock_fd_init =3D init_socket(sock_path); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664352326; cv=none; d=zohomail.com; s=zohoarc; b=bmzRSE9g1OejTd6WdDjUo/x2+VZPXoQ2A021/txPHRVeYhi5ZgFKtCSB8dlk/DRik7qhyjKFsHnqmIGJXP6YnMFffVkZNiEoDVqi7uK3Kh+75Uc20XcEGzy8dzmBI6YR8b9ObFmyGD4UiLBKTcA5xVwcjStJbogQx0CVCa7/lwI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664352326; h=Content-Type: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=i0YznsIzHmGPhqkaGSdouJT+RzkCcPK63D9jyeY1UD0=; b=XsV+HW5/B3TmUt5H0tpbOqDm94PUfP+L7PZ2qmbevoDaNDUZ7vK03qOBFDhNzO6VotKtS5beURdVToj8gcNSF+zS/C4W4ELWsJV5Zu+JCiMzg3QZaSJw1K5p5NMFF34ebtRjHsAz9FURczpfpFa6SsgXQQp2iutcAdQAxELzN1w= 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 1664352326017777.7643837440272; Wed, 28 Sep 2022 01:05:26 -0700 (PDT) Received: from localhost ([::1]:56100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odS4H-0000V0-CO for importer@patchew.org; Wed, 28 Sep 2022 04:05:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLm-0000ym-Lz for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21168) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0008UE-1T for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:21 -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-664-HLNbarwSN3ebGQH6-V6Gtw-1; Wed, 28 Sep 2022 03:19:11 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD9803C01D9D; Wed, 28 Sep 2022 07:19:10 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91AD440C83BB; Wed, 28 Sep 2022 07:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349555; 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=i0YznsIzHmGPhqkaGSdouJT+RzkCcPK63D9jyeY1UD0=; b=Y5twolEoi19efYRfb4O/kLFoLa9G3AwCzKKepyFm+N4MFduvnO1UcZqB3N2ICGKDV7z0IQ EEv6igOW/pgwHcrSp/5QQHarZDU7BLxXCN+6xF4m1k8gDQRE6VIU8WqOMmvW1Gr95McODg fyqrK+X5Ixn9caQ6a+GB4jNDlkP5dvo= X-MC-Unique: HLNbarwSN3ebGQH6-V6Gtw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 14/37] tests/unit: test-image-locking: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:20 +0200 Message-Id: <20220928071843.1468323-15-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664352327929100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-23-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/unit/test-image-locking.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/test-image-locking.c b/tests/unit/test-image-lockin= g.c index ba057bd66c..a47299c247 100644 --- a/tests/unit/test-image-locking.c +++ b/tests/unit/test-image-locking.c @@ -76,10 +76,10 @@ static void check_locked_bytes(int fd, uint64_t perm_lo= cks, static void test_image_locking_basic(void) { BlockBackend *blk1, *blk2, *blk3; - char img_path[] =3D "/tmp/qtest.XXXXXX"; + g_autofree char *img_path =3D NULL; uint64_t perm, shared_perm; =20 - int fd =3D mkstemp(img_path); + int fd =3D g_file_open_tmp("qtest.XXXXXX", &img_path, NULL); assert(fd >=3D 0); =20 perm =3D BLK_PERM_WRITE | BLK_PERM_CONSISTENT_READ; @@ -117,10 +117,10 @@ static void test_image_locking_basic(void) static void test_set_perm_abort(void) { BlockBackend *blk1, *blk2; - char img_path[] =3D "/tmp/qtest.XXXXXX"; + g_autofree char *img_path =3D NULL; uint64_t perm, shared_perm; int r; - int fd =3D mkstemp(img_path); + int fd =3D g_file_open_tmp("qtest.XXXXXX", &img_path, NULL); assert(fd >=3D 0); =20 perm =3D BLK_PERM_WRITE | BLK_PERM_CONSISTENT_READ; --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664351440; cv=none; d=zohomail.com; s=zohoarc; b=G5mbulBCB0aXYHCatOEescEaxbfrDLPXH6GWo5gtr84QYw814a+X93LgT+5dgA88iyxs4P50ofd24w8KpzvSxc4DVKxN+cdFhtlNBkStL04KRCwmTbuwshPPgIw9AbbqhrpmLbDvsI4cJq+Jqu8HPiqEv9nHXssIqwJbQYy0JzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664351440; h=Content-Type: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=dePdyRTl62AvVB7TLSqcw8+czymOGMtmr0veNvoXg5I=; b=leBO5z10VeoQJ0a+6nOl6rkNWa4hKokVNwrow+vwuFS1hggJLdBXMTt9oJw+UqkWl8we/WFkz51SAlExps7kf6mlZP3yNdPvVdbBN9kA4wUkz3CJ5nLDChn/qzrbymhsc5xLsyUKrYVrLpo3enyQsr1zaO5Fn9lztDtDkWsZvtk= 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 1664351440679928.799346968683; Wed, 28 Sep 2022 00:50:40 -0700 (PDT) Received: from localhost ([::1]:35732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odRq2-0002iO-NR for importer@patchew.org; Wed, 28 Sep 2022 03:50:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLh-0000yS-Oi for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLf-0008U4-29 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:16 -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-15-igu8rn8JODeS2t7rOQ3usA-1; Wed, 28 Sep 2022 03:19:13 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A134F3C01D96; Wed, 28 Sep 2022 07:19:12 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3942C40C83BB; Wed, 28 Sep 2022 07:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349554; 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=dePdyRTl62AvVB7TLSqcw8+czymOGMtmr0veNvoXg5I=; b=HWk14JcderdlDKS4vwLGb5D52iQV6KwieYIqvCeTcIJD4hlmHmO9BpXgx7y+NyaJ3LLsJD kskTGs9r8AL9wk7Sr+RD02QCgQkEdg2CrBQqI7V5KjEdj+WZ8peMMtKyi2CVR+YF2IqwAW n7liy1ntWqQ0Z6ZG9zuOGSQWK1pYWy8= X-MC-Unique: igu8rn8JODeS2t7rOQ3usA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 15/37] tests/unit: test-qga: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:21 +0200 Message-Id: <20220928071843.1468323-16-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664351442337100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-24-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/unit/test-qga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index b6ea7c7304..b4e0a14573 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -60,7 +60,7 @@ fixture_setup(TestFixture *fixture, gconstpointer data, g= char **envp) =20 fixture->loop =3D g_main_loop_new(NULL, FALSE); =20 - fixture->test_dir =3D g_strdup("/tmp/qgatest.XXXXXX"); + fixture->test_dir =3D g_strdup_printf("%s/qgatest.XXXXXX", g_get_tmp_d= ir()); g_assert_nonnull(g_mkdtemp(fixture->test_dir)); =20 path =3D g_build_filename(fixture->test_dir, "sock", NULL); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664358499; cv=none; d=zohomail.com; s=zohoarc; b=lovVzpxotE/c1jpUjfywIddbIc+Pji+TGJvX8zwjdhb854J7VDxWcJ1BtFmuU2/R8vh82vPrSZY/5xIKV5NuaDntm+MggmHrWh8C7/EXoFLM4QpLOv/ZWDX34EwqPQlmn36qAS1/bS4bUbO53gWCNa7uFha14zQCgcl2dzqGlIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664358499; h=Content-Type: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=9tbOptUO7BPTl9A94ErlpwGGSueTk4Wb42SVl8eTydY=; b=Aj4oxA4cT6Vk3GiQpk8+62xhVybvYlxnjcg54hH386D1ScAdbFHo7wvoJ/reb2jhCbhltANqUTUoOjaILWDDjnL8EixtQleL+0nyaac8MgX9LEIG7SgdVmYQTbWHQ8bvfT4ngSj7x0T3FtBj6BXrU8ZnSv0Vrftkg1l/pkvO/6U= 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 1664358499691999.3897433920462; Wed, 28 Sep 2022 02:48:19 -0700 (PDT) Received: from localhost ([::1]:46404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTfu-0004kf-Ad for importer@patchew.org; Wed, 28 Sep 2022 05:48:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLn-0000z4-Sx for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLk-0008UK-GS for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:23 -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-153-51Fz_IPOPTegRjPto-zxWA-1; Wed, 28 Sep 2022 03:19:15 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B14E31C20AF0; Wed, 28 Sep 2022 07:19:14 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11C3C40C83BB; Wed, 28 Sep 2022 07:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349556; 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=9tbOptUO7BPTl9A94ErlpwGGSueTk4Wb42SVl8eTydY=; b=B8gZlHVTfssUPOre/I5pw3AxSWxro/m03Qyxk0trCcgViAU/JAVKIbyhB6zc+aTcgpKUuJ UKjKrt9MDVb3KgxVvGBw/DtR6dkHlmykZZDcVx3ALEzMwDevYYeFHMj9Y+Ot5zUwx3RhZN kEPKN42I5tSvp4ZxnCmiJPVPaPr4pok= X-MC-Unique: 51Fz_IPOPTegRjPto-zxWA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 16/37] tests: vhost-user-bridge: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:22 +0200 Message-Id: <20220928071843.1468323-17-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664358501558100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-25-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/vhost-user-bridge.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index 9b1dab2f28..fecdf915e7 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -631,7 +631,6 @@ static void *notifier_thread(void *arg) static void vubr_host_notifier_setup(VubrDev *dev) { - char template[] =3D "/tmp/vubr-XXXXXX"; pthread_t thread; size_t length; void *addr; @@ -639,7 +638,7 @@ vubr_host_notifier_setup(VubrDev *dev) =20 length =3D qemu_real_host_page_size() * VHOST_USER_BRIDGE_MAX_QUEUES; =20 - fd =3D mkstemp(template); + fd =3D g_file_open_tmp("vubr-XXXXXX", NULL, NULL); if (fd < 0) { vubr_die("mkstemp()"); } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664355489; cv=none; d=zohomail.com; s=zohoarc; b=oLLIIX6G5YSVbE7xzqHO7eAhCWH+AMkvrFHdWuh7B52xQxqmtGV90Ve2akQGVqPOR0HtBPnLo0N/edvoAk3InuRcbvwF+4751Pp/w9GoRROamIgV3RCDcTjNRVvx+9AZDftzv63plXBJInL0Sqp+nEbN2Al8+KqVknSik4VxecU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664355489; h=Content-Type: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=8sqrbAh9YbIpZcl1GEUv3IkCM+lHs5Japl0w/cbqeH0=; b=ImtQNvd7wAJTOymMuklYPDI32T9Wkn6/B7Y+u8VuvVgtG71+NO4wT2kmuRKWZcOh2jT7UIa2SWTVp4CShnaE8aU/MpOHDUnnnIlod7uRabtTSmJeHaCL+T/aCvvL5aZeHneXwS8YPAZ3J0WGOuD2PC6LnBNZIFIq/6Pg92X9ovo= 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 1664355489420280.7695397844717; Wed, 28 Sep 2022 01:58:09 -0700 (PDT) Received: from localhost ([::1]:56216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odStM-000446-D8 for importer@patchew.org; Wed, 28 Sep 2022 04:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLq-00010I-CE for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLm-0008UV-Gh for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:24 -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-220-_Mel49NWPG2MrdPrrtztkg-1; Wed, 28 Sep 2022 03:19:16 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5873E1C20AEC; Wed, 28 Sep 2022 07:19:16 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27C1140C83BB; Wed, 28 Sep 2022 07:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349559; 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=8sqrbAh9YbIpZcl1GEUv3IkCM+lHs5Japl0w/cbqeH0=; b=K/g3KFTzgsWxW/LMGexilV+3CWZKQNFaN/AdYwE/mOXhmujk3EFfovn2JP3pDnzpCo3CFU LYMK8Sg7dvRkIyx1ivouHAI5gAntPUc/Uuo7FZlOl/ep7M1J6ruGauyoYPcAape6VgM522 PjXZjc4c0Pcqn5YqBmoBiNnx7yrxipA= X-MC-Unique: _Mel49NWPG2MrdPrrtztkg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 17/37] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32 Date: Wed, 28 Sep 2022 09:18:23 +0200 Message-Id: <20220928071843.1468323-18-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664355490054100001 From: Bin Meng Some of the virtio-net-test test cases require socketpair() to do the test setup. Skip them for win32. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-29-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/virtio-net-test.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/qtest/virtio-net-test.c b/tests/qtest/virtio-net-test.c index 6ded252901..dff43f0f60 100644 --- a/tests/qtest/virtio-net-test.c +++ b/tests/qtest/virtio-net-test.c @@ -165,8 +165,6 @@ static void stop_cont_test(void *obj, void *data, QGues= tAllocator *t_alloc) rx_stop_cont_test(dev, t_alloc, rx, sv[0]); } =20 -#endif - static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtioPCIDevice *dev =3D obj; @@ -286,6 +284,8 @@ static void *virtio_net_test_setup(GString *cmd_line, v= oid *arg) return sv; } =20 +#endif /* _WIN32 */ + static void large_tx(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtioNet *dev =3D obj; @@ -319,16 +319,15 @@ static void *virtio_net_test_setup_nosocket(GString *= cmd_line, void *arg) =20 static void register_virtio_net_test(void) { - QOSGraphTestOptions opts =3D { - .before =3D virtio_net_test_setup, - }; + QOSGraphTestOptions opts =3D { 0 }; =20 - qos_add_test("hotplug", "virtio-net-pci", hotplug, &opts); #ifndef _WIN32 + opts.before =3D virtio_net_test_setup; + qos_add_test("hotplug", "virtio-net-pci", hotplug, &opts); qos_add_test("basic", "virtio-net", send_recv_test, &opts); qos_add_test("rx_stop_cont", "virtio-net", stop_cont_test, &opts); -#endif qos_add_test("announce-self", "virtio-net", announce_self, &opts); +#endif =20 /* These tests do not need a loopback backend. */ opts.before =3D virtio_net_test_setup_nosocket; --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664355084; cv=none; d=zohomail.com; s=zohoarc; b=ZGH6mRCqIq2s8Xguel0Ka/sh5hpun+9er5vS2mcfUMKLgY92rQ4qsbz57IsselrApcTUkBgclhR5hUGX0h7PBf7toru3LD1Mzk6GOdXxUM8ZjBXUZgCbrEx3uf7S5UpKDypR/thmQCtV5ZTsvxs1ASEE2YBL5qES4jha1ybdC58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664355084; h=Content-Type: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=ve8BTFEJ8SlwZ9GsTrGk7OwwXRhwG2Tbjp5rgi+qtRk=; b=JdlZertxu68fzIi39P7OZA2cYesYPzcyJri7O4jFKnMH4Z8rMZv56H76BUL2AloTw1DwLHl5JVEvP9F946Uy3hXsD+EYtM4MJ+SnF3NXwcLgLNPY9jisnkle/hxZ01Wmbs2BW8NuWEGoCGkyHWP0PSCkWdsDHObhPBAPPYGQnD8= 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 1664355084256438.3253209773893; Wed, 28 Sep 2022 01:51:24 -0700 (PDT) Received: from localhost ([::1]:57154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSmo-0006JI-5v for importer@patchew.org; Wed, 28 Sep 2022 04:51:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLo-0000z9-4h for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLm-0008UX-FU for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:23 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-589-FP2VrOwcOza9_7ti-gf-HA-1; Wed, 28 Sep 2022 03:19:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EE356811E67; Wed, 28 Sep 2022 07:19:17 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD68D40C83D9; Wed, 28 Sep 2022 07:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349559; 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=ve8BTFEJ8SlwZ9GsTrGk7OwwXRhwG2Tbjp5rgi+qtRk=; b=IEm8MEbKGWpcK4s5gLsh8JNinFqmnX097VYCXVt3mufGvM+FMhKDNT1NtCtgdcbar7ETmI aRwR0LzgCuOaez1KkTLg+8S2zTZEAn9XhVAKGoHj6TsFfVomu2CLT6I4m8qibLin0vyxd6 9zKPXD4ULExirIOMZbUM9HA6+36rccc= X-MC-Unique: FP2VrOwcOza9_7ti-gf-HA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 18/37] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only Date: Wed, 28 Sep 2022 09:18:24 +0200 Message-Id: <20220928071843.1468323-19-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664355085598100001 From: Bin Meng The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-30-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/meson.build | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index e910cb32ca..455f1bbb7e 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -39,9 +39,14 @@ qtests_pci =3D \ qtests_cxl =3D \ (config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : []) =20 +qtests_filter =3D \ + (slirp.found() ? ['test-netfilter'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + qtests_i386 =3D \ - (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ - (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + = \ + (slirp.found() ? ['pxe-test'] : []) + \ + qtests_filter + \ (have_tools ? ['ahci-test'] : []) + = \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (config_all_devices.has_key('CONFIG_SGA') ? ['boot-serial-test'] : []) += \ @@ -95,8 +100,7 @@ qtests_i386 =3D \ 'vmgenid-test', 'migration-test', 'test-x86-cpuid-compat', - 'numa-test', - 'test-filter-redirector' + 'numa-test' ] =20 if dbus_display @@ -120,30 +124,25 @@ endif qtests_x86_64 =3D qtests_i386 =20 qtests_alpha =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + \ + qtests_filter + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) =20 qtests_avr =3D [ 'boot-serial-test' ] =20 qtests_hppa =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + \ + qtests_filter + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) =20 qtests_m68k =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + qtests_filter =20 qtests_microblaze =3D ['boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + qtests_filter =20 qtests_microblazeel =3D qtests_microblaze =20 qtests_mips =3D \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + \ + qtests_filter + \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) =20 @@ -152,8 +151,7 @@ qtests_mips64 =3D qtests_mips qtests_mips64el =3D qtests_mips =20 qtests_ppc =3D \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + \ + qtests_filter + \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + = \ (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) + = \ @@ -174,13 +172,11 @@ qtests_sh4 =3D (config_all_devices.has_key('CONFIG_IS= A_TESTDEV') ? ['endianness-te qtests_sh4eb =3D (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['end= ianness-test'] : []) =20 qtests_sparc =3D ['prom-env-test', 'm48t59-test', 'boot-serial-test'] + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ - (slirp.found() ? ['test-netfilter'] : []) + qtests_filter =20 qtests_sparc64 =3D \ (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] = : []) + \ - (slirp.found() ? ['test-netfilter'] : []) + \ - ['test-filter-mirror', 'test-filter-redirector'] + \ + qtests_filter + \ ['prom-env-test', 'boot-serial-test'] =20 qtests_npcm7xx =3D \ --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664351227; cv=none; d=zohomail.com; s=zohoarc; b=fBdoqHZfHkM7h2imtG6IDXEo8ibMg6UIA5WUBsVohOHfzEiTTU+vUqLzy6r3TB/6nJfjnonUbM6QwOieNecGfvVSTNxsNCwN2aCqj6iZVgtC4qifmUEYrO3C2z4epUweNf/n5/BAsAgEvsygVlXrSAsix1zzk4VrfBPYXL4Odfc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664351227; 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=fS0HFYuay2FaG6jezA4xu47Chtmh+TOfClxLJ6MIUFw=; b=mll9iCm9CnNab+CL6JvoolmLgjMxr70i8Cofn3/Idu4IN1sdVd1ujE9kbZr4M0oShYqZV3LDZavUyVKyyUSgCsC5ZjPaOoTUIdNLDclLmYe4S8xFOTqfSUY6wFfcUSlYy5WxCsrxdzyqSvFg+ztHrN0DzXwXwnWcYeuf9EvSwRI= 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 1664351227856596.1689323347878; Wed, 28 Sep 2022 00:47:07 -0700 (PDT) Received: from localhost ([::1]:54048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odRmc-0008OQ-QJ for importer@patchew.org; Wed, 28 Sep 2022 03:47:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLs-00010u-H2 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:21887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLr-0008VM-0X for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:28 -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-381-EksNxqiMNGiKDW-GHajsMQ-1; Wed, 28 Sep 2022 03:19:19 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B5231C20AEF; Wed, 28 Sep 2022 07:19:19 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D86440C83BB; Wed, 28 Sep 2022 07:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349566; 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=fS0HFYuay2FaG6jezA4xu47Chtmh+TOfClxLJ6MIUFw=; b=H6hBO213QdyvzOvhQFWA3hpmX8EDWsSnOUxLvkNSL293eQXh2dwBUxlk4R3ZOdkDndo4SO Fc5B0FxrpeDOqxGzvCDDPbl2+hxIGmWU+vrj53HfxLD4DbsshOsR7xPvswAT9XCp4r0Svi 4Co7Oo8C69SOVsPN9QZt2V/JNz9ZEeM= X-MC-Unique: EksNxqiMNGiKDW-GHajsMQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 19/37] tests/qtest: qmp-test: Skip running test_qmp_oob for win32 Date: Wed, 28 Sep 2022 09:18:25 +0200 Message-Id: <20220928071843.1468323-20-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664351229439100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-31-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/qmp-test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index bf7304c7dc..23b2a37942 100644 --- a/tests/qtest/qmp-test.c +++ b/tests/qtest/qmp-test.c @@ -159,6 +159,8 @@ static void test_qmp_protocol(void) qtest_quit(qts); } =20 +#ifndef _WIN32 + /* Out-of-band tests */ =20 char tmpdir[] =3D "/tmp/qmp-test-XXXXXX"; @@ -277,6 +279,8 @@ static void test_qmp_oob(void) qtest_quit(qts); } =20 +#endif /* _WIN32 */ + /* Preconfig tests */ =20 static void test_qmp_preconfig(void) @@ -336,7 +340,10 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); =20 qtest_add_func("qmp/protocol", test_qmp_protocol); +#ifndef _WIN32 + /* This case calls mkfifo() which does not exist on win32 */ qtest_add_func("qmp/oob", test_qmp_oob); +#endif qtest_add_func("qmp/preconfig", test_qmp_preconfig); qtest_add_func("qmp/missing-any-arg", test_qmp_missing_any_arg); =20 --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664356187; cv=none; d=zohomail.com; s=zohoarc; b=RnWY5VCUDEsjhF7DN+mX0KcCep/rkTZrN+pb6ocXdivzUK+9SZHzHgApArpBXp/nW9cfdmj9Pck602ZrjatsE4uuqUxvUVRiUhC2Bfn4PWwxCjm9KSQUMqbfA/gg1c6Q1Kp38cAKMmoxCtnCZrK+Ocz/YZukZbR/ukDJzqkbZxA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664356187; 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=NzLTNtj1QpJ9n1/eExxjBSPKEbT7n5YpjTjN2RWiNFs=; b=FA2ZJVnsB3lCAQpUALaYEqaxFbA5LoBU/kpMyfMc99yNkfjq0MFPHuvYG5btqcXY81ufudD8sbwd2bvAzXqy6R9XOCQwBenWkY15Pbxh1eEOSILWNcCypkGhPsufspWGhViEWg5lAzxaIC89f5Q4REMNRktUR+okF9y/3c3L0Go= 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 1664356187461575.9321429771336; Wed, 28 Sep 2022 02:09:47 -0700 (PDT) Received: from localhost ([::1]:50720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odT4b-0001lQ-1h for importer@patchew.org; Wed, 28 Sep 2022 05:09:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLt-00012O-AC for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLr-0008VQ-FD for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:28 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-266-YBDkhqwHPUSIA4ozGPkWMA-1; Wed, 28 Sep 2022 03:19:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 17083185A79C; Wed, 28 Sep 2022 07:19:23 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCA2740C83D9; Wed, 28 Sep 2022 07:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349566; 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=NzLTNtj1QpJ9n1/eExxjBSPKEbT7n5YpjTjN2RWiNFs=; b=Zzoa1Q0DO+vCXVxJs0oziRyL/yK18YeJd7wRQ9x9ILKoZfATvK9J7uhZMQzl3k/7rTu22g OF1U0teL8AuHtoqwq2GfeBj4a742qJm4etRq9PQRqbHnC5DfFwoqw/69q8+h/+zrLcWEvZ PoARNXhxw8RC4CidWkSnQIzgFbaEkns= X-MC-Unique: YBDkhqwHPUSIA4ozGPkWMA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng Subject: [PULL 20/37] tests/qtest: libqtest: Adapt global_qtest declaration for win32 Date: Wed, 28 Sep 2022 09:18:26 +0200 Message-Id: <20220928071843.1468323-21-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664356189712100001 Content-Type: text/plain; charset="utf-8" From: Xuzhou Cheng Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that r= equire global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work on Windows, and building qtest test cases results in multiple definition errors of the weak symbol global_qtest, as Windows PE does not have the concept of the so-called weak symbol like ELF in the *nix world. However Windows does provide a trick to declare a variable to be a common symbol, via __declspec(selectany) [1]. It does not provide the "strong override weak" effect but we don't need it in our use case anyway. So let's use it for win32. [1] https://docs.microsoft.com/en-us/cpp/cpp/selectany Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-33-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqtest-single.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h index 4e7d0ae1dc..851724cbcb 100644 --- a/tests/qtest/libqtest-single.h +++ b/tests/qtest/libqtest-single.h @@ -13,7 +13,11 @@ =20 #include "libqtest.h" =20 +#ifndef _WIN32 QTestState *global_qtest __attribute__((common, weak)); +#else +__declspec(selectany) QTestState *global_qtest; +#endif =20 /** * qtest_start: --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664353068; cv=none; d=zohomail.com; s=zohoarc; b=ZnlF7CC0lwsE1qUUKNhwP+i121+/69Dg7uJcpqgwp8RxPsFxexvU9mCKX4I7E0Tp/9GSOtT2EaoZUv6H2MU003gZFBKk7cXVoYUhi5ydAFCzClPb8HWzh9sFU90fzF2qM6uwfrdeBdEQwofGlH2VcVU2AvvdAJtX10Mo7jphONs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664353068; h=Content-Type: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=+QLQjP6pIJ6eaMa4W1rUwBiMUhKhefteCR6Kw9OXt+w=; b=C1I/npVFXdlB9Nb5fAV2J9XIyqkIG//D5I7AorKDhWlBVpLz3tzZFNP9pLUoczj2Z30IlPaOL579P96p2C+8GgJViwHAKuwyMxm+795SbYzfZCgQPshDTs3f4hHSCBBAoPhtyLN4Zl/8GVgU8oSCvi3VHJxN19+lLSSVndsnX/M= 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 16643530683941001.2555136369948; Wed, 28 Sep 2022 01:17:48 -0700 (PDT) Received: from localhost ([::1]:51228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSGI-0007AT-V1 for importer@patchew.org; Wed, 28 Sep 2022 04:17:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLv-00014q-7n for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLt-0008Vd-7i for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:30 -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-404-hy00STpMP3CfeXs0qu-zIQ-1; Wed, 28 Sep 2022 03:19:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EF50029AB402; Wed, 28 Sep 2022 07:19:24 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F2D740C83C5; Wed, 28 Sep 2022 07:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349568; 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=+QLQjP6pIJ6eaMa4W1rUwBiMUhKhefteCR6Kw9OXt+w=; b=Ljf7DfrXPd0aS+T9CvLjq5rcyu3IpJm1alVpki1RsKfEJ/ZdDt9YLexoBXssCPlzycKydK 8wdGJ2OBFl2F1rQfe4wrzVO/K4YmE3ehmZ+gppNiQDQWh58RCKIWbKUlHvMUAz8tsiAnGG MeDKp/k9cs/r8kEheCVoJBhhDZntA3c= X-MC-Unique: hy00STpMP3CfeXs0qu-zIQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 21/37] tests/qtest: libqtest: Exclude the *_fds APIs for win32 Date: Wed, 28 Sep 2022 09:18:27 +0200 Message-Id: <20220928071843.1468323-22-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664353071015100003 From: Bin Meng libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be excluded for win32 too. This includes the following: * qtest_qmp_vsend_fds() * qtest_vqmp_fds() * qtest_qmp_fds() * qtest_qmp_add_client() Note qtest_qmp_vsend() was wrongly written to call qmp_fd_vsend_fds() previously, but it should call the non fds version API qmp_fd_vsend(). Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-35-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqtest.h | 8 ++++++++ tests/qtest/libqtest.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index 94b187837d..3abc75964d 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -94,6 +94,7 @@ void qtest_kill_qemu(QTestState *s); */ void qtest_quit(QTestState *s); =20 +#ifndef _WIN32 /** * qtest_qmp_fds: * @s: #QTestState instance to operate on. @@ -108,6 +109,7 @@ void qtest_quit(QTestState *s); QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, ...) G_GNUC_PRINTF(4, 5); +#endif /* _WIN32 */ =20 /** * qtest_qmp: @@ -152,6 +154,7 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt,= ...) */ int qtest_socket_server(const char *socket_path); =20 +#ifndef _WIN32 /** * qtest_vqmp_fds: * @s: #QTestState instance to operate on. @@ -167,6 +170,7 @@ int qtest_socket_server(const char *socket_path); QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); +#endif /* _WIN32 */ =20 /** * qtest_vqmp: @@ -181,6 +185,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t f= ds_num, QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0); =20 +#ifndef _WIN32 /** * qtest_qmp_vsend_fds: * @s: #QTestState instance to operate on. @@ -196,6 +201,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_li= st ap) void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0); +#endif /* _WIN32 */ =20 /** * qtest_qmp_vsend: @@ -743,6 +749,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const = char *drv, void qtest_qmp_device_add(QTestState *qts, const char *driver, const char = *id, const char *fmt, ...) G_GNUC_PRINTF(4, 5); =20 +#ifndef _WIN32 /** * qtest_qmp_add_client: * @qts: QTestState instance to operate on @@ -752,6 +759,7 @@ void qtest_qmp_device_add(QTestState *qts, const char *= driver, const char *id, * Call QMP ``getfd`` followed by ``add_client`` with the given @fd. */ void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd); +#endif /* _WIN32 */ =20 /** * qtest_qmp_device_del: diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index d8ffa0e7b1..5c4a509c58 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -592,17 +592,20 @@ int qtest_socket_server(const char *socket_path) return sock; } =20 +#ifndef _WIN32 void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) { qmp_fd_vsend_fds(s->qmp_fd, fds, fds_num, fmt, ap); } +#endif =20 void qtest_qmp_vsend(QTestState *s, const char *fmt, va_list ap) { - qmp_fd_vsend_fds(s->qmp_fd, NULL, 0, fmt, ap); + qmp_fd_vsend(s->qmp_fd, fmt, ap); } =20 +#ifndef _WIN32 QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, va_list ap) { @@ -611,6 +614,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t f= ds_num, /* Receive reply */ return qtest_qmp_receive(s); } +#endif =20 QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap) { @@ -620,6 +624,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_li= st ap) return qtest_qmp_receive(s); } =20 +#ifndef _WIN32 QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num, const char *fmt, ...) { @@ -631,6 +636,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fd= s_num, va_end(ap); return response; } +#endif =20 QDict *qtest_qmp(QTestState *s, const char *fmt, ...) { @@ -1327,6 +1333,7 @@ void qtest_qmp_device_add(QTestState *qts, const char= *driver, const char *id, qobject_unref(args); } =20 +#ifndef _WIN32 void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd) { QDict *resp; @@ -1346,6 +1353,7 @@ void qtest_qmp_add_client(QTestState *qts, const char= *protocol, int fd) g_assert(!qdict_haskey(resp, "error")); qobject_unref(resp); } +#endif =20 /* * Generic hot-unplugging test via the device_del QMP command. --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664353479; cv=none; d=zohomail.com; s=zohoarc; b=S0C7rh2CtlWrUchJ1aRJ5huHXtXxcf/Tc6fzioedSxWY+OZn2qJIDpuuQeH78m9ivfuwgtvxwZN62Te0K473kQEAZ5Cha7A/15r1JjR2sbr6+DInu57/wcuqlNMV79qHBKSTH8UA83C5VKVyX2L5FNYU4Cvj9PIoeq0qQjPG2vs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664353479; h=Content-Type: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=KzE561aL0CLDS1WEU8W/QraRdzWpPvLgwlDfs/9CCGI=; b=DtFLC1qoyGLPzEGdW53SDkqelHpCTjiKc7U888IX9HxGIjKyTG9woT7pb2Bj/yAs2ppGaxypv9zryinl12PlKnHoasURJP5k7YGJBJHUxyVfOXBA82nDNmpLqqo1VXzq7+1mqonyA0XduKdzx2h2jY43xwVqp4MW+0CPSmpftBw= 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 1664353479797809.3841264763249; Wed, 28 Sep 2022 01:24:39 -0700 (PDT) Received: from localhost ([::1]:46198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSMw-00050Z-F5 for importer@patchew.org; Wed, 28 Sep 2022 04:24:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLx-00015R-6g for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLv-0008Vz-IG for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:32 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-438-58mFwwBGO0m4AeCS-ZjjLw-1; Wed, 28 Sep 2022 03:19:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C7D6F811E81; Wed, 28 Sep 2022 07:19:26 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F96240C83BB; Wed, 28 Sep 2022 07:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349571; 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=KzE561aL0CLDS1WEU8W/QraRdzWpPvLgwlDfs/9CCGI=; b=dViwxZqUJ/WRDLdDFkPdT9rpmWbkmsdXZ7wkCjhCHKqlc/i3WkzHAPNzGcffMNKwbjLlRH vo6sHDFJT6HGPrIOm4XO70udtAyuU98D/Uc2BP/EuQYpYJ/bhYu2I6+1mOSnTC2T5xGyPK HSNRX0PmVCRKlC5K0uJWJzc2/4wfJ6A= X-MC-Unique: 58mFwwBGO0m4AeCS-ZjjLw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 22/37] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32 Date: Wed, 28 Sep 2022 09:18:28 +0200 Message-Id: <20220928071843.1468323-23-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664353481931100003 From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-38-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/ahci-test.c | 21 ++++++++++++++++++--- tests/qtest/ide-test.c | 20 ++++++++++++++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index 1d5929d8c3..66652fed04 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -1833,7 +1833,7 @@ static void create_ahci_io_test(enum IOMode type, enu= m AddrMode addr, =20 int main(int argc, char **argv) { - const char *arch; + const char *arch, *base; int ret; int fd; int c; @@ -1871,8 +1871,22 @@ int main(int argc, char **argv) return 0; } =20 + /* + * "base" stores the starting point where we create temporary files. + * + * On Windows, this is set to the relative path of current working + * directory, because the absolute path causes the blkdebug filename + * parser fail to parse "blkdebug:path/to/config:path/to/image". + */ +#ifndef _WIN32 + base =3D g_get_tmp_dir(); +#else + base =3D "."; +#endif + /* Create a temporary image */ - fd =3D g_file_open_tmp("qtest.XXXXXX", &tmp_path, NULL); + tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", base); + fd =3D g_mkstemp(tmp_path); g_assert(fd >=3D 0); if (have_qemu_img()) { imgfmt =3D "qcow2"; @@ -1889,7 +1903,8 @@ int main(int argc, char **argv) close(fd); =20 /* Create temporary blkdebug instructions */ - fd =3D g_file_open_tmp("qtest-blkdebug.XXXXXX", &debug_path, NULL); + debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", base); + fd =3D g_mkstemp(debug_path); g_assert(fd >=3D 0); close(fd); =20 diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 25302be6dc..5e3e28aea2 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -1011,16 +1011,32 @@ static void test_cdrom_dma(void) =20 int main(int argc, char **argv) { + const char *base; int fd; int ret; =20 + /* + * "base" stores the starting point where we create temporary files. + * + * On Windows, this is set to the relative path of current working + * directory, because the absolute path causes the blkdebug filename + * parser fail to parse "blkdebug:path/to/config:path/to/image". + */ +#ifndef _WIN32 + base =3D g_get_tmp_dir(); +#else + base =3D "."; +#endif + /* Create temporary blkdebug instructions */ - fd =3D g_file_open_tmp("qtest-blkdebug.XXXXXX", &debug_path, NULL); + debug_path =3D g_strdup_printf("%s/qtest-blkdebug.XXXXXX", base); + fd =3D g_mkstemp(debug_path); g_assert(fd >=3D 0); close(fd); =20 /* Create a temporary raw image */ - fd =3D g_file_open_tmp("qtest.XXXXXX", &tmp_path, NULL); + tmp_path =3D g_strdup_printf("%s/qtest.XXXXXX", base); + fd =3D g_mkstemp(tmp_path); g_assert(fd >=3D 0); ret =3D ftruncate(fd, TEST_IMAGE_SIZE); g_assert(ret =3D=3D 0); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664354586; cv=none; d=zohomail.com; s=zohoarc; b=fJVtZfnss0Z0boEvwx2S2QzD4xpvFetCbk1oY6qN7uVeZZIl7MT5EVvz0x6mny94NN9kEVT4Fw6KOhgG5LkMQpogptUxsIWusfi//YatUkXlgi64FST6Dv81IhpvTRZtR37ozx0VTtTwJyFUPZaUbBHDPdA0Igat06Fbn5v15g4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664354586; h=Content-Type: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=CJhyWf8VOIPFc/8+4MV56CGViqzkStB9MarF3b5Sfoo=; b=NaH0b3hyniso9rQXpO/BcQqZqZthzOU1IKyvthJ2OYK+O6EBJOqdnGIbmyZa3xIlOkRB88toQoz9gLmedAyNjhEW1mYdkHOe+jaYnrZRU2isGsmux1tf3whiAbg95cP07UKA3PRN/LQY+1hnN9wOQAdg2yuWWQM1gcBxCAVEN/4= 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 1664354586009573.9151674463502; Wed, 28 Sep 2022 01:43:06 -0700 (PDT) Received: from localhost ([::1]:56022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSem-0000X3-Vc for importer@patchew.org; Wed, 28 Sep 2022 04:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM2-00016E-W8 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM1-000054-Dc for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:38 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-580-3iMRJNxPPwCX3uhxBoXjkQ-1; Wed, 28 Sep 2022 03:19:31 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E0CA0101A528; Wed, 28 Sep 2022 07:19:30 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38E0A40C83BB; Wed, 28 Sep 2022 07:19:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349576; 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=CJhyWf8VOIPFc/8+4MV56CGViqzkStB9MarF3b5Sfoo=; b=Cto8fLMnzPHpiFyCJ9J3pQ06QgdpuRkuaN9C16Szgo+58eHJDbSjY0GcopqIKYj7KAmCZ7 fF0HyeN9lBje7It6Wg0HDnceUmb5R92IOEdNoIFbz4lZsfj9WxSJcDJZNOronxSoDA9QTi oyPVzqyzy2wo6nNNOE5jz6Mov13ClaU= X-MC-Unique: 3iMRJNxPPwCX3uhxBoXjkQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S . Tsirkin" Subject: [PULL 23/37] tests/qtest: bios-tables-test: Adapt the case for win32 Date: Wed, 28 Sep 2022 09:18:29 +0200 Message-Id: <20220928071843.1468323-24-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664354588067100003 From: Bin Meng Single quotes in the arguments (oem_id=3D'CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable' requires one of 'data' or 'file' Change to use double quotes which works fine on all platforms. Also /dev/null does not work on win32, and nul should be used. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Acked-by: Michael S. Tsirkin Message-Id: <20220925113032.1949844-39-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/bios-tables-test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 46a46fe0aa..2ebeb530b2 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1615,6 +1615,12 @@ static void test_acpi_virt_viot(void) free_test_data(&data); } =20 +#ifndef _WIN32 +# define DEV_NULL "/dev/null" +#else +# define DEV_NULL "nul" +#endif + static void test_acpi_q35_slic(void) { test_data data =3D { @@ -1622,9 +1628,9 @@ static void test_acpi_q35_slic(void) .variant =3D ".slic", }; =20 - test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D'CRASH ',oem_table_id=3D= 'ME'," - "oem_rev=3D00002210,asl_compiler_id=3D'qemu'," - "asl_compiler_rev=3D00000000,data=3D/dev/null", + test_acpi_one("-acpitable sig=3DSLIC,oem_id=3D\"CRASH \",oem_table_id= =3DME," + "oem_rev=3D00002210,asl_compiler_id=3Dqemu," + "asl_compiler_rev=3D00000000,data=3D" DEV_NULL, &data); free_test_data(&data); } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664354021; cv=none; d=zohomail.com; s=zohoarc; b=RYcA5DENu/dgordbm4z/mp98CcE1nnaXjs71dL4xuuJv3mwTfBZ1vtLpPoSbEIfeKGOq4c+8cG+wNSrstcx/QrFVEmeKTN4Vhwsn7/G+xlkvwuxI5lR234fI81XwjwiS5JmieUKwPQQwoKUfen6D0SqQXT3YGGm7t8J5qkZWo2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664354021; h=Content-Type: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=dnNF3FFScfyEYJiYD6u6YrdL/GDgiWdz4n2QFjmMin4=; b=F9P87wJGAMSEMS0ya9Ndpn4icu5gEav9fDblo0j5AuW4mwtA30MNmuVNyhMN45FSKC/HGVDGde5T+ZFSuhFF+KAvjuh35MYUlqOQGYDXgTS1nS1ETh6fJ17AxH4/dGDJPGZICciacHlI0/TMlMTBBVcxoq8GqPTD1d+jcUOC+Ac= 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 1664354021542120.67174060108312; Wed, 28 Sep 2022 01:33:41 -0700 (PDT) Received: from localhost ([::1]:33434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSVf-0002nM-9E for importer@patchew.org; Wed, 28 Sep 2022 04:33:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM1-000167-6t for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRLz-0008WR-Kv for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:36 -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-178-ZcYS1yirNBqhI7ciL10apA-1; Wed, 28 Sep 2022 03:19:32 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 87E801C20AF0; Wed, 28 Sep 2022 07:19:32 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CFE340C83BB; Wed, 28 Sep 2022 07:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349575; 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=dnNF3FFScfyEYJiYD6u6YrdL/GDgiWdz4n2QFjmMin4=; b=eQaJ+WCrFc98eLUVthuztIDcfjFwnXIr4VBo8pISup3IVlJKh7npEXGo2ef3GjaFZAk36a epwPAGr8jVoJctifbX8l+xGBnaAgvsaauXKhGxOkxUvNlOvwYHWTmnCuw/zCqfFYH/miiL 4hwrBbiiQZQyOszj6TMSXtxl9mE6D4M= X-MC-Unique: ZcYS1yirNBqhI7ciL10apA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 24/37] tests/qtest: migration-test: Disable IO redirection for win32 Date: Wed, 28 Sep 2022 09:18:30 +0200 Message-Id: <20220928071843.1468323-25-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664354021906100003 From: Bin Meng On Windows the QEMU executable is created via CreateProcess() and IO redirection does not work, so don't bother adding IO redirection to the command line. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-40-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/migration-test.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 4728d528bb..3db1177377 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -647,7 +647,16 @@ static int test_migrate_start(QTestState **from, QTest= State **to, } =20 if (!getenv("QTEST_LOG") && args->hide_stderr) { +#ifndef _WIN32 ignore_stderr =3D "2>/dev/null"; +#else + /* + * On Windows the QEMU executable is created via CreateProcess() a= nd + * IO redirection does not work, so don't bother adding IO redirec= tion + * to the command line. + */ + ignore_stderr =3D ""; +#endif } else { ignore_stderr =3D ""; } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664355501; cv=none; d=zohomail.com; s=zohoarc; b=FTDa72vwhJc2iysiJa19SAjr8cTyWEK6JK/h4si9N01FADkL5k+P2hQeJVLnw+BY5nE6HjZTfVd0QsazowvKZyqlB5i0zYqVxIqN4ELspBwZPPtnU8kGKK+QTfQSzHp9Bo09w5ewJJyvjpio/xCxxTI/0RmXZ7d2g1lc4GXDMEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664355501; h=Content-Type: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=HI/VfznO4UQL0HIy+S9kEIJ2JLBmNqz4yZVlxkh6YTo=; b=gLIg26kMnlpLBIaC18IOAiz90yckBsx8EGLrle+J9ZjWU96N8VTAb3MshVb+2L/sUG6nGuEJ5dNlu3vze8CpBUjZEs/HhPX60J6+iHDLU0sUqbsPDrMa7TDJFhbmCnORihqy/FgjKpLQqMcbDf2Jxq/rlUy9NPzJWg1Z2Q0sAGE= 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 1664355501655299.39391130981664; Wed, 28 Sep 2022 01:58:21 -0700 (PDT) Received: from localhost ([::1]:51754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odStX-0004dK-I3 for importer@patchew.org; Wed, 28 Sep 2022 04:58:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM9-000190-Q3 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM4-00005k-DV for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-640-uN94-AHnM32axM_88FVTHA-1; Wed, 28 Sep 2022 03:19:34 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43ABB882821; Wed, 28 Sep 2022 07:19:34 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB67340C83BB; Wed, 28 Sep 2022 07:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349579; 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=HI/VfznO4UQL0HIy+S9kEIJ2JLBmNqz4yZVlxkh6YTo=; b=a185CCzzTIt/zA7qSTGYU4629JhkI7uixlugrg63DZBurbEBJU0Zmj4jmNjpk+4p6jp9ep 4JvuaOQsNycUVcZlbfLPy+KOzyFDwF7zrwWcv0IKA6jUIcnGW+EUTgqdc6uVdLdjNlZUsS /mCgSW3vu/6pojApLYt/gMp1SpmSwg8= X-MC-Unique: uN94-AHnM32axM_88FVTHA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 25/37] tests/qtest: ide-test: Open file in binary mode Date: Wed, 28 Sep 2022 09:18:31 +0200 Message-Id: <20220928071843.1468323-26-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664355502140100001 From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect, but is allowed for ISO C standard conformance. Let's add the letter 'b' which works on both POSIX and Windows. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-41-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/ide-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qtest/ide-test.c b/tests/qtest/ide-test.c index 5e3e28aea2..4ea89c26c9 100644 --- a/tests/qtest/ide-test.c +++ b/tests/qtest/ide-test.c @@ -892,7 +892,7 @@ static void cdrom_pio_impl(int nblocks) =20 /* Prepopulate the CDROM with an interesting pattern */ generate_pattern(pattern, patt_len, ATAPI_BLOCK_SIZE); - fh =3D fopen(tmp_path, "w+"); + fh =3D fopen(tmp_path, "wb+"); ret =3D fwrite(pattern, ATAPI_BLOCK_SIZE, patt_blocks, fh); g_assert_cmpint(ret, =3D=3D, patt_blocks); fclose(fh); @@ -993,7 +993,7 @@ static void test_cdrom_dma(void) prdt[0].size =3D cpu_to_le32(len | PRDT_EOT); =20 generate_pattern(pattern, ATAPI_BLOCK_SIZE * 16, ATAPI_BLOCK_SIZE); - fh =3D fopen(tmp_path, "w+"); + fh =3D fopen(tmp_path, "wb+"); ret =3D fwrite(pattern, ATAPI_BLOCK_SIZE, 16, fh); g_assert_cmpint(ret, =3D=3D, 16); fclose(fh); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664355128; cv=none; d=zohomail.com; s=zohoarc; b=F9J9BVddhZeS6/3BDTlqU6qYqkQskzKc332xuFxeibshHHq6jhjhMILkvXL5ZVNV57sKkFcsCNKYQQ5XMJMRA+qztBDTKKNy+aWHAPk9L7OWVZZ1xueYqKd1Yr0Yepp5ox2eVbLZgbPB/BdEKhcKCg9h+REsWGYHw21d47PfCME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664355128; h=Content-Type: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=zSZoX2Io63krnoBhRHtWcDZ1L8thJgpeD+q7WPJ8WIM=; b=HeHKTxmlJaRsrogeEIVi0ErYKwyQ0kbv3rK+hbJEKk3SU+UNY/+CTyqfusfEblzhhlrhX9bYfbO1GvwQ9m7pAdrq3lU+T9uzC20zEyecJgFpV0JVd0EOrqYd8xTigULUSXJk8mNOsDYMj7AcwCQxfVtPY6VImH7zP3ArzjUz3pc= 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 1664355128617104.11859250659995; Wed, 28 Sep 2022 01:52:08 -0700 (PDT) Received: from localhost ([::1]:41302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSnV-000773-VT for importer@patchew.org; Wed, 28 Sep 2022 04:52:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM7-00018C-NS for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:22460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM4-00005h-IT for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:42 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-UGA1zQrjMZuYVBP9Bx5DiQ-1; Wed, 28 Sep 2022 03:19:36 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA2C5868A21; Wed, 28 Sep 2022 07:19:35 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BC1940C83BB; Wed, 28 Sep 2022 07:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349579; 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=zSZoX2Io63krnoBhRHtWcDZ1L8thJgpeD+q7WPJ8WIM=; b=VQECap4FOq52OYvLeg7N/h8k1zxNELJfEjYTMl1Em7d8LTbqFfUDII37LID0Ga2e8ehBbu sDQrebnI3pmbOW9UtY+jP5pT+Xrf2IJ2NIk1OWuVfv0IKQ5bYEFamWnv64JAhzlOHIOVbT sVPq3E2nXAkXvUTA5aRBxiOWvBPhpso= X-MC-Unique: UGA1zQrjMZuYVBP9Bx5DiQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Xuzhou Cheng , Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 26/37] tests/qtest: virtio-net-failover: Disable migration tests for win32 Date: Wed, 28 Sep 2022 09:18:32 +0200 Message-Id: <20220928071843.1468323-27-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664355129906100001 From: Xuzhou Cheng These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-42-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/virtio-net-failover.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-fai= lover.c index 443ee56de9..4a809590bf 100644 --- a/tests/qtest/virtio-net-failover.c +++ b/tests/qtest/virtio-net-failover.c @@ -588,6 +588,7 @@ static void test_hotplug_2_reverse(void) machine_stop(qts); } =20 +#ifndef _WIN32 static QDict *migrate_status(QTestState *qts) { QDict *resp, *ret; @@ -1827,6 +1828,7 @@ static void test_multi_in(gconstpointer opaque) =20 machine_stop(qts); } +#endif /* _WIN32 */ =20 int main(int argc, char **argv) { @@ -1857,7 +1859,11 @@ int main(int argc, char **argv) qtest_add_func("failover-virtio-net/hotplug/2_reverse", test_hotplug_2_reverse); =20 - /* migration tests */ +#ifndef _WIN32 + /* + * These migration tests cases use the exec migration protocol, + * which is unsupported on Windows. + */ qtest_add_data_func("failover-virtio-net/migrate/on/out", tmpfile, test_migrate_out); qtest_add_data_func("failover-virtio-net/migrate/on/in", tmpfile, @@ -1886,6 +1892,7 @@ int main(int argc, char **argv) tmpfile, test_multi_out); qtest_add_data_func("failover-virtio-net/migrate/multi/in", tmpfile, test_multi_in); +#endif /* _WIN32 */ =20 ret =3D g_test_run(); =20 --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664352764; cv=none; d=zohomail.com; s=zohoarc; b=K8WU37JaIgLOAcy19DT3IAlUELBXHJcXxQnUT+7/uuQG8TMLWVD1qNRr0e0ebI4cem02NA6gg1rlRHpeb45LOxKPq7RII6gJqyueLxSOnKv+NMAGrccSRWL7CgVL1bKDhYkKm02j3Wj+x37ZEsNTW03DRtTDLCIEI/u0Il9htjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664352764; h=Content-Type: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=wz+tV55f6JGd6+DT7U2gMJM8YM5pasl4rLidgPRaDtY=; b=LpSyq6qE2ibP6S9lgnTHZYY3WrEICJ9LKBIDfDO5wQ9ugz+uDIHkQYmEZGvNtMXXLrmnVl/lNY8L/2W5Ofnbtgn6VbuAkwBEyDRspBTameK2E62mGmH0HraqaVY5MXJVpyJ6+QsBd4nGapM5TWqNUK2KQMs62vwzGrMFGZ+o0i4= 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 1664352764046464.11597848107124; Wed, 28 Sep 2022 01:12:44 -0700 (PDT) Received: from localhost ([::1]:34224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSBM-0004Hc-Cl for importer@patchew.org; Wed, 28 Sep 2022 04:12:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM9-00018z-Pc for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM5-00005r-Kn for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-T1xOSgiqO2O0zks2gkHaRg-1; Wed, 28 Sep 2022 03:19:37 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7CACF101CC67; Wed, 28 Sep 2022 07:19:37 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B65140C83BB; Wed, 28 Sep 2022 07:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349580; 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=wz+tV55f6JGd6+DT7U2gMJM8YM5pasl4rLidgPRaDtY=; b=UeIvCIMCeYHwPloXsrWgJAcaRpqabPcRglsohJcqxpqRlsrEM7PpYhnM838GaM0QlgjigU B0mCOdmcGuKYhC3PD9ePdDu6pKJtypfa/yIOq+xZj0bDQDwrkkVsw131a3DVU2VwW/z9t9 JHeLaabkCiNowph6R+Z5sFcdlOUBEq0= X-MC-Unique: T1xOSgiqO2O0zks2gkHaRg-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 27/37] tests/qtest: microbit-test: Fix socket access for win32 Date: Wed, 28 Sep 2022 09:18:33 +0200 Message-Id: <20220928071843.1468323-28-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664352767480100001 From: Bin Meng Sockets on Windows do not use *nix-style file descriptors, so write()/read()/close() do not work on Windows. Switch over to use send()/recv()/closesocket() which work with sockets on all platforms. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-45-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/microbit-test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/qtest/microbit-test.c b/tests/qtest/microbit-test.c index b71daae9a9..4bc267020b 100644 --- a/tests/qtest/microbit-test.c +++ b/tests/qtest/microbit-test.c @@ -51,7 +51,7 @@ static void uart_rw_to_rxd(QTestState *qts, int sock_fd, = const char *in, { int i, in_len =3D strlen(in); =20 - g_assert_true(write(sock_fd, in, in_len) =3D=3D in_len); + g_assert_true(send(sock_fd, in, in_len, 0) =3D=3D in_len); for (i =3D 0; i < in_len; i++) { g_assert_true(uart_wait_for_event(qts, NRF51_UART_BASE + A_UART_RXDRDY)); @@ -77,7 +77,7 @@ static void test_nrf51_uart(void) char s[10]; QTestState *qts =3D qtest_init_with_serial("-M microbit", &sock_fd); =20 - g_assert_true(write(sock_fd, "c", 1) =3D=3D 1); + g_assert_true(send(sock_fd, "c", 1, 0) =3D=3D 1); g_assert_cmphex(qtest_readl(qts, NRF51_UART_BASE + A_UART_RXD), =3D=3D= , 0x00); =20 qtest_writel(qts, NRF51_UART_BASE + A_UART_ENABLE, 0x04); @@ -97,17 +97,17 @@ static void test_nrf51_uart(void) =20 qtest_writel(qts, NRF51_UART_BASE + A_UART_STARTTX, 0x01); uart_w_to_txd(qts, "d"); - g_assert_true(read(sock_fd, s, 10) =3D=3D 1); + g_assert_true(recv(sock_fd, s, 10, 0) =3D=3D 1); g_assert_cmphex(s[0], =3D=3D, 'd'); =20 qtest_writel(qts, NRF51_UART_BASE + A_UART_SUSPEND, 0x01); qtest_writel(qts, NRF51_UART_BASE + A_UART_TXD, 'h'); qtest_writel(qts, NRF51_UART_BASE + A_UART_STARTTX, 0x01); uart_w_to_txd(qts, "world"); - g_assert_true(read(sock_fd, s, 10) =3D=3D 5); + g_assert_true(recv(sock_fd, s, 10, 0) =3D=3D 5); g_assert_true(memcmp(s, "world", 5) =3D=3D 0); =20 - close(sock_fd); + closesocket(sock_fd); =20 qtest_quit(qts); } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664356201; cv=none; d=zohomail.com; s=zohoarc; b=KhHFLpSiQm/VhciSuPwza9vkoVmIqfSGLtnrBBsxVhFDRq4krcqWLbYS3EeIUJqVOnkYryF0knSZFJtH9o5BS9HfkhxEZWGK4K+4BbcD/CSr9WTN681qbOaYMPvXQrDNLJs0zJGeQq/LqIZ5jRtPFm8tEJHMngJQGTB9CC5XQeE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664356201; h=Content-Type: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=A6lylWEVzM1bPmim+OJ7MiExdxqOuyQXFQ8H5ZIwpYE=; b=OFWXIlTLm+VrohkbJHgcqqrPMIbYuES8FVoi7XLIHdhAd/sVoaCJ2PKIs1aCUolwdfxeqtSTcc2v+o4V4qRULhoPopQeHcFcIqmOI99ZAonsiQILAF5rJv1E+MwaheCty29X2SeP56QIHkAUTORCzIFR3uXAAvB4S61kYbBTYS4= 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 1664356201251151.3395792009095; Wed, 28 Sep 2022 02:10:01 -0700 (PDT) Received: from localhost ([::1]:38878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odT4q-0002PM-7x for importer@patchew.org; Wed, 28 Sep 2022 05:10:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM9-000193-RH for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM7-00006J-IY for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:45 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-44-LvCET8oXONinA3mJnp2hQw-1; Wed, 28 Sep 2022 03:19:39 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2B0F882822; Wed, 28 Sep 2022 07:19:38 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id D65E040C83BB; Wed, 28 Sep 2022 07:19:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349582; 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=A6lylWEVzM1bPmim+OJ7MiExdxqOuyQXFQ8H5ZIwpYE=; b=YSOJDQ/n9R1EXUH4kuXXidUud+Q8Y7OfCuXRgMZHbtrpUjhXAsevTmhbihehZsp/+rhMKr XYxGx7JOYkCyk4E4SDtj5qZTrsJ2aG7vOTHKd1ifGzgg6kClewtj+ScGb8pmXe+Dpplv1B qR+ImpdOctKhCSYSXXK5ycl3kbJavKc= X-MC-Unique: LvCET8oXONinA3mJnp2hQw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 28/37] tests/qtest: libqtest: Replace the call to close a socket with closesocket() Date: Wed, 28 Sep 2022 09:18:34 +0200 Message-Id: <20220928071843.1468323-29-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664356201780100001 From: Bin Meng close() is a *nix function. It works on any file descriptor, and sockets in *nix are an example of a file descriptor. closesocket() is a Windows-specific function, which works only specifically with sockets. Sockets on Windows do not use *nix-style file descriptors, and socket() returns a handle to a kernel object instead, so it must be closed with closesocket(). In QEMU there is already a logic to handle such platform difference in os-posix.h and os-win32.h, that: * closesocket maps to close on POSIX * closesocket maps to a wrapper that calls the real closesocket() on Windows Replace the call to close a socket with closesocket() instead. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220925113032.1949844-46-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 5c4a509c58..4f4b2d6477 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -97,7 +97,7 @@ static int socket_accept(int sock) (void *)&timeout, sizeof(timeout))) { fprintf(stderr, "%s failed to set SO_RCVTIMEO: %s\n", __func__, strerror(errno)); - close(sock); + closesocket(sock); return -1; } =20 @@ -108,7 +108,7 @@ static int socket_accept(int sock) if (ret =3D=3D -1) { fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno)); } - close(sock); + closesocket(sock); =20 return ret; } @@ -421,8 +421,8 @@ void qtest_quit(QTestState *s) qtest_remove_abrt_handler(s); =20 qtest_kill_qemu(s); - close(s->fd); - close(s->qmp_fd); + closesocket(s->fd); + closesocket(s->qmp_fd); g_string_free(s->rx, true); =20 for (GList *it =3D s->pending_events; it !=3D NULL; it =3D it->next) { --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664351909; cv=none; d=zohomail.com; s=zohoarc; b=kuXh/XhTGjPRHocG+osG6Z7kMGuTHYwNpHvIzjU39Nuou8/j0DRFdTxta9rgsdVdpmUqgNwF5GVoChMzEonKi6WKpnsAzAzygoL//SDefugpcnnxK1eeHn414h7gCuimExQL1nyBnj5qBnaMVix3fjxoyiDpts/9+u3D4kVkzeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664351909; 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=FqK53HiLqubGe4i5AWK6z/x4b/Cp9RLfAtOKktGCY0U=; b=Lch8vhIr2zlFjB/1x7yhXJ9HIWgxJ4QIa72iooezQoobcZLs2Z7fuVUDjcgjpXBFSROzS9QMpQqqLOtY7/TCu8jNACGUDam3be1d9c1N12kN8wv5UGKV3WMsqhtFns8zbPDY3vo3C75mM4+Aeyw4OqnUmvdarNUd9w1anBRqQ1M= 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 1664351909125249.7297227885; Wed, 28 Sep 2022 00:58:29 -0700 (PDT) Received: from localhost ([::1]:34478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odRxb-000674-Ka for importer@patchew.org; Wed, 28 Sep 2022 03:58:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM9-000192-Qt for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM7-00006G-Fd for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:44 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-UcX4zyptMTe3hDRUgN8bjA-1; Wed, 28 Sep 2022 03:19:41 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7985811E67; Wed, 28 Sep 2022 07:19:40 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id E659B40C83BB; Wed, 28 Sep 2022 07:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349582; 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=FqK53HiLqubGe4i5AWK6z/x4b/Cp9RLfAtOKktGCY0U=; b=RsJiiR7jFsIOPC+SvTDS3MYCWXC0ETE4xtuFIUrfFLbnLBfzxskBpCA3UxjDe0znxc8PMz 7YO0kv5MwjCgh8bNVBapsdE+gxtX05u7co3kb/msG71oqMeQLP0p+evX0TlqI5izqvum81 8JPGOmOPLmnfPp+YPYoIJzjm0HN6cE8= X-MC-Unique: UcX4zyptMTe3hDRUgN8bjA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 29/37] tests/qtest: migration-test: Skip running some TLS cases for win32 Date: Wed, 28 Sep 2022 09:18:35 +0200 Message-Id: <20220928071843.1468323-30-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664351910427100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng Some migration test cases use TLS to communicate, but they fail on Windows with the following error messages: qemu-system-x86_64: TLS handshake failed: Insufficient credentials for th= at request. qemu-system-x86_64: TLS handshake failed: Error in the pull function. query-migrate shows failed migration: TLS handshake failed: Error in the = pull function. Disable them temporarily. Signed-off-by: Bin Meng Message-Id: <20220925113032.1949844-51-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/migration-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 3db1177377..0d153d6b5e 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1402,6 +1402,7 @@ static void test_precopy_unix_dirty_ring(void) } =20 #ifdef CONFIG_GNUTLS +#ifndef _WIN32 static void test_precopy_unix_tls_psk(void) { g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); @@ -1414,6 +1415,7 @@ static void test_precopy_unix_tls_psk(void) =20 test_precopy_common(&args); } +#endif /* _WIN32 */ =20 #ifdef CONFIG_TASN1 static void test_precopy_unix_tls_x509_default_host(void) @@ -1522,6 +1524,7 @@ static void test_precopy_tcp_plain(void) } =20 #ifdef CONFIG_GNUTLS +#ifndef _WIN32 static void test_precopy_tcp_tls_psk_match(void) { MigrateCommon args =3D { @@ -1532,6 +1535,7 @@ static void test_precopy_tcp_tls_psk_match(void) =20 test_precopy_common(&args); } +#endif /* _WIN32 */ =20 static void test_precopy_tcp_tls_psk_mismatch(void) { @@ -1929,6 +1933,7 @@ static void test_multifd_tcp_zstd(void) #endif =20 #ifdef CONFIG_GNUTLS +#ifndef _WIN32 static void * test_migrate_multifd_tcp_tls_psk_start_match(QTestState *from, QTestState *to) @@ -1936,6 +1941,7 @@ test_migrate_multifd_tcp_tls_psk_start_match(QTestSta= te *from, test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); return test_migrate_tls_psk_start_match(from, to); } +#endif /* _WIN32 */ =20 static void * test_migrate_multifd_tcp_tls_psk_start_mismatch(QTestState *from, @@ -1987,6 +1993,7 @@ test_migrate_multifd_tls_x509_start_reject_anon_clien= t(QTestState *from, } #endif /* CONFIG_TASN1 */ =20 +#ifndef _WIN32 static void test_multifd_tcp_tls_psk_match(void) { MigrateCommon args =3D { @@ -1996,6 +2003,7 @@ static void test_multifd_tcp_tls_psk_match(void) }; test_precopy_common(&args); } +#endif /* _WIN32 */ =20 static void test_multifd_tcp_tls_psk_mismatch(void) { @@ -2492,8 +2500,10 @@ int main(int argc, char **argv) qtest_add_func("/migration/precopy/unix/plain", test_precopy_unix_plai= n); qtest_add_func("/migration/precopy/unix/xbzrle", test_precopy_unix_xbz= rle); #ifdef CONFIG_GNUTLS +#ifndef _WIN32 qtest_add_func("/migration/precopy/unix/tls/psk", test_precopy_unix_tls_psk); +#endif =20 if (has_uffd) { /* @@ -2519,8 +2529,10 @@ int main(int argc, char **argv) =20 qtest_add_func("/migration/precopy/tcp/plain", test_precopy_tcp_plain); #ifdef CONFIG_GNUTLS +#ifndef _WIN32 qtest_add_func("/migration/precopy/tcp/tls/psk/match", test_precopy_tcp_tls_psk_match); +#endif qtest_add_func("/migration/precopy/tcp/tls/psk/mismatch", test_precopy_tcp_tls_psk_mismatch); #ifdef CONFIG_TASN1 @@ -2564,8 +2576,10 @@ int main(int argc, char **argv) test_multifd_tcp_zstd); #endif #ifdef CONFIG_GNUTLS +#ifndef _WIN32 qtest_add_func("/migration/multifd/tcp/tls/psk/match", test_multifd_tcp_tls_psk_match); +#endif qtest_add_func("/migration/multifd/tcp/tls/psk/mismatch", test_multifd_tcp_tls_psk_mismatch); #ifdef CONFIG_TASN1 --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664353311; cv=none; d=zohomail.com; s=zohoarc; b=cjD2P7H2Ev2Cl+OTEHP37KV1Ix2yJ2aZ32Ek7wG+EfN3hqyTdCArqJ9m+1EYmPKc+ZMkoYdYx2ayAH6onA6Xrq4fKjNeHBA1pdRdyq1sZPVFua+H2eMGu/Xec/bRFAvMXgxkDB/c9GqFraDms4UgPYLCnubSONGzRvnEyPqk0EY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664353311; 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=1qXEcD/SBKEsuw/jUzKcn9WAGw4NyQ3oIjID60bGZ+8=; b=VuloS8r+pBt5rTDtr5SEuxLjzROa/9FcvWL8WFcxJZv44KnWqgjLGZb3wPZZgjZi4A0tfW1s3KJK2ZfsJmOkuvkG39QMarqODQ46kE7UAo20kdG/OtznDcETuyi8gpF2g1yVhtrNowolHJkhNkBRTLufuj30f9ikoOu8hM2SuFA= 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 1664353311369235.53163088389022; Wed, 28 Sep 2022 01:21:51 -0700 (PDT) Received: from localhost ([::1]:38118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odSKE-00026D-89 for importer@patchew.org; Wed, 28 Sep 2022 04:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMA-000194-Uq for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:31762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRM9-00006Z-Gi for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:46 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-367-qTW14VzPMB-u2DsRt_MU7A-1; Wed, 28 Sep 2022 03:19:42 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C7F31185A794; Wed, 28 Sep 2022 07:19:41 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE7FE40C83BB; Wed, 28 Sep 2022 07:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349583; 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=1qXEcD/SBKEsuw/jUzKcn9WAGw4NyQ3oIjID60bGZ+8=; b=Zn6N9PLJTPKlOPbACT5ieSWMBpJjKGL40I6qxHwzDvxy4WtlODs5lQFlWVkvc7cD3l3utL TDvur9ZkPua3wA015LQPuW2cFjEjJOPanTQ6Nari1cPBWlCg44D+YezvyV2YUb2vKGk00I 961Yss6WfQBK56Jrg/KJK8srbuz+2Lw= X-MC-Unique: qTW14VzPMB-u2DsRt_MU7A-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 30/37] .gitlab-ci.d/windows.yml: Display meson test logs Date: Wed, 28 Sep 2022 09:18:36 +0200 Message-Id: <20220928071843.1468323-31-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664353312821100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng When CI fails we don't know what causes the failure. Displaying the meson test logs can be helpful. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth Message-Id: <20220925113032.1949844-53-bmeng.cn@gmail.com> Signed-off-by: Thomas Huth --- .gitlab-ci.d/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml index 86a4339c48..ba59844d12 100644 --- a/.gitlab-ci.d/windows.yml +++ b/.gitlab-ci.d/windows.yml @@ -61,7 +61,7 @@ msys2-64bit: - .\msys64\usr\bin\bash -lc './configure --target-list=3Dx86_64-softmmu --enable-capstone --without-default-devices' - .\msys64\usr\bin\bash -lc 'make' - - .\msys64\usr\bin\bash -lc 'make check' + - .\msys64\usr\bin\bash -lc 'make check || { cat build/meson-logs/testlo= g.txt; exit 1; } ;' =20 msys2-32bit: extends: .shared_msys2_builder @@ -94,4 +94,4 @@ msys2-32bit: - cd output - ..\msys64\usr\bin\bash -lc "../configure --target-list=3Dppc64-softmmu" - ..\msys64\usr\bin\bash -lc 'make' - - ..\msys64\usr\bin\bash -lc 'make check' + - ..\msys64\usr\bin\bash -lc 'make check || { cat meson-logs/testlog.txt= ; exit 1; } ;' --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664356588; cv=none; d=zohomail.com; s=zohoarc; b=O81daqjj8ZVqmp/ZVI88aey4Hh8Yygpmhqg3ndWaC3Bjf7fyxkh5AuRQRv9Mbk7V5EmwPrYheqE2kA1JlqvgvrX8JxV15kZBVoBKfq/AvFK4FBaplz2cVYm58GecBN0BgwLzPuJwC1S3huTTJrdL75NPGtQQzQpapxaqhGgv1Kg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664356588; 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=8AxJNbrXnXM74YtdDwjHtrcpQnMCAsAxLyt81poLNuY=; b=BZYWsPOksMvKZGYEzt50FkbVUQymnBf8hENG34voauHj/Za24yttgtKMhSOTP6xYkUmEWFzii+bELwzjWAH2x0BurgAGkpHYMTWL0F5SO5vzEwETEqS8n8Yt6psOl7pwd7D9ZjRkmfI2JtnoE/8rXV/mTrl3LcLIaWAPBlJCeW8= 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 1664356588963950.5290213051586; Wed, 28 Sep 2022 02:16:28 -0700 (PDT) Received: from localhost ([::1]:47096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTB6-0007ur-00 for importer@patchew.org; Wed, 28 Sep 2022 05:16:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRME-0001B5-Js for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMB-00007L-Fg for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-82-EWKPv9FzOHu8VfGKMXVKUQ-1; Wed, 28 Sep 2022 03:19:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A42B857FAB; Wed, 28 Sep 2022 07:19:43 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21E3340C83BB; Wed, 28 Sep 2022 07:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349586; 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=8AxJNbrXnXM74YtdDwjHtrcpQnMCAsAxLyt81poLNuY=; b=F+Re9L3/mYHFCWIn1vdkRd6ge5dBNo758hsnSbOLF6J4zV/0ZJ0DaygkMj8cFfvVxVrVvL VXianItJ8wxgxAWyJJ8RO7VoiMVkmWFXkf9TDlBfXIMlA7mU1qMfrqHYi3zJaEZzon7RVJ VBIaYmAslRUU8lILpqrtgdwlWJvInJw= X-MC-Unique: EWKPv9FzOHu8VfGKMXVKUQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Michael Labiuk Subject: [PULL 31/37] tests/x86: Move common code to function in device-plug-test Date: Wed, 28 Sep 2022 09:18:37 +0200 Message-Id: <20220928071843.1468323-32-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664356590928100001 Content-Type: text/plain; charset="utf-8" From: Michael Labiuk Move common code for device removing to function. Signed-off-by: Michael Labiuk Message-Id: <20220920104842.605530-2-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/device-plug-test.c | 42 ++++++++++++++-------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c index a1fb99c8ff..e595b45b66 100644 --- a/tests/qtest/device-plug-test.c +++ b/tests/qtest/device-plug-test.c @@ -61,6 +61,18 @@ static void wait_device_deleted_event(QTestState *qtest,= const char *id) } } =20 +static void process_device_remove(QTestState *qtest, const char *id) +{ + /* + * Request device removal. As the guest is not running, the request wo= n't + * be processed. However during system reset, the removal will be + * handled, removing the device. + */ + device_del(qtest, id); + system_reset(qtest); + wait_device_deleted_event(qtest, id); +} + static void test_pci_unplug_request(void) { const char *arch =3D qtest_get_arch(); @@ -73,14 +85,7 @@ static void test_pci_unplug_request(void) QTestState *qtest =3D qtest_initf("%s -device virtio-mouse-pci,id=3Dde= v0", machine_addition); =20 - /* - * Request device removal. As the guest is not running, the request wo= n't - * be processed. However during system reset, the removal will be - * handled, removing the device. - */ - device_del(qtest, "dev0"); - system_reset(qtest); - wait_device_deleted_event(qtest, "dev0"); + process_device_remove(qtest, "dev0"); =20 qtest_quit(qtest); } @@ -98,14 +103,7 @@ static void test_pci_unplug_json_request(void) "%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"", machine_addition); =20 - /* - * Request device removal. As the guest is not running, the request wo= n't - * be processed. However during system reset, the removal will be - * handled, removing the device. - */ - device_del(qtest, "dev0"); - system_reset(qtest); - wait_device_deleted_event(qtest, "dev0"); + process_device_remove(qtest, "dev0"); =20 qtest_quit(qtest); } @@ -128,9 +126,7 @@ static void test_spapr_cpu_unplug_request(void) "-device power9_v2.0-spapr-cpu-core,core-id=3D1,id= =3Ddev0"); =20 /* similar to test_pci_unplug_request */ - device_del(qtest, "dev0"); - system_reset(qtest); - wait_device_deleted_event(qtest, "dev0"); + process_device_remove(qtest, "dev0"); =20 qtest_quit(qtest); } @@ -144,9 +140,7 @@ static void test_spapr_memory_unplug_request(void) "-device pc-dimm,id=3Ddev0,memdev=3Dmem0"); =20 /* similar to test_pci_unplug_request */ - device_del(qtest, "dev0"); - system_reset(qtest); - wait_device_deleted_event(qtest, "dev0"); + process_device_remove(qtest, "dev0"); =20 qtest_quit(qtest); } @@ -158,9 +152,7 @@ static void test_spapr_phb_unplug_request(void) qtest =3D qtest_initf("-device spapr-pci-host-bridge,index=3D1,id=3Dde= v0"); =20 /* similar to test_pci_unplug_request */ - device_del(qtest, "dev0"); - system_reset(qtest); - wait_device_deleted_event(qtest, "dev0"); + process_device_remove(qtest, "dev0"); =20 qtest_quit(qtest); } --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664356603; cv=none; d=zohomail.com; s=zohoarc; b=liypUToua5sV4YnzzRyRX2yQ4Djzdy29glDYe8A00kiShK51eUsqA4J+eifzIimolz6HItM34dnXBg5zKIbBj8d0LdZjVNRNQcWXGxn61OI8ZJ0Pp57OTjYGtHHQMiQltYXLLNd23/4bd0JLDZHnG9qQu6DRphrXwVj77vieffk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664356603; 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=C766JYsfMX7Nzr3hwAlukL4TK2ArgI7v4YmcFnFKGOA=; b=cJTJbqfAQ14QYbqvQqP6ttNj7nXH3917PVO88g3/2jV3q6/hmoQyCwvKD3jeUo8TGZhEnr7C5wc0VsUVaqEtZDL7EuG1zxHfuIzgVXbz/+mTQ+JD+6sa4spbX+RJZdbCXZ8vXR9/g7XcWflu21j5yiDwpSqclx8Z/id7wmF5dQ8= 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 1664356603759539.7592686926997; Wed, 28 Sep 2022 02:16:43 -0700 (PDT) Received: from localhost ([::1]:39922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTBK-0008J7-Ly for importer@patchew.org; Wed, 28 Sep 2022 05:16:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44756) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRME-0001Av-IY for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMB-00007D-Fb for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:48 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-511-trs4QZTSMl64dZVfFx9llQ-1; Wed, 28 Sep 2022 03:19:44 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49101185A79C; Wed, 28 Sep 2022 07:19:44 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64F7D40C83BB; Wed, 28 Sep 2022 07:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349586; 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=C766JYsfMX7Nzr3hwAlukL4TK2ArgI7v4YmcFnFKGOA=; b=RAR/6G+oEKrVkuVg8E+9+Z67EyUZFiGAhFTbJuCcqIEsSEeD4qvF6aWLu7K6Bx4tswl0E5 o5ZokcqspkDiQz/RO1R1IwZT/k4eYT/B1clB5ONRtAYvZzmO2Gu58/UFPsr/8izlrHCBDl 2mLcxI3QY+DzFlZ85hcsU1CaVoIwyRE= X-MC-Unique: trs4QZTSMl64dZVfFx9llQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng Subject: [PULL 32/37] tests/qtest: hd-geo-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:38 +0200 Message-Id: <20220928071843.1468323-33-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664356604903100001 Content-Type: text/plain; charset="utf-8" From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Message-Id: <20220927110632.1973965-13-bmeng.cn@gmail.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- tests/qtest/hd-geo-test.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c index 413cf964c0..ba772f4d7a 100644 --- a/tests/qtest/hd-geo-test.c +++ b/tests/qtest/hd-geo-test.c @@ -27,16 +27,16 @@ =20 static char *create_test_img(int secs) { - char *template =3D strdup("/tmp/qtest.XXXXXX"); + char *template; int fd, ret; =20 - fd =3D mkstemp(template); + fd =3D g_file_open_tmp("qtest.XXXXXX", &template, NULL); g_assert(fd >=3D 0); ret =3D ftruncate(fd, (off_t)secs * 512); close(fd); =20 if (ret) { - free(template); + g_free(template); template =3D NULL; } =20 @@ -422,9 +422,8 @@ static MBRpartitions empty_mbr =3D { {false, 0, 0, 0, 0= , 0, 0, 0, 0}, =20 static char *create_qcow2_with_mbr(MBRpartitions mbr, uint64_t sectors) { - const char *template =3D "/tmp/qtest.XXXXXX"; - char *raw_path =3D strdup(template); - char *qcow2_path =3D strdup(template); + g_autofree char *raw_path =3D NULL; + char *qcow2_path; char cmd[100 + 2 * PATH_MAX]; uint8_t buf[512] =3D {}; int i, ret, fd, offset; @@ -468,7 +467,7 @@ static char *create_qcow2_with_mbr(MBRpartitions mbr, u= int64_t sectors) offset +=3D 0x10; } =20 - fd =3D mkstemp(raw_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &raw_path, NULL); g_assert(fd >=3D 0); close(fd); =20 @@ -478,7 +477,7 @@ static char *create_qcow2_with_mbr(MBRpartitions mbr, u= int64_t sectors) g_assert(ret =3D=3D sizeof(buf)); close(fd); =20 - fd =3D mkstemp(qcow2_path); + fd =3D g_file_open_tmp("qtest.XXXXXX", &qcow2_path, NULL); g_assert(fd >=3D 0); close(fd); =20 @@ -506,7 +505,6 @@ static char *create_qcow2_with_mbr(MBRpartitions mbr, u= int64_t sectors) free(qemu_img_abs_path); =20 unlink(raw_path); - free(raw_path); =20 return qcow2_path; } @@ -714,7 +712,7 @@ static void test_override(TestArgs *args, CHSResult exp= ected[]) =20 for (i =3D 0; i < args->n_drives; i++) { unlink(args->drives[i]); - free(args->drives[i]); + g_free(args->drives[i]); } g_free(args->drives); g_strfreev(args->argv); @@ -867,7 +865,7 @@ static void test_override_scsi_hot_unplug(void) =20 for (i =3D 0; i < args->n_drives; i++) { unlink(args->drives[i]); - free(args->drives[i]); + g_free(args->drives[i]); } g_free(args->drives); g_strfreev(args->argv); @@ -927,7 +925,7 @@ static void test_override_virtio_hot_unplug(void) =20 for (i =3D 0; i < args->n_drives; i++) { unlink(args->drives[i]); - free(args->drives[i]); + g_free(args->drives[i]); } g_free(args->drives); g_strfreev(args->argv); @@ -987,7 +985,7 @@ test_add_done: for (i =3D 0; i < backend_last; i++) { if (img_file_name[i]) { unlink(img_file_name[i]); - free(img_file_name[i]); + g_free(img_file_name[i]); } } =20 --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664357537; cv=none; d=zohomail.com; s=zohoarc; b=N8jIF+YHOm15p9kXWT3+W9c06VhDPb2SZHrIQLbKJKfdvYq+yttgypEfcoMaYKTCgtUrYziDrvjmLgv15KZjnZHH0ACimADSWUqb6d0G8YwvRhQKHSdiwwO2GENN+ZfyTsQXo1anU9l0t/KhrcwPzt1PNwV7ayEmIGuHk8MD0hc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664357537; h=Content-Type: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=x9a/iLkvV9nX/Z9hqOhap4cH95/5W49ebk7XBIO4w1A=; b=DQF1B8iMVGiCX30CZ6EF3rZlTAVlsuWhenh0cYqqB3pVfodzNR5OR+Wvs/YwxhLB/8WrHrgxsGXF26svP3rTLsTKXvantME6xNPjFucY9PzMhFXvoA5wM6+5/H3yTS8NDmEIYIyfdX/HAEBvl5BPf0A0HtZ8uUifu/M4AcHtGAg= 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 1664357537469661.0856688745629; Wed, 28 Sep 2022 02:32:17 -0700 (PDT) Received: from localhost ([::1]:51170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTQO-00044a-DJ for importer@patchew.org; Wed, 28 Sep 2022 05:32:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMF-0001Bz-RT for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRME-00007a-5V for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:51 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-161-sXvwVTk-NQKz_Kzk6VMZgw-1; Wed, 28 Sep 2022 03:19:46 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A311882820; Wed, 28 Sep 2022 07:19:46 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03BDE40C83BB; Wed, 28 Sep 2022 07:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349588; 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=x9a/iLkvV9nX/Z9hqOhap4cH95/5W49ebk7XBIO4w1A=; b=EzT/OBPKWyXdTRAtc7gmzbQMCHCjkoXwc0HjP+dUeEM4hkKR6WUwAjak4BiYRo5B7Wxwup rBgNe0uTpbv5KoacQMouo61e9+7bJSHzISYLI3d88wbR29XXWl8jcXx9SbnWhifmKzY9Fw nu/+7EwuCLJ9tC49Coo1yhvf9hyCkyU= X-MC-Unique: sXvwVTk-NQKz_Kzk6VMZgw-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 33/37] tests/qtest: pflash-cfi02-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:39 +0200 Message-Id: <20220928071843.1468323-34-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664357538406100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng Message-Id: <20220927110632.1973965-16-bmeng.cn@gmail.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- tests/qtest/pflash-cfi02-test.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/qtest/pflash-cfi02-test.c b/tests/qtest/pflash-cfi02-tes= t.c index 7fce614b64..0b52c2ca5c 100644 --- a/tests/qtest/pflash-cfi02-test.c +++ b/tests/qtest/pflash-cfi02-test.c @@ -56,7 +56,7 @@ typedef struct { QTestState *qtest; } FlashConfig; =20 -static char image_path[] =3D "/tmp/qtest.XXXXXX"; +static char *image_path; =20 /* * The pflash implementation allows some parameters to be unspecified. We = want @@ -608,6 +608,7 @@ static void test_cfi_in_autoselect(const void *opaque) static void cleanup(void *opaque) { unlink(image_path); + g_free(image_path); } =20 /* @@ -635,16 +636,14 @@ static const FlashConfig configuration[] =3D { =20 int main(int argc, char **argv) { - int fd =3D mkstemp(image_path); - if (fd =3D=3D -1) { - g_printerr("Failed to create temporary file %s: %s\n", image_path, - strerror(errno)); - exit(EXIT_FAILURE); - } + GError *err =3D NULL; + int fd =3D g_file_open_tmp("qtest.XXXXXX", &image_path, &err); + g_assert_no_error(err); + if (ftruncate(fd, UNIFORM_FLASH_SIZE) < 0) { int error_code =3D errno; close(fd); - unlink(image_path); + cleanup(NULL); g_printerr("Failed to truncate file %s to %u MB: %s\n", image_path, UNIFORM_FLASH_SIZE, strerror(error_code)); exit(EXIT_FAILURE); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664357189; cv=none; d=zohomail.com; s=zohoarc; b=NcUizKzbB//+qIvu3eOZuI/Jxr8IaemCbZd4C61XPDWLVHqR9e3JTYXK06BBip9JU+AFkw1i0szc8tCAjFpUA3qe1UdxlGXK6/tqvuiWzKdAxFwUTbWssFNWHlGva8yj/xsi+gCg1A48A+7HYBgtNomNjbEcaawSSesjbvF1fa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664357189; h=Content-Type: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=IkPb1wyoRfWJVk/j9+EPkP7duMGO4u4DTcVAUzqzg+Y=; b=ONZF/6hpPgY5y/fvNsdEaqE/gTcRURpOCKsRrRCNfWQoRcea80FtUiGb2FNidpiYWq2WoE3u2Z+Y0SPZc30D0usrQLw/nU+doGQpohqy4BafWmVL3XNh53JFMaK+sUMDXP6Vpz25RVZZFFn1Y3bfmi+85AeFaTmSosN1U93DBI0= 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 1664357189972408.10333907716574; Wed, 28 Sep 2022 02:26:29 -0700 (PDT) Received: from localhost ([::1]:39410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTKm-0006Z4-P8 for importer@patchew.org; Wed, 28 Sep 2022 05:26:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMF-0001By-On for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRME-00008q-6f for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:51 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-103-poBs2slVPj2q_4rcxveRig-1; Wed, 28 Sep 2022 03:19:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A8E0E882820; Wed, 28 Sep 2022 07:19:47 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94D1440C83BB; Wed, 28 Sep 2022 07:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349589; 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=IkPb1wyoRfWJVk/j9+EPkP7duMGO4u4DTcVAUzqzg+Y=; b=DHQOwvaloiqihCWJe6Mf1BSL+Aa6FM7A9n3b/NsbpUPAUtOh5O7BebHGuuJyUixm1xjfJN YjlL8YeyRu7bFhEdruyN93dDvS0qxH+lqFh28q7yxsZ7sjBXdqTTOamcuCEXhQF5zlJhqN QWbj5QrnGY1bN6FyC2SLbXY8urqmlus= X-MC-Unique: poBs2slVPj2q_4rcxveRig-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 34/37] tests/qtest: qmp-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:40 +0200 Message-Id: <20220928071843.1468323-35-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664357191657100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng Message-Id: <20220927110632.1973965-17-bmeng.cn@gmail.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- tests/qtest/qmp-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c index 23b2a37942..22957fa49c 100644 --- a/tests/qtest/qmp-test.c +++ b/tests/qtest/qmp-test.c @@ -163,14 +163,15 @@ static void test_qmp_protocol(void) =20 /* Out-of-band tests */ =20 -char tmpdir[] =3D "/tmp/qmp-test-XXXXXX"; +char *tmpdir; char *fifo_name; =20 static void setup_blocking_cmd(void) { - if (!g_mkdtemp(tmpdir)) { - g_error("g_mkdtemp: %s", strerror(errno)); - } + GError *err =3D NULL; + tmpdir =3D g_dir_make_tmp("qmp-test-XXXXXX", &err); + g_assert_no_error(err); + fifo_name =3D g_strdup_printf("%s/fifo", tmpdir); if (mkfifo(fifo_name, 0666)) { g_error("mkfifo: %s", strerror(errno)); @@ -181,6 +182,7 @@ static void cleanup_blocking_cmd(void) { unlink(fifo_name); rmdir(tmpdir); + g_free(tmpdir); } =20 static void send_cmd_that_blocks(QTestState *s, const char *id) --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664359179; cv=none; d=zohomail.com; s=zohoarc; b=E2vx95z0sm++0HGOBc+M01nFbBBvlma3xHYkkM2WjR5ObA2pKKioKEgBPF9ZgJhGVjwVfSyecPdB3uVqtCtJC8keOPuikmx5GpXB86LECSP93pVFvp8LDwSC3VCLI/mWAh5H/GWIbtsxZdCBNWXHRqZQSywk/6EATrLNOvV/c8s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664359179; h=Content-Type: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=+GVsz4o/JuBb4gzbbJxB/v0brom9e0El5e5/9SiPkBE=; b=NomQ02jU8HbAT7pvojYHeF8KDdKIruOArcp62XFq9GmGDasXJpioAO/vPLf7Bsixj/YNR73KRu+8B7nqCwBVXbiY+hD6NgBmF4vDKuanbwSTpa2zIkYJGIgVHR9jI+pkDpaZTGbHVQOSnzkDzfPJFUaWvjLAV1dP0Rgt+lgiKl8= 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 1664359179069469.9319330909584; Wed, 28 Sep 2022 02:59:39 -0700 (PDT) Received: from localhost ([::1]:51464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTqr-0004c3-VQ for importer@patchew.org; Wed, 28 Sep 2022 05:59:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMI-0001D5-FI for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMG-00009T-U4 for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-350-cvlKrjxPMOqPs573w3Tv0A-1; Wed, 28 Sep 2022 03:19:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52D3A857FB0; Wed, 28 Sep 2022 07:19:49 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BA6240C83BB; Wed, 28 Sep 2022 07:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349592; 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=+GVsz4o/JuBb4gzbbJxB/v0brom9e0El5e5/9SiPkBE=; b=cUxxz+cS5ruB8ktPVt5SJF5v2WLNwQW0VQtbr5vY6pAV8Tcgi/dDAkEd0Jew9Q/TGAxfow V5nsVMDKfQnz605LI+HtOAMWVNnWdxR6Ud37PkKKw/jc381CKLX3917lnChpMdyecnv4yj gv8EHUwCVGkGC6WU8Ko5McIp0HKqzGY= X-MC-Unique: cvlKrjxPMOqPs573w3Tv0A-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 35/37] tests/qtest: vhost-user-test: Avoid using hardcoded /tmp Date: Wed, 28 Sep 2022 09:18:41 +0200 Message-Id: <20220928071843.1468323-36-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664359180011100001 From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng Message-Id: <20220927110632.1973965-19-bmeng.cn@gmail.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- tests/qtest/vhost-user-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index d7d6cfc9bd..84498941a6 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -482,8 +482,8 @@ static TestServer *test_server_new(const gchar *name, struct vhost_user_ops *ops) { TestServer *server =3D g_new0(TestServer, 1); - char template[] =3D "/tmp/vhost-test-XXXXXX"; - const char *tmpfs; + g_autofree const char *tmpfs =3D NULL; + GError *err =3D NULL; =20 server->context =3D g_main_context_new(); server->loop =3D g_main_loop_new(server->context, FALSE); @@ -491,9 +491,11 @@ static TestServer *test_server_new(const gchar *name, /* run the main loop thread so the chardev may operate */ server->thread =3D g_thread_new(NULL, thread_function, server->loop); =20 - tmpfs =3D g_mkdtemp(template); + tmpfs =3D g_dir_make_tmp("vhost-test-XXXXXX", &err); if (!tmpfs) { - g_test_message("g_mkdtemp on path (%s): %s", template, strerror(er= rno)); + g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs, + err->message); + g_error_free(err); } g_assert(tmpfs); =20 --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664358811; cv=none; d=zohomail.com; s=zohoarc; b=YULuuQL7ziiZkyse5n8FfVxPqMQVhgPMW4nhDKFyurZjEv0phMWpd41UezhokdUqzPm7GUc20yrVWx5vTuYUuqEVxIJBAFddvz45lsuMQMZlEUH1VBBHRaK61eSTaa4sUk2XW+o2Xl2NS2l8GPDVz687eWS3HOslZjEanosSUng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664358811; h=Content-Type: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=B+IC1umu97akBFliso5U2R0JE92XccKU7LWEx4ShM7M=; b=AipFNLxr36m4H0E8KnwD2CfuYbw6x27Te0Gkp8klR0qZDTjp7cIZSKo2+YH9A7Njfh1OkXm/CV0R7HnMsY3cm6NbYsRqsUnR1ow++74Yy75mbyHSsfQrP3lGV1w2NxBqIToY2f8ox/j2sXi80iA3eg4vCU3HMhTKvHW6JvKJbHQ= 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 1664358811759316.20342877690575; Wed, 28 Sep 2022 02:53:31 -0700 (PDT) Received: from localhost ([::1]:52348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTkw-0008HL-Hi for importer@patchew.org; Wed, 28 Sep 2022 05:53:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMN-0001EM-Ga for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRML-0000A0-KR for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:59 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-204-ZqrNtnSGNRSVAfKPDrJiZQ-1; Wed, 28 Sep 2022 03:19:51 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0A897185A7A3; Wed, 28 Sep 2022 07:19:51 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id E791240C83BB; Wed, 28 Sep 2022 07:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349597; 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=B+IC1umu97akBFliso5U2R0JE92XccKU7LWEx4ShM7M=; b=cUxNJ45se8Ivfe+Y0kVLwNdp9E0kRcs9fEhxw9AC+Xxj+06DniOmUExD66pynLuRYaJiBc im5IUl1ja5gMttVUrGV448n3t4Z5fNA9Fw5C1rldpvW/XD2v9ZzfMJ3AkIxf8c0KrJ0PzN +ZVnUWTsumq2t+qkJaw6aHi/zZRdvfI= X-MC-Unique: ZqrNtnSGNRSVAfKPDrJiZQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 36/37] tests/qtest: boot-serial-test: Close the serial file before starting QEMU Date: Wed, 28 Sep 2022 09:18:42 +0200 Message-Id: <20220928071843.1468323-37-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664358813832100001 From: Bin Meng This qtest executable created a serial chardev file to be passed to the QEMU executable. The serial file was created by g_file_open_tmp(), which internally opens the file with FILE_SHARE_WRITE security attribute on Windows. Based on [1], there is only one case that allows the first call to CreateFile() with GENERIC_READ & FILE_SHARE_WRITE, and second call to CreateFile() with GENERIC_WRITE & FILE_SHARE_READ. All other combinations require FILE_SHARE_WRITE in the second call. But there is no way for the second call (in this case the QEMU executable) to know what combination was passed to the first call, unless FILE_SHARE_WRITE is passed to the second call. Two processes shouldn't share the same file for writing with a chardev. Let's close the serial file before starting QEMU. [1] https://docs.microsoft.com/en-us/windows/win32/fileio/creating-and-open= ing-files Signed-off-by: Bin Meng Message-Id: <20220927110632.1973965-40-bmeng.cn@gmail.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Thomas Huth --- tests/qtest/boot-serial-test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c index 72310ba30e..b216519b62 100644 --- a/tests/qtest/boot-serial-test.c +++ b/tests/qtest/boot-serial-test.c @@ -233,6 +233,7 @@ static void test_machine(const void *data) =20 ser_fd =3D g_file_open_tmp("qtest-boot-serial-sXXXXXX", &serialtmp, NU= LL); g_assert(ser_fd !=3D -1); + close(ser_fd); =20 if (test->kernel) { code =3D test->kernel; @@ -266,6 +267,8 @@ static void test_machine(const void *data) unlink(codetmp); } =20 + ser_fd =3D open(serialtmp, O_RDONLY); + g_assert(ser_fd !=3D -1); if (!check_guest_output(qts, test, ser_fd)) { g_error("Failed to find expected string. Please check '%s'", serialtmp); --=20 2.31.1 From nobody Mon May 20 16:07:49 2024 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=1664358188; cv=none; d=zohomail.com; s=zohoarc; b=DF+mC6TnIfi4iHA8i6jYkAROGoQZ6+L4/e9fq9uOG4oLCyNr7Eyip9aQM9LpkP4lCUw/6jfH8Q1SSVnu7PL++iTKYDPGg5Mm1iXTO5UueLORoqO3el70wkpJG7HZN+K57lvdT4Bshk6Y6I3Vcdt8vWwO6+tsH5dULR3+e47G1PE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664358188; h=Content-Type: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=Hra87o8UVtUzNTwCxIUYrCnAaY3HBPraaZ79GxQLksQ=; b=j3yYWKVTUVfSShu0tSNKRYC/UapH/BCy8ttHqWOdInhvGW4ZYybTkBtYdOto/KTMCnRNpMnKU9A+q7K96ChscDEsOLWv/7ZVf2tsR9saIKf4ZY9Jywwp5zRtbjT3+ba5ZYplNEo6l6ArfWzvg/Ru4vPHO3IBQQOjT1t8Z2B5lxg= 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 1664358188171883.3803562498584; Wed, 28 Sep 2022 02:43:08 -0700 (PDT) Received: from localhost ([::1]:50848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odTas-00029a-J5 for importer@patchew.org; Wed, 28 Sep 2022 05:43:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMM-0001EK-Ig for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odRMK-00009u-SD for qemu-devel@nongnu.org; Wed, 28 Sep 2022 03:19:58 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-TySussQ1MRumGaL5z-6HcA-1; Wed, 28 Sep 2022 03:19:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 43770811E87; Wed, 28 Sep 2022 07:19:52 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EDD440C83BB; Wed, 28 Sep 2022 07:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664349596; 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=Hra87o8UVtUzNTwCxIUYrCnAaY3HBPraaZ79GxQLksQ=; b=R+xNVcCuf7wcbEHSkeq6KR2PoUSg6rWG1mrFV3ZT8TB+W622ivYrLs5Roc0/2G6v9Ye/A2 Ho3TiI7Ik2KwGNJ5AqMuAAdbEwh+6/E6iGK8aGup8lMrF/l2CKM5jm0lZV2B2lREcVGAdr aKI8QwS6WAd5oiNH7twSBjsknrpTVac= X-MC-Unique: TySussQ1MRumGaL5z-6HcA-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Bin Meng , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 37/37] docs/devel: testing: Document writing portable test cases Date: Wed, 28 Sep 2022 09:18:43 +0200 Message-Id: <20220928071843.1468323-38-thuth@redhat.com> In-Reply-To: <20220928071843.1468323-1-thuth@redhat.com> References: <20220928071843.1468323-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: -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 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: 1664358190544100001 From: Bin Meng Update the best practices of how to write portable test cases that can be built and run successfully on both Linux and Windows hosts. Signed-off-by: Bin Meng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20220927110632.1973965-55-bmeng.cn@gmail.com> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- docs/devel/testing.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index aea5b42356..fbb98faabe 100644 --- a/docs/devel/testing.rst +++ b/docs/devel/testing.rst @@ -81,6 +81,36 @@ QTest cases can be executed with =20 make check-qtest =20 +Writing portable test cases +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Both unit tests and qtests can run on POSIX hosts as well as Windows hosts. +Care must be taken when writing portable test cases that can be built and = run +successfully on various hosts. The following list shows some best practice= s: + +* Use portable APIs from glib whenever necessary, e.g.: g_setenv(), + g_mkdtemp(), g_mkdir(). +* Avoid using hardcoded /tmp for temporary file directory. + Use g_get_tmp_dir() instead. +* Bear in mind that Windows has different special string representation for + stdin/stdout/stderr and null devices. For example if your test case uses + "/dev/fd/2" and "/dev/null" on Linux, remember to use "2" and "nul" on + Windows instead. Also IO redirection does not work on Windows, so avoid + using "2>nul" whenever necessary. +* If your test cases uses the blkdebug feature, use relative path to pass + the config and image file paths in the command line as Windows absolute + path contains the delimiter ":" which will confuse the blkdebug parser. +* Use double quotes in your extra QEMU commmand line in your test cases + instead of single quotes, as Windows does not drop single quotes when + passing the command line to QEMU. +* Windows opens a file in text mode by default, while a POSIX compliant + implementation treats text files and binary files the same. So if your + test cases opens a file to write some data and later wants to compare the + written data with the original one, be sure to pass the letter 'b' as + part of the mode string to fopen(), or O_BINARY flag for the open() call. +* If a certain test case can only run on POSIX or Linux hosts, use a proper + #ifdef in the codes. If the whole test suite cannot run on Windows, disa= ble + the build in the meson.build file. + QAPI schema tests ~~~~~~~~~~~~~~~~~ =20 --=20 2.31.1