From nobody Tue Mar 3 04:52:42 2026 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1771536788; cv=none; d=zohomail.com; s=zohoarc; b=QFCWCctvdIhTRoKqYInqjZaM7Qpezxb0Hl8RWtEWkhLRIGcC73GIGyKuHWP7r2bIkg8QIGnqd9bPIo8NTtHW4bEJ249vhXZAl7l4tyymQ11MFOc7KxSMUB7qYEhF5nrQLQiER7GWcyF7W0kEGftGAT6U5tEepLrSfsyS3OEq/3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771536788; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=SHr8fokojIxV17IT1D0eCQhCuQY2oe4PYTrgkeFTq6o=; b=H3akKZbA7cW6oyFGHxx3VTFng6hKGHEueeTWVlnYcPC2Sj/bnnfharkDmiCxFpS0e4PQTyF0GBpiv7GZuN7wIqy51Bjo5/OJLvUSKzEFZZyh3kn9OZPtY3HfvWQxAWUr2mKcwELdpqZizegCtDRkdvJjm9pZQJinhW36gPFROg8= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1771536788381788.6965606402789; Thu, 19 Feb 2026 13:33:08 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id D301041908; Thu, 19 Feb 2026 16:33:07 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id AC99741A1E; Thu, 19 Feb 2026 16:31:40 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 891FA3FA64; Thu, 19 Feb 2026 16:31:33 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 105743FAD0 for ; Thu, 19 Feb 2026 16:31:33 -0500 (EST) Received: from mx-prod-mc-05.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-624-VXMV7QwYMbeJgCsInXuDvA-1; Thu, 19 Feb 2026 16:31:30 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BAAB71956094 for ; Thu, 19 Feb 2026 21:31:29 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.90.32]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 38E6E3000C26; Thu, 19 Feb 2026 21:31:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771536692; 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=SHr8fokojIxV17IT1D0eCQhCuQY2oe4PYTrgkeFTq6o=; b=i3OQhJTLbdTk2hnKoKxv78QIfLwt90328Md7o5XIe+1ztqXz7ri/bM/x/i/leCQrrB8yBK SRG1dnv/DAAZ2fAnn/VXtPRXg9UnztG5EzknO4t1InM5nel0u3QtbVHzEuPSFz7MQHNcfm /dQpXUfkMifSwQsu6NiRFNzlnQEy4L8= X-MC-Unique: VXMV7QwYMbeJgCsInXuDvA-1 X-Mimecast-MFC-AGG-ID: VXMV7QwYMbeJgCsInXuDvA_1771536689 To: devel@lists.libvirt.org Subject: [PATCH 1/3] conf: support windows paths in virDomainDiskByName() Date: Thu, 19 Feb 2026 15:31:24 -0600 Message-ID: <20260219213126.3387319-2-jjongsma@redhat.com> In-Reply-To: <20260219213126.3387319-1-jjongsma@redhat.com> References: <20260219213126.3387319-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: qbHHQpYn2JY5RDDJuKSHwSztASCsT3MkFP_uSAbu1gA_1771536689 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TVOH6KRW3AF6O2AEUDJ2JF245NWKYSP4 X-Message-ID-Hash: TVOH6KRW3AF6O2AEUDJ2JF245NWKYSP4 X-MailFrom: jjongsma@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: ehazan@redhat.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Jonathon Jongsma via Devel Reply-To: Jonathon Jongsma X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1771536789602154100 Content-Type: text/plain; charset="utf-8"; x-default="true" With the hyperv driver, disks might have windows paths like "c:\path\to\disk.vhdx". Currently, this function supports paths, but only if they're in unix format. Signed-off-by: Jonathon Jongsma --- src/conf/domain_conf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 453e301041..a77670ea8d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15459,10 +15459,12 @@ virDomainDiskIndexByName(virDomainDef *def, const= char *name, /* We prefer the name (it's shorter, required * for all disks, and should be unambiguous), but also support * (if unambiguous). Assume dst if there is - * no leading slash, source name otherwise. */ + * no leading slash (Unix path) or drive letter (Windows path like C:\= ), + * source name otherwise. */ for (i =3D 0; i < def->ndisks; i++) { vdisk =3D def->disks[i]; - if (*name !=3D '/') { + if (*name !=3D '/' && + !(g_ascii_isalpha(name[0]) && name[1] =3D=3D ':')) { if (STREQ(vdisk->dst, name)) return i; } else if (STREQ_NULLABLE(virDomainDiskGetSource(vdisk), name)) { --=20 2.53.0