From nobody Wed Dec 17 06:13:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 173885799902178.22992850970832; Thu, 6 Feb 2025 08:06:39 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 115521776; Thu, 6 Feb 2025 11:06:38 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7E92C1951; Thu, 6 Feb 2025 11:05:58 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 01C5D167A; Thu, 6 Feb 2025 11:05:54 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7A95F12C8 for ; Thu, 6 Feb 2025 11:05:53 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693--gIwbTuCNBGSP5Wn7BrZRw-1; Thu, 06 Feb 2025 11:05:50 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 127BD195609F for ; Thu, 6 Feb 2025 16:05:50 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.3]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1E303180035E for ; Thu, 6 Feb 2025 16:05:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738857953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s2Z33vnW4TMwP1oDt528+QnIhdtLPaqTRZJ/doPBNVo=; b=JLaXjdexnDgMwY4GdA4b+gxCUkvF5eWzTyS8V4pDchv1B2FfF2uO7h7Zs0Y2+/S8tMZuwi oG8IvQrrWSq2jbuP1HT9r1q14M41n09KVMmzOOXy4qYQYhMTCjP6vBZLH2MLqBHWOopb1Y tsGJrc/iv0AtQgZE4OMvV4HrBQgcHIQ= X-MC-Unique: -gIwbTuCNBGSP5Wn7BrZRw-1 X-Mimecast-MFC-AGG-ID: -gIwbTuCNBGSP5Wn7BrZRw From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 1/3] qemuxmlconftest: Allow testing of the 'writable' flag for passed FDs for disks Date: Thu, 6 Feb 2025 17:05:44 +0100 Message-ID: <76cb9caada306ae1e880039a0be087217d7f6688.1738857899.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: aKFSbswqKqtzkN0MtlJ_qGDEM8953gixjIEcuC2fNWA_1738857950 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NEGN34KO6EJQQU57YIEANHNLYSR4IX73 X-Message-ID-Hash: NEGN34KO6EJQQU57YIEANHNLYSR4IX73 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1738858001144019100 Content-Type: text/plain; charset="utf-8" Pass also the 'writable' state to the fake passed FDs so that we can test it. Signed-off-by: Peter Krempa --- tests/qemuxmlconftest.c | 6 +++--- tests/testutilsqemu.c | 2 ++ tests/testutilsqemu.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 3ddb19a7ed..99c4efc9d6 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1655,9 +1655,9 @@ mymain(void) DO_TEST_CAPS_LATEST("disk-backing-chains-noindex"); DO_TEST_CAPS_LATEST("disk-qcow2-datafile-store"); DO_TEST_CAPS_ARCH_LATEST_FULL("disk-source-fd", "x86_64", - ARG_FD_GROUP, "testgroup2", 2, 200, 205, - ARG_FD_GROUP, "testgroup5", 1, 204, - ARG_FD_GROUP, "testgroup6", 2, 247, 248); + ARG_FD_GROUP, "testgroup2", false, 2, 20= 0, 205, + ARG_FD_GROUP, "testgroup5", false, 1, 20= 4, + ARG_FD_GROUP, "testgroup6", false, 2, 24= 7, 248); DO_TEST_CAPS_LATEST("disk-slices"); DO_TEST_CAPS_LATEST("disk-rotation"); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index abc425b9b7..44011c2b36 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -704,11 +704,13 @@ testQemuInfoSetArgs(testQemuInfo *info, virStorageSourceFDTuple *new =3D virStorageSourceFDTupleNew(); const char *fdname =3D va_arg(argptr, char *); VIR_AUTOCLOSE fakefd =3D open("/dev/zero", O_RDWR); + bool writable =3D va_arg(argptr, int); size_t i; new->nfds =3D va_arg(argptr, unsigned int); new->fds =3D g_new0(int, new->nfds); new->testfds =3D g_new0(int, new->nfds); + new->writable =3D writable; for (i =3D 0; i < new->nfds; i++) { new->testfds[i] =3D va_arg(argptr, unsigned int); diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 74e307d653..20135b8390 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -49,7 +49,7 @@ typedef enum { ARG_CAPS_VER, ARG_CAPS_VARIANT, ARG_CAPS_HOST_CPU_MODEL, - ARG_FD_GROUP, /* name, nfds, fd[0], ... fd[n-1] */ + ARG_FD_GROUP, /* name, writable, nfds, fd[0], ... fd[n-1] */ ARG_VDPA_FD, /* vdpadev, fd */ ARG_NBDKIT_CAPS, ARG_END, --=20 2.48.1