From nobody Tue Mar 3 03:07:43 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 Reviewed-by: Michal Privoznik --- 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 From nobody Tue Mar 3 03:07:43 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=1771536837; cv=none; d=zohomail.com; s=zohoarc; b=LHuFKqYJngATh90ub2PpOtoaZpoN4x4JTYBK+cRz3K3NMtx61KFzh64AYI2KTvea+Ry/cYcHeeCneXe02plcsVuhGGw+W6uUADaQStyaZYxif6QmdyN5XOZdWoOLu8g5LHEI96f8gzwHUb30N+T5AAxGfc+LoI2HBIJwfpT5ofA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771536837; 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=rU/gtr5Rqx3n588RWCyB1ZrCT4cQCnzvY/eZzDfx5dU=; b=EPusqtM1z+TxUXku/jdEHBRFSzqjzCWQQ+wQ5CyVSLJKY3PkKCCp92vN5Av9Bh5YPZ4attDfQzQwjRUVlXD7c2BZadHa4LO0vJF6NaZnai2iUx5/P4gds34IACJqf8UtTUwU1YhFDFwfz0lYEoFAEMn+AEYqhnXhwY3vLv7mgAc= 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 1771536837170657.4723965480747; Thu, 19 Feb 2026 13:33:57 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 395954197E; Thu, 19 Feb 2026 16:33:56 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D863E41AC1; Thu, 19 Feb 2026 16:31:42 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id ECE743FA5C; Thu, 19 Feb 2026 16:31:34 -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 630E53F359 for ; Thu, 19 Feb 2026 16:31:34 -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-622-TAn9ETRpMMGmr-R1sgKRUw-1; Thu, 19 Feb 2026 16:31:31 -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 87AE81956095 for ; Thu, 19 Feb 2026 21:31:30 +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 05DF83000C26; 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=rU/gtr5Rqx3n588RWCyB1ZrCT4cQCnzvY/eZzDfx5dU=; b=DZlM26tr3IHors2wRTv8A0NsDWgwq8kbpA/F2r7jTgH2bjA4nALJr9mim9qRTw3mgB/bqC G2Y7LOVP64XCBR3T6Gn0gou3ImXi8DPJIzZgObtaqrhIHFe/wUm7C8dU/n1tnJAB2aRlCa 1kDUu4Yig1l5kqXStle4RtN55aZzRR8= X-MC-Unique: TAn9ETRpMMGmr-R1sgKRUw-1 X-Mimecast-MFC-AGG-ID: TAn9ETRpMMGmr-R1sgKRUw_1771536690 To: devel@lists.libvirt.org Subject: [PATCH 2/3] hyperv: Add resource subtype definitions Date: Thu, 19 Feb 2026 15:31:25 -0600 Message-ID: <20260219213126.3387319-3-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: 8QOPmN7P4nvJLEYrATzKXrBaQnMpVu1uBlpCJaTFybQ_1771536690 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7WMVHLHIE3CI6NT7QGRUKP4DM2B44KUE X-Message-ID-Hash: 7WMVHLHIE3CI6NT7QGRUKP4DM2B44KUE 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: 1771536838964158500 Content-Type: text/plain; charset="utf-8"; x-default="true" Rather than using raw strings, create definitions for each subtype string so that they can be re-used without needing to know the exact string format. Signed-off-by: Jonathon Jongsma Reviewed-by: Michal Privoznik --- Note: I originally intended to use these constants in the next patch, but later changed my approach and didn't actually use these in the blockinfo implementation. Nevertheless it seems like a useful change. src/hyperv/hyperv_driver.c | 29 +++++++++++++++-------------- src/hyperv/hyperv_driver.h | 11 +++++++++++ 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index eb28093028..3cebab305b 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -447,7 +447,7 @@ hypervDomainCreateSCSIController(virDomainPtr domain, v= irDomainControllerDef *de return -1; =20 if (hypervSetEmbeddedProperty(scsiResource, "ResourceSubType", - "Microsoft:Hyper-V:Synthetic SCSI Contro= ller") < 0) + HYPERV_RESOURCE_SUBTYPE_SCSI_CONTROLLER)= < 0) return -1; =20 /* perform the settings change */ @@ -493,7 +493,7 @@ hypervDomainAddVirtualDiskParent(virDomainPtr domain, return -1; =20 if (hypervSetEmbeddedProperty(controllerResource, "ResourceSubType", - "Microsoft:Hyper-V:Synthetic Disk Drive"= ) < 0) + HYPERV_RESOURCE_SUBTYPE_DISK_DRIVE) < 0) return -1; =20 if (hypervMsvmVSMSAddResourceSettings(domain, &controllerResource, @@ -537,7 +537,7 @@ hypervDomainAddVirtualHardDisk(virDomainPtr domain, return -1; =20 if (hypervSetEmbeddedProperty(volumeResource, "ResourceSubType", - "Microsoft:Hyper-V:Virtual Hard Disk") <= 0) + HYPERV_RESOURCE_SUBTYPE_VIRTUAL_HARD_DIS= K) < 0) return -1; =20 if (hypervMsvmVSMSAddResourceSettings(domain, &volumeResource, @@ -615,10 +615,11 @@ hypervDomainAttachPhysicalDisk(virDomainPtr domain, /* prepare HostResource */ =20 /* get Msvm_DiskDrive root device ID */ - virBufferAddLit(&query, - MSVM_RESOURCEALLOCATIONSETTINGDATA_WQL_SELECT - "WHERE ResourceSubType =3D 'Microsoft:Hyper-V:Physical= Disk Drive' " - "AND InstanceID LIKE '%%Default%%'"); + virBufferEscapeSQL(&query, + MSVM_RESOURCEALLOCATIONSETTINGDATA_WQL_SELECT + "WHERE ResourceSubType =3D '%s' " + "AND InstanceID LIKE '%%Default%%'", + HYPERV_RESOURCE_SUBTYPE_PHYSICAL_DISK_DRIVE); =20 if (hypervGetWmiClass(Msvm_ResourceAllocationSettingData, &diskdefault= ) < 0) return -1; @@ -666,7 +667,7 @@ hypervDomainAttachPhysicalDisk(virDomainPtr domain, return -1; =20 if (hypervSetEmbeddedProperty(diskResource, "ResourceSubType", - "Microsoft:Hyper-V:Physical Disk Drive")= < 0) + HYPERV_RESOURCE_SUBTYPE_PHYSICAL_DISK_DR= IVE) < 0) return -1; =20 if (hypervSetEmbeddedProperty(diskResource, "HostResource", hostResour= ce) < 0) @@ -715,7 +716,7 @@ hypervDomainAddOpticalDrive(virDomainPtr domain, return -1; =20 if (hypervSetEmbeddedProperty(driveResource, "ResourceSubType", - "Microsoft:Hyper-V:Synthetic DVD Drive")= < 0) + HYPERV_RESOURCE_SUBTYPE_DVD_DRIVE) < 0) return -1; =20 if (hypervMsvmVSMSAddResourceSettings(domain, &driveResource, @@ -758,7 +759,7 @@ hypervDomainAddOpticalDisk(virDomainPtr domain, return -1; =20 if (hypervSetEmbeddedProperty(volumeResource, "ResourceSubType", - "Microsoft:Hyper-V:Virtual CD/DVD Disk")= < 0) + HYPERV_RESOURCE_SUBTYPE_VIRTUAL_DVD_DISK= ) < 0) return -1; =20 if (hypervMsvmVSMSAddResourceSettings(domain, &volumeResource, @@ -828,7 +829,7 @@ hypervDomainAttachFloppy(virDomainPtr domain, return -1; =20 if (hypervSetEmbeddedProperty(volumeResource, "ResourceSubType", - "Microsoft:Hyper-V:Virtual Floppy Disk")= < 0) + HYPERV_RESOURCE_SUBTYPE_VIRTUAL_FLOPPY_D= ISK) < 0) return -1; =20 if (hypervMsvmVSMSAddResourceSettings(domain, &volumeResource, @@ -1087,7 +1088,7 @@ hypervDomainAttachSyntheticEthernetAdapter(virDomainP= tr domain, return -1; =20 if (hypervSetEmbeddedProperty(portResource, "ResourceSubType", - "Microsoft:Hyper-V:Synthetic Ethernet Po= rt") < 0) + HYPERV_RESOURCE_SUBTYPE_ETHERNET_PORT) <= 0) return -1; =20 if (hypervSetEmbeddedProperty(portResource, @@ -1156,7 +1157,7 @@ hypervDomainAttachSyntheticEthernetAdapter(virDomainP= tr domain, return -1; =20 if (hypervSetEmbeddedProperty(connectionResource, - "ResourceSubType", "Microsoft:Hyper-V:Et= hernet Connection") < 0) + "ResourceSubType", HYPERV_RESOURCE_SUBTY= PE_ETHERNET_CONNECTION) < 0) return -1; =20 if (hypervMsvmVSMSAddResourceSettings(domain, &connectionResource, @@ -1294,7 +1295,7 @@ hypervDomainDefParseVirtualExtent(hypervPrivate *priv, disk->info.type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE; =20 /* note if it's a CDROM disk */ - if (STREQ(disk_entry->data->ResourceSubType, "Microsoft:Hyper-V:Virtua= l CD/DVD Disk")) + if (STREQ(disk_entry->data->ResourceSubType, HYPERV_RESOURCE_SUBTYPE_V= IRTUAL_DVD_DISK)) disk->device =3D VIR_DOMAIN_DISK_DEVICE_CDROM; else disk->device =3D VIR_DOMAIN_DISK_DEVICE_DISK; diff --git a/src/hyperv/hyperv_driver.h b/src/hyperv/hyperv_driver.h index 3764844494..27be81ea1c 100644 --- a/src/hyperv/hyperv_driver.h +++ b/src/hyperv/hyperv_driver.h @@ -27,4 +27,15 @@ #define HYPERV_MAX_IDE_CHANNELS 2 #define HYPERV_MAX_DRIVES_PER_IDE_CHANNEL 2 =20 +/* ResourceSubType values for Msvm_*AllocationSettingData */ +#define HYPERV_RESOURCE_SUBTYPE_SCSI_CONTROLLER "Microsoft:Hyper-V:Synthet= ic SCSI Controller" +#define HYPERV_RESOURCE_SUBTYPE_DISK_DRIVE "Microsoft:Hyper-V:Synthetic Di= sk Drive" +#define HYPERV_RESOURCE_SUBTYPE_VIRTUAL_HARD_DISK "Microsoft:Hyper-V:Virtu= al Hard Disk" +#define HYPERV_RESOURCE_SUBTYPE_PHYSICAL_DISK_DRIVE "Microsoft:Hyper-V:Phy= sical Disk Drive" +#define HYPERV_RESOURCE_SUBTYPE_DVD_DRIVE "Microsoft:Hyper-V:Synthetic DVD= Drive" +#define HYPERV_RESOURCE_SUBTYPE_VIRTUAL_DVD_DISK "Microsoft:Hyper-V:Virtua= l CD/DVD Disk" +#define HYPERV_RESOURCE_SUBTYPE_VIRTUAL_FLOPPY_DISK "Microsoft:Hyper-V:Vir= tual Floppy Disk" +#define HYPERV_RESOURCE_SUBTYPE_ETHERNET_PORT "Microsoft:Hyper-V:Synthetic= Ethernet Port" +#define HYPERV_RESOURCE_SUBTYPE_ETHERNET_CONNECTION "Microsoft:Hyper-V:Eth= ernet Connection" + int hypervRegister(void); --=20 2.53.0 From nobody Tue Mar 3 03:07:43 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=1771536914; cv=none; d=zohomail.com; s=zohoarc; b=caIkU2yM3mnBw53xAM5pbiEj1VyrnNZZEMSlRVdWdn8BRlS4EMe7sKiSYYXVlGLW4WCBBoN3zTGqV/NYCZ3qTe4708ObVUyjLfnp/j8/EfllQHTzHRgTasP29koDI5ufukuKC00pQ4yaFuyBr4Vwh/9oLvmLHZwmJTu7WASs+G0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771536914; 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=RMzv7XuThnGF6vLm4yNzPyI5YUEj8abvDHscK0alPa8=; b=SDHoQ4WOFbqesmNN1ULEHJ5mMDTAuu0JAR4Ov2NtV8LjV/BbkLrhWtmiyrlSS81bYzN+m1rlDqUR7XiaA2Kf5wjagnlVofd388WsU4juR2Vf+2K4T9RYkC//6sIj5vU9bc2OIRg+ZcmVhhs05i7T0Qg51KJYxQ84GFP7ljFNZrQ= 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 1771536914160150.39114515505707; Thu, 19 Feb 2026 13:35:14 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 22A8A3FAE9; Thu, 19 Feb 2026 16:35:13 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 983EB41B26; Thu, 19 Feb 2026 16:31:45 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4502D3F359; Thu, 19 Feb 2026 16:31:36 -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 7D7173FA5C for ; Thu, 19 Feb 2026 16:31:35 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-618-wWaCAduKM8Ca2CjkRWca_g-1; Thu, 19 Feb 2026 16:31:32 -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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 887221800576 for ; Thu, 19 Feb 2026 21:31:31 +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 BF8A23003D91; Thu, 19 Feb 2026 21:31:30 +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=1771536695; 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=RMzv7XuThnGF6vLm4yNzPyI5YUEj8abvDHscK0alPa8=; b=D7cGMHgWhv3MopPYJzXmosYTbvcp0JmIhiMo/ySBucdQPEp9Yt6ZFNvS8bu6jCRuNEr/H8 kmfE6ZVn7zwUWxCiJZK6vNy78UD/1e2lB1RpIq5oQ79p3Bq+qIwHungC2b66sr91VLle42 o8aKn0y/U7quROQ4hfcUnerUc7z9XVI= X-MC-Unique: wWaCAduKM8Ca2CjkRWca_g-1 X-Mimecast-MFC-AGG-ID: wWaCAduKM8Ca2CjkRWca_g_1771536691 To: devel@lists.libvirt.org Subject: [PATCH 3/3] hyperv: Add basic domainGetBlockInfo() API implementation Date: Thu, 19 Feb 2026 15:31:26 -0600 Message-ID: <20260219213126.3387319-4-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: kocDLGZPXu-7g3MbT45b6GBKgcsHuagZabE4V2aH33Q_1771536691 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: J27D6ECPUBYQUEZHWL3UCKIDBFCSGDMB X-Message-ID-Hash: J27D6ECPUBYQUEZHWL3UCKIDBFCSGDMB 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: 1771536915117158500 Content-Type: text/plain; charset="utf-8"; x-default="true" This adds initial support for virDomainGetBlockInfo() for the hyperv driver. It currently supports: - physical disk drives that are assigned to a vm - virtual disk drives backed by a .VHD file that are local to the host - other drives backed by local files (e.g. cdrom with a .iso) It will fail to get allocation and physical values for any drives backed by files that are not local to the host (e.g. on network shares) Signed-off-by: Jonathon Jongsma Reviewed-by: Michal Privoznik --- src/hyperv/hyperv_driver.c | 205 ++++++++++++++++++++++++++ src/hyperv/hyperv_wmi.c | 41 ++++++ src/hyperv/hyperv_wmi.h | 7 + src/hyperv/hyperv_wmi_generator.input | 109 ++++++++++++++ 4 files changed, 362 insertions(+) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 3cebab305b..e332b8a860 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -26,6 +26,9 @@ =20 #include "internal.h" #include "datatypes.h" +#include "libvirt/libvirt.h" +#include "libvirt/virterror.h" +#include "virbuffer.h" #include "virdomainobjlist.h" #include "virauth.h" #include "viralloc.h" @@ -3822,6 +3825,207 @@ hypervDomainInterfaceAddresses(virDomainPtr dom, } =20 =20 +static int +hypervGetFileSize(hypervPrivate *priv, + const char *filePath, + unsigned long long *fileSize) +{ + g_autoptr(CIM_DataFile) dataFile =3D NULL; + g_auto(virBuffer) query =3D VIR_BUFFER_INITIALIZER; + g_autofree char *escapedPath =3D NULL; + + virBufferAddLit(&query, CIM_DATAFILE_WQL_SELECT); + virBufferEscapeSQL(&query, "WHERE Name=3D'%s'", filePath); + + if (hypervGetWmiClass(CIM_DataFile, &dataFile) < 0 || !dataFile) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not query file size for '%1$s'"), filePath= ); + return -1; + } + + *fileSize =3D dataFile->data->FileSize; + return 0; +} + + +static int +hypervGetPhysicalDiskBlockInfo(hypervPrivate *priv, + unsigned int driveNumber, + virDomainBlockInfoPtr info) +{ + g_autoptr(Win32_DiskDrive) diskDrive =3D NULL; + g_auto(virBuffer) query =3D VIR_BUFFER_INITIALIZER; + + virBufferAsprintf(&query, WIN32_DISKDRIVE_WQL_SELECT "WHERE Index=3D%u= ", driveNumber); + + if (hypervGetWmiClass(Win32_DiskDrive, &diskDrive) < 0 || !diskDrive) { + virReportError(VIR_ERR_INVALID_ARG, + _("Could not find physical disk with drive number %= 1$u"), driveNumber); + return -1; + } + + info->capacity =3D info->allocation =3D info->physical =3D diskDrive->= data->Size; + return 0; +} + + +static int +hypervGetVHDCapacity(hypervPrivate *priv, + const char *path, + unsigned long long *capacity) +{ + g_auto(WsXmlDocH) settingDataDoc =3D NULL; + g_autofree char *maxInternalSizeStr =3D NULL; + + if (hypervImageManagementServiceGetVHDSD(priv, path, &settingDataDoc) = < 0) + return -1; + + maxInternalSizeStr =3D ws_xml_get_xpath_value(settingDataDoc, + (char *)"//PROPERTY[@NAME=3D'MaxInternalSize']/VALUE"); + + if (!maxInternalSizeStr) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not find MaxInternalSize in VHD SettingDat= a for '%1$s'"), path); + return -1; + } + + if (virStrToLong_ull(maxInternalSizeStr, NULL, 10, capacity) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to parse MaxInternalSize '%1$s' for '%2$s= '"), + maxInternalSizeStr, path); + return -1; + } + + return 0; +} + + +static int +hypervGetVirtualDiskBlockInfo(hypervPrivate *priv, + const char *diskpath, + virDomainBlockInfoPtr info) +{ + unsigned long long capacity =3D 0; + unsigned long long allocation =3D 0; + /* This might fail if diskpath is not a vhd file, but continue anyway = as it + * might be e.g. an ISO that is not supported by the ImageManagementSe= rvice */ + int rcapacity =3D hypervGetVHDCapacity(priv, diskpath, &capacity); + + /* querying actual file allocation only works for local files, so may = fail + * for files on network shares */ + int rallocation =3D hypervGetFileSize(priv, diskpath, &allocation); + + /* if both queries were unsuccessful, just return an error */ + if (rcapacity < 0 && rallocation < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, _("Unable to get info for d= isk '%s'"), diskpath); + return -1; + } + + /* if we failed to get the capacity from the ImageManagementService (i= .e. + * the disk path wasn't a vhd file), just use the file size */ + if (capacity =3D=3D 0) + capacity =3D allocation; + + info->capacity =3D capacity; + info->physical =3D info->allocation =3D allocation; + return 0; +} + +static int +hypervDomainGetBlockInfo(virDomainPtr domain, + const char *path, + virDomainBlockInfoPtr info, + unsigned int flags) +{ + hypervPrivate *priv =3D domain->conn->privateData; + char uuid_string[VIR_UUID_STRING_BUFLEN]; + g_autoptr(Msvm_ResourceAllocationSettingData) resource_settings =3D NU= LL; + g_autoptr(Msvm_StorageAllocationSettingData) storage_settings =3D NULL; + g_autoptr(Msvm_VirtualSystemSettingData) system_settings =3D NULL; + g_autoptr(virDomainDef) def =3D NULL; + virDomainDiskDef *disk =3D NULL; + const char *diskpath =3D NULL; + + virCheckFlags(0, -1); + + virUUIDFormat(domain->uuid, uuid_string); + + if (hypervGetMsvmVirtualSystemSettingDataFromUUID(priv, uuid_string, &= system_settings) < 0) { + virReportError(VIR_ERR_NO_DOMAIN, _("No domain with UUID %1$s"), u= uid_string); + return -1; + } + + if (hypervGetResourceAllocationSD(priv, + system_settings->data->InstanceID, + &resource_settings) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get resource allocation settings data"= )); + return -1; + } + + if (hypervGetStorageAllocationSD(priv, + system_settings->data->InstanceID, + &storage_settings) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Unable to get storage allocation settings data")= ); + return -1; + } + + if (!(def =3D virDomainDefNew(priv->xmlopt))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Failed to create a new virDomainDef")); + return -1; + } + + /* Process storage and resources to get disk names */ + if (hypervDomainDefParseStorage(priv, def, resource_settings, storage_= settings) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Failed to parse storage")); + return -1; + } + + disk =3D virDomainDiskByName(def, path, false); + if (!disk) { + virReportError(VIR_ERR_INVALID_ARG, + _("invalid path %1$s not assigned to domain"), path= ); + return -1; + } + + diskpath =3D virDomainDiskGetSource(disk); + if (!diskpath) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("disk '%1$s' has no source path"), path); + return -1; + } + + if (virDomainDiskGetType(disk) =3D=3D VIR_STORAGE_TYPE_BLOCK) { + unsigned int driveNumber =3D 0; + g_autoptr(Msvm_DiskDrive) diskdrive =3D NULL; + + /* BLOCK type disks have their source path set to the windows driv= e number */ + if (virStrToLong_ui(diskpath, NULL, 10, &driveNumber) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Invalid drive number '%1$s' for physical dis= k"), diskpath); + return -1; + } + + if (hypervGetPhysicalDiskBlockInfo(priv, driveNumber, info) < 0) + return -1; + } else if (virDomainDiskGetType(disk) =3D=3D VIR_STORAGE_TYPE_FILE) { + /* first try querying the disk via the image management service wh= ich supports .vhd(x) files */ + if (hypervGetVirtualDiskBlockInfo(priv, diskpath, info) < 0) + return -1; + } else { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("Unsupported disk type %1$d for disk '%2$s'"), + virDomainDiskGetType(disk), path); + return -1; + } + + return 0; +} + + static virHypervisorDriver hypervHypervisorDriver =3D { .name =3D "Hyper-V", .connectOpen =3D hypervConnectOpen, /* 0.9.5 */ @@ -3886,6 +4090,7 @@ static virHypervisorDriver hypervHypervisorDriver =3D= { .domainSendKey =3D hypervDomainSendKey, /* 3.6.0 */ .connectIsAlive =3D hypervConnectIsAlive, /* 0.9.8 */ .domainInterfaceAddresses =3D hypervDomainInterfaceAddresses, /* 12.1.= 0 */ + .domainGetBlockInfo =3D hypervDomainGetBlockInfo, /* 12.1.0 */ }; =20 =20 diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index eee42b5c70..90bbc42b6d 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -31,6 +31,7 @@ #include =20 #include "internal.h" +#include "libvirt/virterror.h" #include "virerror.h" #include "datatypes.h" #include "viralloc.h" @@ -1507,6 +1508,46 @@ hypervGetEthernetPortAllocationSD(hypervPrivate *pri= v, } =20 =20 +int +hypervImageManagementServiceGetVHDSD(hypervPrivate *priv, + const char *vhdPath, + WsXmlDocH *settingDataDoc) +{ + hypervInvokeParamsList *params =3D NULL; + g_auto(WsXmlDocH) response =3D NULL; + g_autofree char *settingDataXmlStr =3D NULL; + + params =3D hypervCreateInvokeParamsList("GetVirtualHardDiskSettingData= ", + MSVM_IMAGEMANAGEMENTSERVICE_SELE= CTOR, + Msvm_ImageManagementService_WmiI= nfo); + if (hypervAddSimpleParam(params, "Path", vhdPath) < 0) + return -1; + + if (hypervInvokeMethod(priv, ¶ms, &response) < 0) + return -1; + + settingDataXmlStr =3D ws_xml_get_xpath_value(response, + (char *)"/s:Envelope/s:Body/p:GetVirtualHardDiskSettingData_OUTPUT= /p:SettingData"); + + if (!settingDataXmlStr) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not extract SettingData from response for = '%1$s'"), vhdPath); + return -1; + } + + /* the method returns an embedded CIM-XML document as a string, so we = need + * to parse it as xml */ + *settingDataDoc =3D ws_xml_read_memory(settingDataXmlStr, strlen(setti= ngDataXmlStr), "UTF-8", 0); + if (!*settingDataDoc) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not parse VHD SettingData XML for '%1$s'")= , vhdPath); + return -1; + } + + return 0; +} + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * * Msvm_VirtualSystemManagementService */ diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index 9093aec455..11d61edfc5 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -36,6 +36,9 @@ #define MSVM_VIRTUALSYSTEMMANAGEMENTSERVICE_SELECTOR \ "CreationClassName=3DMsvm_VirtualSystemManagementService" =20 +#define MSVM_IMAGEMANAGEMENTSERVICE_SELECTOR \ + "CreationClassName=3DMsvm_ImageManagementService" + int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, const char *detail); =20 @@ -263,6 +266,10 @@ int hypervGetEthernetPortAllocationSD(hypervPrivate *p= riv, const char *id, Msvm_EthernetPortAllocationSettingDa= ta **data); =20 +int hypervImageManagementServiceGetVHDSD(hypervPrivate *priv, + const char *vhdPath, + WsXmlDocH *settingDataDoc); + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * * Msvm_VirtualSystemManagementService */ diff --git a/src/hyperv/hyperv_wmi_generator.input b/src/hyperv/hyperv_wmi_= generator.input index e6053267f8..017b7a0fa5 100644 --- a/src/hyperv/hyperv_wmi_generator.input +++ b/src/hyperv/hyperv_wmi_generator.input @@ -1143,3 +1143,112 @@ class Msvm_VideoHead uint32 CurrentNumberOfColumns uint64 CurrentNumberOfColors end + + +class Msvm_ImageManagementService + string InstanceID + string Caption + string Description + string ElementName + datetime InstallDate + string Name + uint16 OperationalStatus[] + string StatusDescriptions[] + string Status + uint16 HealthState + uint16 CommunicationStatus + uint16 DetailedStatus + uint16 OperatingStatus + uint16 PrimaryStatus + uint16 EnabledState + string OtherEnabledState + uint16 RequestedState + uint16 EnabledDefault + datetime TimeOfLastStateChange + uint16 AvailableRequestedStates[] + uint16 TransitioningToState + string SystemCreationClassName + string SystemName + string CreationClassName + string PrimaryOwnerName + string PrimaryOwnerContact + string StartMode + boolean Started +end + + +class Msvm_VirtualHardDiskSettingData + string InstanceID + string Caption + string Description + string ElementName + uint16 Type + uint16 Format + string Path + string ParentPath + datetime ParentTimestamp + string ParentIdentifier + uint64 MaxInternalSize + uint32 BlockSize + uint32 LogicalSectorSize + uint32 PhysicalSectorSize + string VirtualDiskId + uint64 DataAlignment + uint16 PmemAddressAbstractionType + boolean IsPmemCompatible +end + + +class Win32_DiskDrive + uint16 Availability + uint32 BytesPerSector + uint16 Capabilities[] + string CapabilityDescriptions[] + string Caption + string CompressionMethod + uint32 ConfigManagerErrorCode + boolean ConfigManagerUserConfig + string CreationClassName + uint64 DefaultBlockSize + string Description + string DeviceID + boolean ErrorCleared + string ErrorDescription + string ErrorMethodology + string FirmwareRevision + uint32 Index + datetime InstallDate + string InterfaceType + uint32 LastErrorCode + string Manufacturer + uint64 MaxBlockSize + uint64 MaxMediaSize + boolean MediaLoaded + string MediaType + uint64 MinBlockSize + string Model + string Name + boolean NeedsCleaning + uint32 NumberOfMediaSupported + uint32 Partitions + string PNPDeviceID + uint16 PowerManagementCapabilities[] + boolean PowerManagementSupported + uint32 SCSIBus + uint16 SCSILogicalUnit + uint16 SCSIPort + uint16 SCSITargetId + uint32 SectorsPerTrack + string SerialNumber + uint32 Signature + uint64 Size + string Status + uint16 StatusInfo + string SystemCreationClassName + string SystemName + uint64 TotalCylinders + uint32 TotalHeads + uint64 TotalSectors + uint64 TotalTracks + uint32 TracksPerCylinder +end --=20 2.53.0