From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344788296344.71866039063; Tue, 4 Apr 2017 15:26:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A739BA326C; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1162171C3D; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 636464E9BC; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQMdi020636 for ; Tue, 4 Apr 2017 18:26:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 13DAA9AB62; Tue, 4 Apr 2017 22:26:22 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C1559AB5C for ; Tue, 4 Apr 2017 22:26:20 +0000 (UTC) Received: from mail-qt0-f175.google.com (mail-qt0-f175.google.com [209.85.216.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83A2F369C3 for ; Tue, 4 Apr 2017 22:26:19 +0000 (UTC) Received: by mail-qt0-f175.google.com with SMTP id n21so151623654qta.1 for ; Tue, 04 Apr 2017 15:26:19 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:18 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A739BA326C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A739BA326C Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="TAdDl6r9" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 83A2F369C3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 83A2F369C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=ZnBGKfqBXblb18P0HCOeOCkcTPM840zzG60UQTXjD7k=; b=TAdDl6r9Jw2S8IFM78R3k+fnfbct6q553k9l4M3v4wD2FuhYabvkdo88R+aCe0eNTY 12/iyJtpo4Q4ATG05uAOwNZXwChJkFJN0ZrmfjjOx/UMAM5MZhqxEEGdsclsu9+XdyGI axdVHfCrlBi1vWBJS5cY0dIh2rRf3kIiWT8AZHmzt6kgf/QlOcrP7NJNmMvN6odhmdTF ui/A8Tx76P+DSMzrkhNqyQ+83FN2txjOm69IpSLXU8Y0ddW1mVKSsn7V9FgfiJ+RAwTW WpIgmsPxAB5d0Txp14HOdt1AOgFBYgzxzsbDu+E+xBzIHmoaJ6PfIQV7YccVQk563+TA DN1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ZnBGKfqBXblb18P0HCOeOCkcTPM840zzG60UQTXjD7k=; b=cib849OTDs7n1SVXj+ZO072jxn5kXkNRlfw0kV8yP3pmN8yHedxEk7Uiyjp9QfcVUS 7UIe/XDuWpKnLjSwYBQAvP+dbdnNkeXXxa455y+38fTCl4At8m1LZUp8jd4he0YQeaj+ MPfHCZVXf4pAXjq0tcpQTlHJdEp3nbtpzTlKm7cGsZ0m/AM42mPigOpPEykXlCaB3YRP 1WPD4mWF8LVwBL/65zDWLZww4LV7AM5tsCbHZzZEkB08mPCt2Upj5N1SPwI4sMk0EEzC 07H/2A66tgyGUTzXoZrOAEeFEEyfvz8YfC6MYlHdKJVHyVupdX09tgzRSjD+RQ091Hbs wO0w== X-Gm-Message-State: AFeK/H3oiOvpg4mviXT63a3CSbLvqz4FV23/QAYaSpXdx+R44NAEbr8H/gxaUDoQHwwRYuIu X-Received: by 10.200.42.213 with SMTP id c21mr28727514qta.257.1491344778506; Tue, 04 Apr 2017 15:26:18 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:05 -0400 Message-Id: <20170404222616.15382-2-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:19 +0000 (UTC) for IP:'209.85.216.175' DOMAIN:'mail-qt0-f175.google.com' HELO:'mail-qt0-f175.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.175 mail-qt0-f175.google.com 209.85.216.175 mail-qt0-f175.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 01/12] hyperv: store WMI version in hypervPrivate. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:27 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Hyper-V 2012+ uses a new "v2" version of Msvm_* WMI classes so we will store that info in hypervPrivate so that it is easily accessbile in the driver API callbacks and handled accordingly. --- src/hyperv/hyperv_private.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_private.h b/src/hyperv/hyperv_private.h index 574bb5f..4e70699 100644 --- a/src/hyperv/hyperv_private.h +++ b/src/hyperv/hyperv_private.h @@ -28,11 +28,17 @@ # include "hyperv_util.h" # include "openwsman.h" =20 -typedef struct _hypervPrivate hypervPrivate; +typedef enum _hypervWmiVersion hypervWmiVersion; +enum _hypervWmiVersion { + HYPERV_WMI_VERSION_V1, + HYPERV_WMI_VERSION_V2, +}; =20 +typedef struct _hypervPrivate hypervPrivate; struct _hypervPrivate { hypervParsedUri *parsedUri; WsManClient *client; + hypervWmiVersion wmiVersion; }; =20 #endif /* __HYPERV_PRIVATE_H__ */ --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344807076223.13514320123545; Tue, 4 Apr 2017 15:26:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 773747E9DE; Tue, 4 Apr 2017 22:26:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 436AD7FCFA; Tue, 4 Apr 2017 22:26:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CB41B4EBDD; Tue, 4 Apr 2017 22:26:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQM2s020641 for ; Tue, 4 Apr 2017 18:26:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id D581C784D7; Tue, 4 Apr 2017 22:26:22 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CDD64784DE for ; Tue, 4 Apr 2017 22:26:21 +0000 (UTC) Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05A8FC054C5A for ; Tue, 4 Apr 2017 22:26:20 +0000 (UTC) Received: by mail-qk0-f173.google.com with SMTP id g195so82731122qke.2 for ; Tue, 04 Apr 2017 15:26:19 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:18 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 773747E9DE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 773747E9DE Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="XeC45XGI" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 05A8FC054C5A Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 05A8FC054C5A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=/G7OXwmhc5KgWIX/Xh9swiuxQ+omBwflsQh1/sLGC7c=; b=XeC45XGIturZtggHw9YJsv6iwxe1naQK+G1G3Vg3qxzxtF+9n1KMi77i/6DxMnscA6 wP+CarT2waXiJzfW9rW4tuTVFinWcMQvV5V/qOFIkQFxhINXSmVoGyaKceaeCXAEHvd0 18Mib0rhE6lhGj3ZCfx6ZgICPm22HpausraxXL6t6dmQsOGlcFQhyVNrlfiuV//i8KpG BAk43jmzWQaSYaQhWZoPvUXI1UyN2iuqFR8UgibmwzvaOFwxk7DmW3yRbUBfZNQUm9/f apVHn82LbAkFi/IU+Iic95eDX6eFgG/yt8IUmZZezwM7UvqUhg7axlAVhNy6JOFQRMGn hvTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/G7OXwmhc5KgWIX/Xh9swiuxQ+omBwflsQh1/sLGC7c=; b=A5xAaM8UFkFEtWQuKqyNpeoFgjblBvVr5JpdS+G72KAOYhqliF8kiV7oeIU2ZhFyr+ ZlioHwpfN5tjObdxQiZgvItX7ght6WX55uVwTPgvbtqID0C4Xetr4q/CQV8HbpLnm1e8 ONwLi1AdxwffTSpUMxLWVxUB6gqa3bmott3IkuoDTXJnwt22+ggLAM0rO2CzAB+BXrFP kfOZfoEnGmRZMhF/vS/W4RO96AWmY1lFQmfetxLDv7/AeutvcU+/uX69VcqeHg7Uf3tA g31DyHwGR2oBNMynWqfSsXhsiRZWnGBdeiJPrdVcq3mHzcNcqRTYhG5kBLX3x1NZxtna DVcg== X-Gm-Message-State: AFeK/H1La42/U1At21WRBalNH5jS6hX+GY0CargCBGDJOGdlZXOUlF0NmsgD3+4YBzIcGHVQ X-Received: by 10.55.73.131 with SMTP id w125mr24255602qka.16.1491344779013; Tue, 04 Apr 2017 15:26:19 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:06 -0400 Message-Id: <20170404222616.15382-3-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 04 Apr 2017 22:26:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 04 Apr 2017 22:26:20 +0000 (UTC) for IP:'209.85.220.173' DOMAIN:'mail-qk0-f173.google.com' HELO:'mail-qk0-f173.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.173 mail-qk0-f173.google.com 209.85.220.173 mail-qk0-f173.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 02/12] hyperv: introduce hypervWmiClassInfo struct. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 04 Apr 2017 22:26:46 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This struct is to be used to carry all the information necessary to issue wsman requests for given WMI class. Those will be defined by the generator code (as lists) so that they are handy for the driver code to "extract" needed info depending on which hyper-v we're connected to. For example: hypervWmiClassInfoListPtr Msvm_ComputerSystem_WmiInfo =3D { .count =3D 2 { { .name =3D "Msvm_ComputerSystem", .version =3D "v1", .rootUri =3D "http://asdf.com", ... }, { .name =3D "Msvm_ComputerSystem", .version =3D "v2", .rootUri =3D "http://asdf.com/v2", ... }, } }; Then the driver code will grab either "v1" or "v2" to pass info wsman API, depending on hypervPrivate->wmiVersion value. --- src/hyperv/hyperv_wmi_classes.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/hyperv/hyperv_wmi_classes.h b/src/hyperv/hyperv_wmi_classe= s.h index ac7a3b8..b0f3e3c 100644 --- a/src/hyperv/hyperv_wmi_classes.h +++ b/src/hyperv/hyperv_wmi_classes.h @@ -87,6 +87,28 @@ enum _Msvm_ConcreteJob_JobState { }; =20 =20 +typedef struct _hypervWmiClassInfo hypervWmiClassInfo; +typedef hypervWmiClassInfo *hypervWmiClassInfoPtr; +struct _hypervWmiClassInfo { + /* The WMI class name */ + const char *name; + /* The version of the WMI class as in "v1" or "v2" */ + const char *version; + /* The URI for wsman enumerate request */ + const char *rootUri; + /* The namespace URI for XML serialization */ + const char *resourceUri; + /* The wsman serializer info - one of the *_TypeInfo structs */ + XmlSerializerInfo *serializerInfo; +}; + + +typedef struct _hypervWmiClassInfoList hypervWmiClassInfoList; +typedef hypervWmiClassInfoList *hypervWmiClassInfoListPtr; +struct _hypervWmiClassInfoList { + size_t count; + hypervWmiClassInfoPtr *objs; +}; =20 # include "hyperv_wmi_classes.generated.h" =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344810984203.5326667800764; Tue, 4 Apr 2017 15:26:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23ADCC054914; Tue, 4 Apr 2017 22:26:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7F7671C3B; Tue, 4 Apr 2017 22:26:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7DAFA18523CC; Tue, 4 Apr 2017 22:26:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQNF7020651 for ; Tue, 4 Apr 2017 18:26:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42A069D051; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C1449D04E for ; Tue, 4 Apr 2017 22:26:21 +0000 (UTC) Received: from mail-qt0-f177.google.com (mail-qt0-f177.google.com [209.85.216.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0A1E80F8E for ; Tue, 4 Apr 2017 22:26:20 +0000 (UTC) Received: by mail-qt0-f177.google.com with SMTP id i34so151728753qtc.0 for ; Tue, 04 Apr 2017 15:26:20 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:19 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 23ADCC054914 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 23ADCC054914 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="0brlRNrd" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A0A1E80F8E Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A0A1E80F8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=vCXoBshs5+V6rrV2fC/fpAbeYUimvlX3Dv/smLn/T4Y=; b=0brlRNrdJomyPLKh7xZH6Ca1bO0YfbjEFdM6SfVaTD2WVh1nxm3P/AGvy02yGvtNdC BOWpwbMWzJvo00VeuaLK2t+5TqHFlK4gXDJrL0B3BWIVYUPv6zIoOeq5/iSXJuz3pTnd VX1dhQJ0u+hOY09jUH23fpPNkdJlAGauVN3LdXNtWH4t9JEewE5rjb5GD/FVGmMIPSN8 S/hRhplRKi2RACgVKhG4edlHcKWnPS9ZGT9Q30Hb8/F7/LVdV10yLQn0ZeffUNJbVmfP cxptk+rLcJBbRlGZvB5nPI3RwgnHs4at+iejbMWC6W1NjlEZOb2AsIP4kquVcO/0FNzr wRhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=vCXoBshs5+V6rrV2fC/fpAbeYUimvlX3Dv/smLn/T4Y=; b=NtGz10gCJHaUvI68EvP5xqbbLzzvV2n/8JnUcJ8tJHZ0x34fs1jawRKs9gV2xK1xqK JIapY1JEBMH5lP4TD7827aipVYzWkDMSCWo8wMVlnq6Z4CNEhVexl0+px540/ba2694s 0weKmjIpG1rzC3Wz5sQt+BcnErJm3ji2r5GwJZQzD3U/lRUbKGbibm4gO2XrGncO6fDY RJm2Jh7vp0dTrQuWSXyMA1ypm3gxK1z/D3+J2N/+q7YUqrnf5BEGAyNqrKL7yUgWhuLm ty06ZVf8hDvQHTmcQxlPldtic7cfjM1m24aCenYiSujIHwdr830Gs6U2xIYiOuq5xMyU K6Ag== X-Gm-Message-State: AFeK/H0to9VEqUjoOGx+f4ouHPlpSGGEabG39yq0GIJ1YVvMUBmesyrpsgKlfyL2sFY2iMR7 X-Received: by 10.237.44.66 with SMTP id f60mr25214240qtd.182.1491344779541; Tue, 04 Apr 2017 15:26:19 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:07 -0400 Message-Id: <20170404222616.15382-4-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 04 Apr 2017 22:26:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 04 Apr 2017 22:26:20 +0000 (UTC) for IP:'209.85.216.177' DOMAIN:'mail-qt0-f177.google.com' HELO:'mail-qt0-f177.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.177 mail-qt0-f177.google.com 209.85.216.177 mail-qt0-f177.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 03/12] hyperv: update hypervObject struct. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 04 Apr 2017 22:26:49 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently named as hypervObjecUnified to keep code compilable/functional until all bits are in place. This struct is a result of unserializing WMI request response. Therefore, it needs to be able to deal with different "versions" of the same WMI class. To accomplish this, the "data" member was turned in to a union which: * has a "common" member that contains only WMI class fields that are safe to access and are present in all "versions". This is ensured by the code generator that takes care of proper struct memory alignment between "common", "v1", "v2" etc members. This memeber is to be used by the driver code wherever the API implementation can be shared for all supported hyper-v versions. * the "v1" and "v2" member can be used by the driver code to handle version specific cases. Example: Msvm_ComputerSystem *vm =3D NULL; ... hypervGetVirtualMachineList(priv, wqlQuery, *vm); ... /* safe for "v1" and "v2" */ char *vmName =3D vm->data.common->Name; /* or if one really needs special handling for "v2" */ if (priv->wmiVersion =3D=3D HYPERV_WMI_VERSION_V2) { char *foo =3D vm->data.v2->SomeV2OnlyField; } In other words, driver should not concern itself with existence of "v1" or "v2" of WMI class unless absolutely necessary. --- src/hyperv/hyperv_wmi.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index ce1fe05..5fc36e8 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -41,6 +41,25 @@ int hypervVerifyResponse(WsManClient *client, WsXmlDocH = response, /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * * Object */ +typedef struct _hypervObjectUnified hypervObjectUnified; +struct _hypervObjectUnified { + /* Unserialized data from wsman response. The member called "common" h= as + * properties that are the same type and name for all "versions" of gi= ven + * WMI class. This means that calling code does not have to make any + * conditional checks based on which version was returned as long as it + * only needs to read common values. The alignment of structs is ensur= ed + * by the generator. + */ + union { + XML_TYPE_PTR common; + XML_TYPE_PTR v1; + XML_TYPE_PTR v2; + } data; + /* The info used to make wsman request */ + hypervWmiClassInfoPtr info; + + hypervObjectUnified *next; +}; =20 struct _hypervObject { XmlSerializerInfo *serializerInfo; --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344814270843.5382193716393; Tue, 4 Apr 2017 15:26:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA9CFE0756; Tue, 4 Apr 2017 22:26:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B61B71C41; Tue, 4 Apr 2017 22:26:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 515CA5EC6A; Tue, 4 Apr 2017 22:26:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQOrf020669 for ; Tue, 4 Apr 2017 18:26:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1FE3C71C3B; Tue, 4 Apr 2017 22:26:24 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 181E94D9E4 for ; Tue, 4 Apr 2017 22:26:22 +0000 (UTC) Received: from mail-qt0-f178.google.com (mail-qt0-f178.google.com [209.85.216.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D6137E9CC for ; Tue, 4 Apr 2017 22:26:21 +0000 (UTC) Received: by mail-qt0-f178.google.com with SMTP id x35so151195413qtc.2 for ; Tue, 04 Apr 2017 15:26:21 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:19 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CA9CFE0756 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CA9CFE0756 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="XDbq0oBE" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4D6137E9CC Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4D6137E9CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=OBcw6UHmtIVmkCB8ItWZHLNSK4oObBHwq6qn0G75YxE=; b=XDbq0oBEM5Zw+47a7FU/8tLg+9tUVSgFfaiHfpr2XjZT1Yi7I6zTUaAO9hybpf05Ka bbR9YUvZsDloP5EMBHnK9oYezsemYHFupiQZB5WskkolrnGMoOeg7teYPyAJAAKIp+BE gwZ42o7Tf0vdtzNdcj5I4WM9SjrarXnBQOt4V3CntL78sLK0/QcxFeMh1A3O41rLoAR2 bEDx2X6DRyUII5lidqiEr3ynEjLEPzqN4/3ikVDubjMnYoFDbbwMfOuGPhuVTCZSO8GX C/b8eTo61W0m11ZvNNH+X9Kx5TX9Lc4lv1yiWDCUKYBC+cMwpNb4d4wpiqMpNFzWfCcN QsNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=OBcw6UHmtIVmkCB8ItWZHLNSK4oObBHwq6qn0G75YxE=; b=Ax3o4PH4YJX9H2bCxLP6vCUFTwsssNRauzb/2zmxxPlpDth0H34otKl4/A5+WJ9n/g LUhZHknua+IItbJvIWp2GmlwOJn9Oy9T21mkmW5zyua/WC1UTGjZJRQgv3E7viMO6oUS PupL+7WDwF/i7L1R4bq7rpsOyOlNQ/Oy9WHy6WhhW/vH1dIpA7gFLLGfy6qQjEk8aoAO xJyLtGdFai6nL0xGvTiNeXtvMY+kYd9u/oiK0colTzHfoVKR3hC+tYmi0r5yC9tfpAbv 8cPp1TcrXF5HhpUS09HdLv6YIs04Fsk/zFeKV40SdM38yxSQQxtO+8TaLw0gOWlJwy2c Ohug== X-Gm-Message-State: AFeK/H0lw+FouyesxWOHoiEuuSGgq3aHxqgtQ7lAeDrBJAP7kIH+upSBZ61cjPbLEUrmz5Lj X-Received: by 10.200.46.151 with SMTP id h23mr28168874qta.239.1491344780190; Tue, 04 Apr 2017 15:26:20 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:08 -0400 Message-Id: <20170404222616.15382-5-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 04 Apr 2017 22:26:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 04 Apr 2017 22:26:21 +0000 (UTC) for IP:'209.85.216.178' DOMAIN:'mail-qt0-f178.google.com' HELO:'mail-qt0-f178.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.179 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.178 mail-qt0-f178.google.com 209.85.216.178 mail-qt0-f178.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 04/12] hyperv: add hypervWqlQuery struct. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:53 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since this is the last commit that will compile in the series, the remaining patches should be squashed into this one - they are kept separate only for code review purposes. This struct is to be passed to enumerate-and-pull wsman request (to run "Select" queries) and provides the hypervWmiClassInfoListPtr instance from which we can extract the version specific info using the new hypervGetWmiClassInfo function (currently unused) --- src/hyperv/hyperv_wmi.c | 35 +++++++++++++++++++++++++++++++++++ src/hyperv/hyperv_wmi.h | 8 ++++++++ 2 files changed, 43 insertions(+) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index b2b5243..069bcc9 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -45,6 +45,41 @@ #define VIR_FROM_THIS VIR_FROM_HYPERV =20 =20 +static int ATTRIBUTE_UNUSED +hypervGetWmiClassInfo(hypervPrivate *priv, hypervWmiClassInfoListPtr list, + hypervWmiClassInfoPtr *info) +{ + const char *version =3D "v2"; + size_t i; + + if (list->count =3D=3D 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("The WMI class info list is empty")); + return -1; + } + + /* if there's just one WMI class and isn't versioned, assume "shared" = */ + if (list->count =3D=3D 1 && list->objs[0]->version =3D=3D NULL) { + *info =3D list->objs[0]; + return 0; + } + + if (priv->wmiVersion =3D=3D HYPERV_WMI_VERSION_V1) + version =3D "v1"; + + for (i =3D 0; i < list->count; i++) { + if (STRCASEEQ(list->objs[i]->version, version)) { + *info =3D list->objs[i]; + return 0; + } + } + + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not match WMI class info for version %s"), + version); + + return -1; +} =20 int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index 5fc36e8..c7d82bc 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -30,6 +30,7 @@ # include "openwsman.h" =20 =20 +# define HYPERV_WQL_QUERY_INITIALIZER { VIR_BUFFER_INITIALIZER, NULL } =20 typedef struct _hypervObject hypervObject; =20 @@ -61,6 +62,13 @@ struct _hypervObjectUnified { hypervObjectUnified *next; }; =20 +typedef struct _hypervWqlQuery hypervWqlQuery; +typedef hypervWqlQuery *hypervWqlQueryPtr; +struct _hypervWqlQuery { + virBuffer query; + hypervWmiClassInfoListPtr info; +}; + struct _hypervObject { XmlSerializerInfo *serializerInfo; XML_TYPE_PTR data; --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344807249584.299008534115; Tue, 4 Apr 2017 15:26:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C56DC04F4A3; Tue, 4 Apr 2017 22:26:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A3897E216; Tue, 4 Apr 2017 22:26:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CD13E18521CB; Tue, 4 Apr 2017 22:26:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQN1H020646 for ; Tue, 4 Apr 2017 18:26:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2AFD98FE4F; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2355B1868F for ; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com [209.85.216.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF52C80464 for ; Tue, 4 Apr 2017 22:26:21 +0000 (UTC) Received: by mail-qt0-f172.google.com with SMTP id n21so151624352qta.1 for ; Tue, 04 Apr 2017 15:26:21 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:20 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C56DC04F4A3 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6C56DC04F4A3 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="J4/vDyCl" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CF52C80464 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CF52C80464 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=zqp2G0OaQ/Xpj/nej4wtpVwxqApCACeqwQKyqs3ifUI=; b=J4/vDyClga9BKYijGEbxtBoMH+XbV/qfOoqWv7x955dQGfimjCz79eOJ2pa+K21MT8 uB4WEmQlTvHmLcMhnjNeMyOux3Wu/qNYuP9T8j1xD1UUF4BQKjtkYBBITryGb6P6nC/6 abT9mS28xdxQ+q0gt8lIwVbPuX0TnFs2VDL6drNrW0YOA/A9AE4haZjw/S35l9QRLCzH mwnFHfKB6oKsaEGlPxfA75CFSKBRO0N0OeNVO+eQQO0jAIpcg+bJE/bIFf7al6eMKEds BFQ/QLOYaQZhsRKlWs+ZR7Wg/Bprj6M25q0Fv4HjywyGQUCMmeMtsPG0848upEZDPLZr 0Dew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=zqp2G0OaQ/Xpj/nej4wtpVwxqApCACeqwQKyqs3ifUI=; b=I2erEkV1aaOoL7N3Qu2EtjVZcE3nsBoH9NPPaPxd0zlkMPlHR2ZI9Sz3riasF57bSe WfiNw+j9Pc50Grv5LEdF61cy3RVW1I8XimOQhA59foPvUXvI3lZJhGEqenECVc8VqPEm ExunUeWAEMzlX+ufLI9/IAROnFkxeql5YWNnu+ee7NKKUI8r763xswHuCXfJYm6ajB9f GLnhkaEC0P56vz7BynSWnUNFQct5+WUrdvBHgXk2BJHqEEXpTOQvX3ZQ3a7e0C7XY0Rz Ke7OGIvW97Louo6BzvpIKl/2/klE0jammMR0hQKHb6FEUbcry7GCxxtxQlqeYrDCLFeI z5/Q== X-Gm-Message-State: AFeK/H2TNVEDToEEszbWh/VsAEbDmTb/5Dkn1R2q1Mfyu5BrCFJv8mS4iSKA0L3cW6uCcAJk X-Received: by 10.200.42.166 with SMTP id b35mr26133273qta.195.1491344780658; Tue, 04 Apr 2017 15:26:20 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:09 -0400 Message-Id: <20170404222616.15382-6-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 04 Apr 2017 22:26:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 04 Apr 2017 22:26:22 +0000 (UTC) for IP:'209.85.216.172' DOMAIN:'mail-qt0-f172.google.com' HELO:'mail-qt0-f172.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.172 mail-qt0-f172.google.com 209.85.216.172 mail-qt0-f172.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 05/12] hyperv: make hypervEnumAndPull use hypervWqlQuery X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 04 Apr 2017 22:26:46 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This enables this function to handle "v1" and "v2" WMI requests. Since this commit and the ones that follow should be squashed on previous one: * rename hypervObjectUnified -> hypervObject as we've already broken compilation here so there's no point in keeping those in parallel anymore. * do not mark hypervGetWmiClassInfo as unused --- src/hyperv/hyperv_wmi.c | 41 ++++++++++++++++++++++------------------- src/hyperv/hyperv_wmi.h | 17 ++++------------- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 069bcc9..eab6192 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -45,7 +45,7 @@ #define VIR_FROM_THIS VIR_FROM_HYPERV =20 =20 -static int ATTRIBUTE_UNUSED +static int hypervGetWmiClassInfo(hypervPrivate *priv, hypervWmiClassInfoListPtr list, hypervWmiClassInfoPtr *info) { @@ -143,14 +143,14 @@ hypervVerifyResponse(WsManClient *client, WsXmlDocH r= esponse, =20 /* This function guarantees that query is freed, even on failure */ int -hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const char *roo= t, - XmlSerializerInfo *serializerInfo, const char *resourceU= ri, - const char *className, hypervObject **list) +hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery, + hypervObject **list) { int result =3D -1; WsSerializerContextH serializerContext; client_opt_t *options =3D NULL; char *query_string =3D NULL; + hypervWmiClassInfoPtr wmiInfo =3D NULL; filter_t *filter =3D NULL; WsXmlDocH response =3D NULL; char *enumContext =3D NULL; @@ -160,18 +160,20 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr q= uery, const char *root, XML_TYPE_PTR data =3D NULL; hypervObject *object; =20 - if (virBufferCheckError(query) < 0) { - virBufferFreeAndReset(query); + if (virBufferCheckError(&wqlQuery->query) < 0) { + virBufferFreeAndReset(&wqlQuery->query); return -1; } - query_string =3D virBufferContentAndReset(query); + query_string =3D virBufferContentAndReset(&wqlQuery->query); =20 if (list =3D=3D NULL || *list !=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")= ); - VIR_FREE(query_string); return -1; } =20 + if (hypervGetWmiClassInfo(priv, wqlQuery->info, &wmiInfo) < 0) + goto cleanup; + serializerContext =3D wsmc_get_serialization_context(priv->client); =20 options =3D wsmc_options_init(); @@ -190,7 +192,8 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr que= ry, const char *root, goto cleanup; } =20 - response =3D wsmc_action_enumerate(priv->client, root, options, filter= ); + response =3D wsmc_action_enumerate(priv->client, wmiInfo->rootUri, opt= ions, + filter); =20 if (hypervVerifyResponse(priv->client, response, "enumeration") < 0) goto cleanup; @@ -201,7 +204,7 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr que= ry, const char *root, response =3D NULL; =20 while (enumContext !=3D NULL && *enumContext !=3D '\0') { - response =3D wsmc_action_pull(priv->client, resourceUri, options, + response =3D wsmc_action_pull(priv->client, wmiInfo->resourceUri, = options, filter, enumContext); =20 if (hypervVerifyResponse(priv->client, response, "pull") < 0) @@ -231,11 +234,12 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr q= uery, const char *root, goto cleanup; } =20 - if (ws_xml_get_child(node, 0, resourceUri, className) =3D=3D NULL) + if (ws_xml_get_child(node, 0, wmiInfo->resourceUri, + wmiInfo->name) =3D=3D NULL) break; =20 - data =3D ws_deserialize(serializerContext, node, serializerInfo, - className, resourceUri, NULL, 0, 0); + data =3D ws_deserialize(serializerContext, node, wmiInfo->serializ= erInfo, + wmiInfo->name, wmiInfo->resourceUri, NULL, 0= , 0); =20 if (data =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -246,8 +250,8 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr que= ry, const char *root, if (VIR_ALLOC(object) < 0) goto cleanup; =20 - object->serializerInfo =3D serializerInfo; - object->data =3D data; + object->info =3D wmiInfo; + object->data.common =3D data; =20 data =3D NULL; =20 @@ -283,12 +287,11 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr q= uery, const char *root, /* FIXME: ws_serializer_free_mem is broken in openwsman <=3D 2.2.6, * see hypervFreeObject for a detailed explanation. */ if (ws_serializer_free_mem(serializerContext, data, - serializerInfo) < 0) { + wmiInfo->serializerInfo) < 0) { VIR_ERROR(_("Could not free deserialized data")); } #endif } - VIR_FREE(query_string); ws_xml_destroy_doc(response); VIR_FREE(enumContext); @@ -322,8 +325,8 @@ hypervFreeObject(hypervPrivate *priv ATTRIBUTE_UNUSED, = hypervObject *object) * them in wsmc_release. So this doesn't result in a real * memory leak, but just in piling up unused memory until * the connection is closed. */ - if (ws_serializer_free_mem(serializerContext, object->data, - object->serializerInfo) < 0) { + if (ws_serializer_free_mem(serializerContext, object->data.common, + object->info->serializerInfo) < 0) { VIR_ERROR(_("Could not free deserialized data")); } #endif diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index c7d82bc..b8b9c3d 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -32,7 +32,6 @@ =20 # define HYPERV_WQL_QUERY_INITIALIZER { VIR_BUFFER_INITIALIZER, NULL } =20 -typedef struct _hypervObject hypervObject; =20 int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, const char *detail); @@ -42,8 +41,8 @@ int hypervVerifyResponse(WsManClient *client, WsXmlDocH r= esponse, /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * * Object */ -typedef struct _hypervObjectUnified hypervObjectUnified; -struct _hypervObjectUnified { +typedef struct _hypervObject hypervObject; +struct _hypervObject { /* Unserialized data from wsman response. The member called "common" h= as * properties that are the same type and name for all "versions" of gi= ven * WMI class. This means that calling code does not have to make any @@ -59,7 +58,7 @@ struct _hypervObjectUnified { /* The info used to make wsman request */ hypervWmiClassInfoPtr info; =20 - hypervObjectUnified *next; + hypervObject *next; }; =20 typedef struct _hypervWqlQuery hypervWqlQuery; @@ -69,15 +68,7 @@ struct _hypervWqlQuery { hypervWmiClassInfoListPtr info; }; =20 -struct _hypervObject { - XmlSerializerInfo *serializerInfo; - XML_TYPE_PTR data; - hypervObject *next; -}; - -int hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, - const char *root, XmlSerializerInfo *serializerInfo, - const char *resourceUri, const char *className, +int hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery, hypervObject **list); =20 void hypervFreeObject(hypervPrivate *priv, hypervObject *object); --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344788620289.5157026477914; Tue, 4 Apr 2017 15:26:28 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 298514E34C; Tue, 4 Apr 2017 22:26:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DA1C1868F; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1E4CF4EBDA; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQNGA020656 for ; Tue, 4 Apr 2017 18:26:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 594A69D051; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51C7E9D04E for ; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5CF4180F75 for ; Tue, 4 Apr 2017 22:26:22 +0000 (UTC) Received: by mail-qk0-f173.google.com with SMTP id p22so154612124qka.3 for ; Tue, 04 Apr 2017 15:26:22 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:20 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 298514E34C Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 298514E34C Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="k/Wi3WOk" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5CF4180F75 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5CF4180F75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Jg5FWIUkufpoIVg9cEdzlRTCwvVEZNCDqii3I69my/U=; b=k/Wi3WOkdvZk2nWhL3bt3qNkYWhGxXmSbZ+zs9KZf5mUop36oJh0npAauE3NxbfmZ3 /6MVHJJ6VvYqlkcoTDyL/wTeFyG6wnrTyYF/R/T8mOtRjIBrueE/73ptZ2/bmdfpj0iz 0GaQTQRy8nsMl9hEJI4+jl8KYoMfUmNw6DhDf7cggm2Yjj/XjaRA9wHk/zUS02Ti28ZM E0KnA2u7NzsE9ZeGSS26YdFiYCyTkZxEjcldfkMjwBve+4AO/ju4eVCTPU6+GAQxtvoA gbMeePSzCnD8hibyoaBgxSROONiU2mj8/67L+zmUZug6uTj4BMkm/Qfzm9132bFdYNrn gJRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Jg5FWIUkufpoIVg9cEdzlRTCwvVEZNCDqii3I69my/U=; b=VxVvm/Ko3He9YfJ7VbLB8+pOXjB8xLIKR+ZvEhYNqMMioUijN0IMDsW8TDXvBwgs78 x19Ip7eC6k2/DUr4VqM+ghZsEi8zTWUjkrFe25QZiolDshv+xPRjkrLf4BvIzny4opJr WKt806OAmusSlo7Bs3v4ydfeZ23FLEf3Nif3LB8hzYfAo56LUOAONIykRUdfrLid7Q78 v9r4RE9qWH6j2deQ7vLr1boOCrBTGAc2Dzzqs7vhwPhn0pA2Pc4wJ7SELqnpUkyORGuh t0HXageFebqbXYopBfjT1I6BkeTYVXEZr291LUr/CflM5WkhFUD6EL5SQGsY/VckBKYS rleA== X-Gm-Message-State: AFeK/H0vaYflC0JpeZVeTsMTTVnaO8AAtLByVwhjgFNdGq+iJD1bqs6uyb0NtkaJ28pAczdI X-Received: by 10.55.179.67 with SMTP id c64mr19849003qkf.102.1491344781319; Tue, 04 Apr 2017 15:26:21 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:10 -0400 Message-Id: <20170404222616.15382-7-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 04 Apr 2017 22:26:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 04 Apr 2017 22:26:22 +0000 (UTC) for IP:'209.85.220.173' DOMAIN:'mail-qk0-f173.google.com' HELO:'mail-qk0-f173.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 1.969 * (BAYES_50, DCC_CHECK, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.173 mail-qk0-f173.google.com 209.85.220.173 mail-qk0-f173.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 06/12] hyperv: update generator input file. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 04 Apr 2017 22:26:27 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Adds defintiions for "v2" WMI class variants that are needed by the driver to handle both hyperv 2008 and 2012+ --- src/hyperv/hyperv_wmi_generator.input | 239 +++++++++++++++++++++++++++++-= ---- 1 file changed, 206 insertions(+), 33 deletions(-) diff --git a/src/hyperv/hyperv_wmi_generator.input b/src/hyperv/hyperv_wmi_= generator.input index 209a9ff..d7f819e 100644 --- a/src/hyperv/hyperv_wmi_generator.input +++ b/src/hyperv/hyperv_wmi_generator.input @@ -56,6 +56,55 @@ class Msvm_ComputerSystem end =20 =20 +class v2/Msvm_ComputerSystem + string InstanceID + string Caption + string Description + string ElementName + datetime InstallDate + 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 CreationClassName + string Name + string PrimaryOwnerName + string PrimaryOwnerContact + string Roles[] + string NameFormat + string OtherIdentifyingInfo[] + string IdentifyingDescriptions[] + uint16 Dedicated[] + string OtherDedicatedDescriptions[] + uint16 ResetCapability + uint16 PowerManagementCapabilities[] + uint64 OnTimeInMilliseconds + uint32 ProcessID + datetime TimeOfLastConfigurationChange + uint16 NumberOfNumaNodes + uint16 ReplicationState + uint16 ReplicationHealth + uint16 ReplicationMode + uint16 FailedOverReplicationType + uint16 LastReplicationType + datetime LastApplicationConsistentReplicationTime + datetime LastReplicationTime + datetime LastSuccessfulBackupTime + uint16 EnhancedSessionModeState +end + + class Msvm_ConcreteJob string Caption string Description @@ -96,6 +145,51 @@ class Msvm_ConcreteJob end =20 =20 +class v2/Msvm_ConcreteJob + 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 + string JobStatus + datetime TimeSubmitted + datetime ScheduledStartTime + datetime StartTime + datetime ElapsedTime + uint32 JobRunTimes + uint8 RunMonth + sint8 RunDay + sint8 RunDayOfWeek + datetime RunStartInterval + uint16 LocalOrUtcTime + datetime UntilTime + string Notify + string Owner + uint32 Priority + uint16 PercentComplete + boolean DeleteOnCompletion + uint16 ErrorCode + string ErrorDescription + string ErrorSummaryDescription + uint16 RecoveryAction + string OtherRecoveryAction + uint16 JobState + datetime TimeOfLastStateChange + datetime TimeBeforeRemoval + boolean Cancellable + uint16 JobType +end + + class Msvm_MemorySettingData string Caption string Description @@ -126,6 +220,38 @@ class Msvm_MemorySettingData end =20 =20 +class v2/Msvm_MemorySettingData + string InstanceID + string Caption + string Description + string ElementName + uint16 ResourceType + string OtherResourceType + string ResourceSubType + string PoolID + uint16 ConsumerVisibility + string HostResource[] + string AllocationUnits + uint64 VirtualQuantity + uint64 Reservation + uint64 Limit + uint32 Weight + boolean AutomaticAllocation + boolean AutomaticDeallocation + string Parent + string Connection[] + string Address + uint16 MappingBehavior + string AddressOnParent + string VirtualQuantityUnits + boolean DynamicMemoryEnabled + uint32 TargetMemoryBuffer + boolean IsVirtualized + boolean SwapFilesInUse + uint64 MaxMemoryBlocksPerNumaNode +end + + class Msvm_ProcessorSettingData string Caption string Description @@ -159,6 +285,37 @@ class Msvm_ProcessorSettingData end =20 =20 +class v2/Msvm_ProcessorSettingData + string InstanceID + string Caption + string Description + string ElementName + uint16 ResourceType + string OtherResourceType + string ResourceSubType + string PoolID + uint16 ConsumerVisibility + string HostResource[] + string AllocationUnits + uint64 VirtualQuantity + uint64 Reservation + uint64 Limit + uint32 Weight + boolean AutomaticAllocation + boolean AutomaticDeallocation + string Parent + string Connection[] + string Address + uint16 MappingBehavior + string AddressOnParent + string VirtualQuantityUnits + boolean LimitCPUID + boolean LimitProcessorFeatures + uint64 MaxProcessorsPerNumaNode + uint64 MaxNumaNodesPerSocket +end + + class Msvm_VirtualSystemSettingData string Caption string Description @@ -184,6 +341,55 @@ class Msvm_VirtualSystemSettingData end =20 =20 +class v2/Msvm_VirtualSystemSettingData + string InstanceID + string Caption + string Description + string ElementName + string VirtualSystemIdentifier + string VirtualSystemType + string Notes[] + datetime CreationTime + string ConfigurationID + string ConfigurationDataRoot + string ConfigurationFile + string SnapshotDataRoot + string SuspendDataRoot + string SwapFileDataRoot + string LogDataRoot + uint16 AutomaticStartupAction + datetime AutomaticStartupActionDelay + uint16 AutomaticStartupActionSequenceNumber + uint16 AutomaticShutdownAction + uint16 AutomaticRecoveryAction + string RecoveryFile + string BIOSGUID + string BIOSSerialNumber + string BaseBoardSerialNumber + string ChassisSerialNumber + string ChassisAssetTag + boolean BIOSNumLock + uint16 BootOrder[] + string Parent + boolean IsSaved + string AdditionalRecoveryInformation + boolean AllowFullSCSICommandSet + uint32 DebugChannelId + uint16 DebugPortEnabled + uint32 DebugPort + string Version + boolean IncrementalBackupEnabled + boolean VirtualNumaEnabled + boolean AllowReducedFcRedundancy + string VirtualSystemSubType + string BootSourceOrder[] + boolean PauseAfterBootFailure + uint16 NetworkBootPreferredProtocol + boolean SecureBootEnabled + uint64 LowMmioGapSize +end + + class Win32_ComputerSystem uint16 AdminPasswordStatus boolean AutomaticManagedPagefile @@ -607,39 +813,6 @@ class Msvm_VirtualSystemGlobalSettingData end =20 =20 -class Msvm_VirtualSwitch - string Caption - string Description - string ElementName - datetime InstallDate - uint16 OperationalStatus[] - string StatusDescriptions[] - string Status - uint16 HealthState - uint16 EnabledState - string OtherEnabledState - uint16 RequestedState - uint16 EnabledDefault - datetime TimeOfLastStateChange - string CreationClassName - string Name - string PrimaryOwnerContact - string PrimaryOwnerName - string Roles[] - string NameFormat - string OtherIdentifyingInfo[] - string IdentifyingDescriptions[] - uint16 Dedicated[] - string OtherDedicatedDescriptions[] - uint16 ResetCapability - uint16 PowerManagementCapabilities[] - string ScopeOfResidence - uint32 NumLearnableAddresses - uint32 MaxVMQOffloads - uint32 MaxChimneyOffloads -end - - class Msvm_ResourceAllocationSettingData string Caption string Description --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 14913448109731011.3831787588808; Tue, 4 Apr 2017 15:26:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D44531F3F4; Tue, 4 Apr 2017 22:26:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DAC6A0FEC; Tue, 4 Apr 2017 22:26:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8A6CB5EC68; Tue, 4 Apr 2017 22:26:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQPkb020681 for ; Tue, 4 Apr 2017 18:26:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78DDD784DE; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71021784D7 for ; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: from mail-qt0-f173.google.com (mail-qt0-f173.google.com [209.85.216.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C558A3269 for ; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: by mail-qt0-f173.google.com with SMTP id r45so151365126qte.3 for ; Tue, 04 Apr 2017 15:26:23 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:21 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D44531F3F4 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3D44531F3F4 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="X4AjuK1q" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1C558A3269 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1C558A3269 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=84Au6jzilSgOtU6Pr+Dvlu9zNPGv4jW2E7de3ZWmM7w=; b=X4AjuK1q575dz99yFVszp6zjznLe02OlHxsMxZnnRzWSBfOl86o+U7EsgPL3i9Ks+y h7+KeNz0VhOIx9A8HZ5p5JiFsmdxDxePPaWdi34UasE8nNfCQ3wz2ZPdFbU2um6t3Ncn VCPcAmAUurc3zZ4vb4SFksaCi2hv3Bya9skhRhbITktpE6Dvmx7uYrQHvgGiH+fotz3x uimW/KRcZ2hToxgzIZ5r2MjE8/NTqaLY502j0LtHCo/eQoKtntVizV9RCIDCV9cSVQCw nEQWJivdEGSUzxovX8y9/BCo90IVuRwulFuj2SYYrV5hxmTHNAoq+vsXOFIhvR0eM+uZ BE6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=84Au6jzilSgOtU6Pr+Dvlu9zNPGv4jW2E7de3ZWmM7w=; b=Gk7MQDqq10oR7Ls1ZNkmtOIMdiPBe8UkKweOv8TdywC5Mq5y75BUhkECkQBNViQ/dt FPBk4FsQcqBRNCXIFgv9LXB+PINru16hnCUTfarFIy1+ly3XdtSY/XH5QCucdk9OKWgo xfmbLNlbq4YTiyouiawyn4XI83Z8iKBydTejr6tiapreax0qRIJgbNOY/IIJHse4SKvc psNB2Ep3BJ+5KFHA0Z5eFNuobfmpS3s+etrP5JBf6p2BA2SGpH7n7ndxnisHHbf4vUhD N9KngdJikIES0U7zWSxAPcidpYI/6PPl23MPzl0f1ggktDlvdw48jvLKNzfqaVthWZWq +j9Q== X-Gm-Message-State: AFeK/H31osMWkCWAzR4uIIQnFgmOrK0z4FITANPlDsqu+ISxP+2zt+ZLBormnUrpe+veEfQv X-Received: by 10.237.62.234 with SMTP id o39mr26136856qtf.87.1491344781864; Tue, 04 Apr 2017 15:26:21 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:11 -0400 Message-Id: <20170404222616.15382-8-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:23 +0000 (UTC) for IP:'209.85.216.173' DOMAIN:'mail-qt0-f173.google.com' HELO:'mail-qt0-f173.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.173 mail-qt0-f173.google.com 209.85.216.173 mail-qt0-f173.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 07/12] hyperv: update wmi code generator. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 04 Apr 2017 22:26:49 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch updates the code generator that outputs C headers and code for WMI classes. It has been updated to handle multiple versions (or namespaces) of the same class which were introduced with Hyperv 2012+ --- src/hyperv/hyperv_wmi_generator.py | 381 ++++++++++++++++++++++++++++-----= ---- 1 file changed, 286 insertions(+), 95 deletions(-) diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 8c62882..3e7ef59 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -24,130 +24,310 @@ import sys import os import os.path =20 +separator =3D "/*" + ("*" * 50) + "*\n" +wmi_version_separator =3D "/" +wmi_classes_by_name =3D {} + +class WmiClass: + """Represents WMI class and provides methods to generate C code. + + This class holds one or more instances of WmiClassVersion because with= the + Windows 2012 release, Microsoft introduced "v2" version of Msvm_* fami= ly of + classes that need different URI for making wsman requests and also have + some additional/changed properties (though many of the properies are t= he + same as in "v1". Therefore, this class makes sure that C code is gener= ated + for each of them while avoiding name conflics, identifies common membe= rs, + and defined *_WmiInfo structs holding info about each version so the d= river + code can make the right choices based on which Hyper-V host it's conne= cted + to. + """ + + def __init__(self, name, versions =3D []): + self.name =3D name + self.versions =3D versions + self.common =3D None =20 =20 -separator =3D "/* " + ("* " * 37) + "*\n" + def prepare(self): + """Prepares the class for code generation =20 + Makes sure that "versioned" classes are sorted by version, identif= ies + common properies and ensures that they are aligned by name and + type in each version + """ + # sort vesioned classes by version in case input file did not have= them + # in order + self.versions =3D sorted(self.versions, key=3Dlambda cls: cls.vers= ion) =20 + # if there's more than one verion make sure first one has name suf= fixed + # because we'll generate "common" memeber and will be the "base" n= ame + if len(self.versions) > 1: + first =3D self.versions[0] + if first.version =3D=3D None: + first.version =3D "v1" + first.name =3D "%s_%s" % (first.name, first.version) =20 -class Class: - def __init__(self, name, properties): - self.name =3D name - self.properties =3D properties + # finally, identify common members in all versions and make sure t= hey + # are in the same order - to ensure C struct member alignment + self._align_property_members() =20 =20 - def generate_header(self): + def generate_classes_header(self): + """Generate C header code and return it as string + + Declares: + _Data - used as one of hypervObject->data members + _TypeInfo - used as wsman XmlSerializerInfo + - "inherits" hypervObject struct + """ + name_upper =3D self.name.upper() =20 header =3D separator header +=3D " * %s\n" % self.name header +=3D " */\n" header +=3D "\n" - header +=3D "int hypervGet%sList(hypervPrivate *priv, virBufferPtr= query, %s **list);\n" \ - % (self.name.replace("_", ""), self.name) - header +=3D "\n" + header +=3D "#define %s_CLASSNAME \\\n" % name_upper + header +=3D " \"%s\"\n" % self.name header +=3D "\n" + header +=3D "#define %s_WQL_SELECT \\\n" % name_upper + header +=3D " \"SELECT * FROM %s \"\n" % self.name header +=3D "\n" + header +=3D "extern hypervWmiClassInfoListPtr %s_WmiInfo;\n\n" % s= elf.name + + header +=3D self._declare_data_structs() + header +=3D self._declare_hypervObject_struct() =20 return header =20 =20 + def generate_classes_source(self): + """Returns a C code string defining wsman data structs + + Defines: + _Data structs + _WmiInfo - list holding metadata (e.g. request URIs)= for + each known version of WMI class. + """ + + source =3D separator + source +=3D " * %s\n" % self.name + source +=3D " */\n" + + for cls in self.versions: + source +=3D "SER_START_ITEMS(%s_Data)\n" % cls.name + + for property in cls.properties: + source +=3D property.generate_classes_source(cls.name) + + source +=3D "SER_END_ITEMS(%s_Data);\n\n" % cls.name + + + source +=3D self._define_WmiInfo_struct() + source +=3D "\n\n" + + return source + + def generate_classes_typedef(self): - typedef =3D "typedef struct _%s_Data %s_Data;\n" % (self.name, sel= f.name) - typedef +=3D "typedef struct _%s %s;\n" % (self.name, self.name) + """Returns C string for typdefs""" + + typedef =3D "typedef struct _%s %s;\n" % (self.name, self.name) + + if self.common is not None: + typedef +=3D "typedef struct _%s_Data %s_Data;\n" % (self.name= , self.name) + + for cls in self.versions: + typedef +=3D "typedef struct _%s_Data %s_Data;\n" % (cls.name,= cls.name) =20 return typedef =20 =20 - def generate_classes_header(self): - name_upper =3D self.name.upper() =20 - header =3D separator - header +=3D " * %s\n" % self.name - header +=3D " */\n" - header +=3D "\n" - header +=3D "#define %s_RESOURCE_URI \\\n" % name_upper + def _declare_data_structs(self): + """Returns string C code declaring data structs. =20 - if self.name.startswith("Win32_") or self.name.startswith("CIM_"): - header +=3D " \"http://schemas.microsoft.com/wbem/wsman/1/w= mi/root/cimv2/%s\"\n" % self.name - else: - header +=3D " \"http://schemas.microsoft.com/wbem/wsman/1/w= mi/root/virtualization/%s\"\n" % self.name + The *_Data structs are members of hypervObject data union. Each on= e has + corresponding *_TypeInfo that is used for wsman unserialization of + response XML into the *_Data structs. If there's a "common" member= , it + won't have corresponding *_TypeInfo becuase this is a special case= only + used to provide a common "view" of v1, v2 etc members + """ =20 - header +=3D "\n" - header +=3D "#define %s_CLASSNAME \\\n" % name_upper - header +=3D " \"%s\"\n" % self.name - header +=3D "\n" - header +=3D "#define %s_WQL_SELECT \\\n" % name_upper - header +=3D " \"select * from %s \"\n" % self.name - header +=3D "\n" - header +=3D "struct _%s_Data {\n" % self.name + header =3D "" + if self.common is not None: + header +=3D "struct _%s_Data {\n" % self.name + for property in self.common: + header +=3D property.generate_classes_header() + header +=3D "};\n\n" =20 - for property in self.properties: - header +=3D property.generate_classes_header() + # Declare actual data struct for each versions + for cls in self.versions: + header +=3D "#define %s_RESOURCE_URI \\\n" % cls.name.upper() + header +=3D " \"%s\"\n" % cls.uri_info.resourceUri + header +=3D "\n" + header +=3D "struct _%s_Data {\n" % cls.name + for property in cls.properties: + header +=3D property.generate_classes_header() + header +=3D "};\n\n" + header +=3D "SER_DECLARE_TYPE(%s_Data);\n" % cls.name =20 - header +=3D "};\n" - header +=3D "\n" - header +=3D "SER_DECLARE_TYPE(%s_Data);\n" % self.name - header +=3D "\n" + return header + + + def _declare_hypervObject_struct(self): + """Return string for C code declaring hypervObject instance""" + + header =3D "\n/* must match hypervObject */\n" header +=3D "struct _%s {\n" % self.name - header +=3D " XmlSerializerInfo *serializerInfo;\n" - header +=3D " %s_Data *data;\n" % self.name + header +=3D " union {\n" + + # if there's common use it as "common" else first and only version= is + # the "common" member + if self.common is not None: + header +=3D " %s_Data *common;\n" % self.name + else: + header +=3D " %s_Data *common;\n" % self.versions[0].na= me + + for cls in self.versions: + header +=3D " %s_Data *%s;\n" % (cls.name, cls.version) + + header +=3D " } data;\n" + header +=3D " hypervWmiClassInfoPtr info;\n" header +=3D " %s *next;\n" % self.name header +=3D "};\n" - header +=3D "\n" - header +=3D "\n" - header +=3D "\n" + + header +=3D "\n\n\n" =20 return header =20 =20 - def generate_source(self): - name_upper =3D self.name.upper() + def _define_WmiInfo_struct(self): + """Return string for C code defining *_WmiInfo struct =20 - source =3D separator - source +=3D " * %s\n" % self.name - source +=3D " */\n" - source +=3D "\n" - source +=3D "int\n" - source +=3D "hypervGet%sList(hypervPrivate *priv, virBufferPtr que= ry, %s **list)\n" \ - % (self.name.replace("_", ""), self.name) - source +=3D "{\n" - - if self.name.startswith("Win32_") or self.name.startswith("CIM_"): - source +=3D " return hypervEnumAndPull(priv, query, ROOT_CI= MV2,\n" - else: - source +=3D " return hypervEnumAndPull(priv, query, ROOT_VI= RTUALIZATION,\n" + Those structs hold info with meta-data needed to make wsman reques= ts for + each version of WMI class + """ =20 - source +=3D " %s_Data_TypeInfo,\n" % s= elf.name - source +=3D " %s_RESOURCE_URI,\n" % na= me_upper - source +=3D " %s_CLASSNAME,\n" % name_= upper - source +=3D " (hypervObject **)list);\= n" - source +=3D "}\n" - source +=3D "\n" - source +=3D "\n" - source +=3D "\n" + source =3D "hypervWmiClassInfoListPtr %s_WmiInfo =3D &(hypervWmiCl= assInfoList) {\n" % self.name + source +=3D " .count =3D %d,\n" % len(self.versions) + source +=3D " .objs =3D (hypervWmiClassInfoPtr []) {\n" + + for cls in self.versions: + source +=3D " &(hypervWmiClassInfo) {\n" + source +=3D " .name =3D %s_CLASSNAME,\n" % self.nam= e.upper() + if cls.version is not None: + source +=3D " .version =3D \"%s\",\n" % cls.ver= sion + else: + source +=3D " .version =3D NULL,\n" + source +=3D " .rootUri =3D %s,\n" % cls.uri_info.ro= otUri + source +=3D " .resourceUri =3D %s_RESOURCE_URI,\n" = % cls.name.upper() + source +=3D " .serializerInfo =3D %s_Data_TypeInfo\= n" % cls.name + source +=3D " },\n" + + source +=3D " }\n" + source +=3D "};\n" =20 return source =20 =20 - def generate_classes_source(self): - name_upper =3D self.name.upper() + def _align_property_members(self): + """Identifies common properties in all class versions. =20 - source =3D separator - source +=3D " * %s\n" % self.name - source +=3D " */\n" - source +=3D "\n" - source +=3D "SER_START_ITEMS(%s_Data)\n" % self.name + Makes sure that properties in all versions are ordered with common + members first and that they are in the same order. This makes the + generated C structs memory aligned and safe to access via the "com= mon" + struct that "shares" members with v1, v2 etc. + """ =20 - for property in self.properties: - source +=3D property.generate_classes_source(self.name) + num_classes =3D len(self.versions) + common =3D {} + property_info =3D {} =20 - source +=3D "SER_END_ITEMS(%s_Data);\n" % self.name - source +=3D "\n" - source +=3D "\n" - source +=3D "\n" + if num_classes < 2: + return + + # count property occurences in all class versions + for cls in self.versions: + for prop in cls.properties: + # consdered same if matches by name AND type + key =3D "%s_%s" % (prop.name, prop.type) + + if key in property_info: + property_info[key][1] +=3D 1 + else: + property_info[key] =3D [prop, 1] + + # isolate those that are common for all and keep track of their po= stions + pos =3D 0 + for key in property_info: + info =3D property_info[key] + # exists in all class versions + if info[1] =3D=3D num_classes: + common[info[0].name] =3D [info[0], pos] + pos +=3D 1 + + # alter each versions's property list so that common members are f= irst + # and in the same order as in the common dictionary + total =3D len(common) + for cls in self.versions: + index =3D 0 + count =3D len(cls.properties) + + while index < count: + prop =3D cls.properties[index] + + # it's a "common" property + if prop.name in common: + pos =3D common[prop.name][1] + + # move to the same position as in "common" dictionary + if index !=3D pos: + tmp =3D cls.properties[pos] + cls.properties[pos] =3D prop + cls.properties[index] =3D tmp + else: + index +=3D 1 + else: + index +=3D 1 + + # finally, get common properties as list sorted by position in dic= tionary + tmp =3D sorted(common.values(), key=3Dlambda x: x[1]) + self.common =3D [] + for x in tmp: + self.common.append(x[0]) + + + +class ClassUriInfo: + """Prepares URI information needed for wsman requests.""" + + def __init__(self, wmi_name, version): + self.rootUri =3D "ROOT_CIMV2" + self.resourceUri =3D None + baseUri =3D "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/ci= mv2" + + if wmi_name.startswith("Msvm_"): + baseUri =3D "http://schemas.microsoft.com/wbem/wsman/1/wmi/roo= t/virtualization" + self.rootUri =3D "ROOT_VIRTUALIZATION" + + if version =3D=3D "v2": + baseUri +=3D "/v2" + self.rootUri =3D "ROOT_VIRTUALIZATION_V2" + + self.resourceUri =3D "%s/%s" % (baseUri, wmi_name) + + + +class WmiClassVersion: + """Represents specific version of WMI class.""" + + def __init__(self, name, version, properties, uri_info): + self.name =3D name + self.version =3D version + self.properties =3D properties + self.uri_info =3D uri_info =20 - return source =20 =20 class Property: @@ -155,9 +335,13 @@ class Property: "string" : "STR", "datetime" : "STR", "int8" : "INT8", + "sint8" : "INT8", "int16" : "INT16", + "sint16" : "INT16", "int32" : "INT32", + "sint32" : "INT32", "int64" : "INT64", + "sint64" : "INT64", "uint8" : "UINT8", "uint16" : "UINT16", "uint32" : "UINT32", @@ -189,8 +373,6 @@ class Property: return " SER_NS_%s(%s_RESOURCE_URI, \"%s\", 1),\n" \ % (Property.typemap[self.type], class_name.upper(), sel= f.name) =20 - - def open_and_print(filename): if filename.startswith("./"): print " GEN " + filename[2:] @@ -217,8 +399,15 @@ def parse_class(block): assert header_items[0] =3D=3D "class" =20 name =3D header_items[1] - properties =3D [] + version =3D None + wmi_name =3D name + ns_separator =3D name.find(wmi_version_separator) + + if ns_separator !=3D -1: + version =3D name[:ns_separator] + wmi_name =3D name[ns_separator + 1:] + name =3D "%s_%s" % (wmi_name, version) =20 for line in block[1:]: # expected format: @@ -236,7 +425,13 @@ def parse_class(block): properties.append(Property(type=3Ditems[0], name=3Ditems[1], is_array=3Dis_array)) =20 - return Class(name=3Dname, properties=3Dproperties) + cls =3D WmiClassVersion(name=3Dname, version=3Dversion, properties=3Dp= roperties, + uri_info=3DClassUriInfo(wmi_name, version)) + + if wmi_name in wmi_classes_by_name: + wmi_classes_by_name[wmi_name].versions.append(cls) + else: + wmi_classes_by_name[wmi_name] =3D WmiClass(wmi_name, [cls]) =20 =20 =20 @@ -248,15 +443,13 @@ def main(): input_filename =3D os.path.join(os.getcwd(), "hyperv_wmi_generator= .input") output_dirname =3D os.getcwd() =20 - header =3D open_and_print(os.path.join(output_dirname, "hyperv_wmi.gen= erated.h")) - source =3D open_and_print(os.path.join(output_dirname, "hyperv_wmi.gen= erated.c")) + classes_typedef =3D open_and_print(os.path.join(output_dirname, "hyper= v_wmi_classes.generated.typedef")) classes_header =3D open_and_print(os.path.join(output_dirname, "hyperv= _wmi_classes.generated.h")) classes_source =3D open_and_print(os.path.join(output_dirname, "hyperv= _wmi_classes.generated.c")) =20 # parse input file number =3D 0 - classes_by_name =3D {} block =3D None =20 for line in file(input_filename, "rb").readlines(): @@ -279,8 +472,7 @@ def main(): if block is not None: if line =3D=3D "end": if block[0][1].startswith("class"): - cls =3D parse_class(block) - classes_by_name[cls.name] =3D cls + parse_class(block) =20 block =3D None else: @@ -289,21 +481,20 @@ def main(): # write output files notice =3D "/* Generated by hyperv_wmi_generator.py */\n\n\n\n" =20 - header.write(notice) - source.write(notice) classes_typedef.write(notice) classes_header.write(notice) classes_source.write(notice) =20 - names =3D classes_by_name.keys() + names =3D wmi_classes_by_name.keys() names.sort() =20 for name in names: - header.write(classes_by_name[name].generate_header()) - source.write(classes_by_name[name].generate_source()) - classes_typedef.write(classes_by_name[name].generate_classes_typed= ef()) - classes_header.write(classes_by_name[name].generate_classes_header= ()) - classes_source.write(classes_by_name[name].generate_classes_source= ()) + cls =3D wmi_classes_by_name[name] + cls.prepare() + + classes_typedef.write(cls.generate_classes_typedef()) + classes_header.write(cls.generate_classes_header()) + classes_source.write(cls.generate_classes_source()) =20 =20 =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344807214742.9720787015344; Tue, 4 Apr 2017 15:26:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7393051EE7; Tue, 4 Apr 2017 22:26:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44768189AE; Tue, 4 Apr 2017 22:26:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EF2AD5EC60; Tue, 4 Apr 2017 22:26:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQPCG020676 for ; Tue, 4 Apr 2017 18:26:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 10DE89AB62; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08CE09AB5C for ; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: from mail-qt0-f170.google.com (mail-qt0-f170.google.com [209.85.216.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 918E980460 for ; Tue, 4 Apr 2017 22:26:23 +0000 (UTC) Received: by mail-qt0-f170.google.com with SMTP id n21so151624812qta.1 for ; Tue, 04 Apr 2017 15:26:23 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:21 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7393051EE7 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7393051EE7 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="hMYNrue6" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 918E980460 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 918E980460 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=3CmBIdYbBMiSV2JquGVzOyk8qQ0x0r6r/WMenB83EGQ=; b=hMYNrue6GDVModF2H4kQ1442d6xmc22wCSHG63vjB8luXBv/jVPgwAajNjpskb+aOk MB7OBjD9VNwfycNUvLG5+flyZ/9bPnKYwEVwXw/zlqdaMJIobyd5nC2PKtRinMtg/4Do PCpgNwKKP/0pi8fJJq8IfIl4JcShYh2O4U2Fzp2cORCTmczN3Um/mEanZ0WWwYO//Z48 pT2yCKavZ5BjqTpr6wTovHcrp6bRL5EndGeFr6NZ9P2aDzucEIEnN2mtVDb+NKaiy4hc UM4iJsMTuA/4kPklHEp1Tb4bJtp3y1GPvqLOVETUrgJtScNcQCMt6kiClbMGi0qrxqPw IdQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=3CmBIdYbBMiSV2JquGVzOyk8qQ0x0r6r/WMenB83EGQ=; b=g58XK/8pCk0Pjz52+Cdobbz8bo6GqSlZlQqsPQ5j5sGlkEc6jUm+JP6RYILFgviUjB kv5SODPgKbXmdLYxaTCA64MMC5EgsZ+o9iHxSwCFLoszCVr5290kW0+gt2xBBFc/yjch oIHd4a5oyi6aX92zc4XQ24vf6LK8M7enxbmKTad7SX/5OyuaDK1SH2+ab/TSRQPRLs9e wg0W3q4CPlrJWoXV1DlZ2agxYPjAD3qJ4OEXg1oVpMhOxyHquKMvORAxNrsKItc6z+ll 06N9+FoS7JzN6bH4M12KQF/7Gkg+TjGHPUAa45tPgoRvXs4EmLvck9T6I4CGBnfG3PL9 PByA== X-Gm-Message-State: AFeK/H3aHAGAqb4lap3t/7uTJ6vGReFf9GlKX7IJUc+cHNAqydpPeViiM1pTlbNV/Ns6myj1 X-Received: by 10.200.50.165 with SMTP id z34mr25027700qta.205.1491344782388; Tue, 04 Apr 2017 15:26:22 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:12 -0400 Message-Id: <20170404222616.15382-9-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 04 Apr 2017 22:26:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 04 Apr 2017 22:26:23 +0000 (UTC) for IP:'209.85.216.170' DOMAIN:'mail-qt0-f170.google.com' HELO:'mail-qt0-f170.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.170 mail-qt0-f170.google.com 209.85.216.170 mail-qt0-f170.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 08/12] hyperv: add helper for getting WMI class lists. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:46 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Those used to be auto-generated and are hand-written now intead. The reason being that those are not very useful and better replacements are in order once the driver itself implements more of the API and common patterns start to emerge. --- src/Makefile.am | 2 - src/hyperv/hyperv_wmi.c | 81 +++++++++++++++++++++++++++++++++++++= ---- src/hyperv/hyperv_wmi.h | 24 +++++++++++- src/hyperv/hyperv_wmi_classes.h | 8 ++++ 4 files changed, 104 insertions(+), 11 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 75e4344..99f5229 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -910,8 +910,6 @@ HYPERV_DRIVER_SOURCES =3D \ hyperv/openwsman.h =20 HYPERV_DRIVER_GENERATED =3D \ - hyperv/hyperv_wmi.generated.c \ - hyperv/hyperv_wmi.generated.h \ hyperv/hyperv_wmi_classes.generated.c \ hyperv/hyperv_wmi_classes.generated.h \ hyperv/hyperv_wmi_classes.generated.typedef diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index eab6192..a853f75 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -36,12 +36,6 @@ =20 #define WS_SERIALIZER_FREE_MEM_WORKS 0 =20 -#define ROOT_CIMV2 \ - "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/*" - -#define ROOT_VIRTUALIZATION \ - "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/*" - #define VIR_FROM_THIS VIR_FROM_HYPERV =20 =20 @@ -81,6 +75,18 @@ hypervGetWmiClassInfo(hypervPrivate *priv, hypervWmiClas= sInfoListPtr list, return -1; } =20 +static int +hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfoListPtr wmiIn= fo, + virBufferPtr query, hypervObject **wmiClass) +{ + hypervWqlQuery wqlQuery =3D HYPERV_WQL_QUERY_INITIALIZER; + + wqlQuery.info =3D wmiInfo; + wqlQuery.query =3D *query; + + return hypervEnumAndPull(priv, &wqlQuery, wmiClass); +} + int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, const char *detail) @@ -701,5 +707,66 @@ hypervMsvmComputerSystemFromDomain(virDomainPtr domain, } =20 =20 +int +hypervGetMsvmComputerSystemList(hypervPrivate *priv, virBufferPtr query, + Msvm_ComputerSystem **list) +{ + return hypervGetWmiClassList(priv, Msvm_ComputerSystem_WmiInfo, query, + (hypervObject **) list); +} + + +int +hypervGetMsvmConcreteJobList(hypervPrivate *priv, virBufferPtr query, + Msvm_ConcreteJob **list) +{ + return hypervGetWmiClassList(priv, Msvm_ConcreteJob_WmiInfo, query, + (hypervObject **) list); +} + + +int +hypervGetWin32ComputerSystemList(hypervPrivate *priv, virBufferPtr query, + Win32_ComputerSystem **list) +{ + return hypervGetWmiClassList(priv, Win32_ComputerSystem_WmiInfo, query, + (hypervObject **) list); +} + + +int +hypervGetWin32ProcessorList(hypervPrivate *priv, virBufferPtr query, + Win32_Processor **list) +{ + return hypervGetWmiClassList(priv, Win32_Processor_WmiInfo, query, + (hypervObject **) list); +} + + +int +hypervGetMsvmVirtualSystemSettingDataList(hypervPrivate *priv, + virBufferPtr query, + Msvm_VirtualSystemSettingData **= list) +{ + return hypervGetWmiClassList(priv, Msvm_VirtualSystemSettingData_WmiIn= fo, query, + (hypervObject **) list); +} + + +int +hypervGetMsvmProcessorSettingDataList(hypervPrivate *priv, + virBufferPtr query, + Msvm_ProcessorSettingData **list) +{ + return hypervGetWmiClassList(priv, Msvm_ProcessorSettingData_WmiInfo, = query, + (hypervObject **) list); +} + =20 -#include "hyperv_wmi.generated.c" +int +hypervGetMsvmMemorySettingDataList(hypervPrivate *priv, virBufferPtr query, + Msvm_MemorySettingData **list) +{ + return hypervGetWmiClassList(priv, Msvm_MemorySettingData_WmiInfo, que= ry, + (hypervObject **) list); +} diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index b8b9c3d..ea95c18 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -109,7 +109,29 @@ enum _Msvm_ReturnCode { =20 const char *hypervReturnCodeToString(int returnCode); =20 +/* Generic "Get WMI class list" */ +int hypervGetMsvmComputerSystemList(hypervPrivate *priv, virBufferPtr quer= y, + Msvm_ComputerSystem **list); =20 +int hypervGetMsvmConcreteJobList(hypervPrivate *priv, virBufferPtr query, + Msvm_ConcreteJob **list); + +int hypervGetWin32ComputerSystemList(hypervPrivate *priv, virBufferPtr que= ry, + Win32_ComputerSystem **list); + +int hypervGetWin32ProcessorList(hypervPrivate *priv, virBufferPtr query, + Win32_Processor **list); + +int hypervGetMsvmVirtualSystemSettingDataList(hypervPrivate *priv, + virBufferPtr query, + Msvm_VirtualSystemSettingDat= a **list); + +int hypervGetMsvmProcessorSettingDataList(hypervPrivate *priv, + virBufferPtr query, + Msvm_ProcessorSettingData **list= ); + +int hypervGetMsvmMemorySettingDataList(hypervPrivate *priv, virBufferPtr q= uery, + Msvm_MemorySettingData **list); =20 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * * Msvm_ComputerSystem @@ -133,6 +155,4 @@ int hypervMsvmComputerSystemFromDomain(virDomainPtr dom= ain, =20 =20 =20 -# include "hyperv_wmi.generated.h" - #endif /* __HYPERV_WMI_H__ */ diff --git a/src/hyperv/hyperv_wmi_classes.h b/src/hyperv/hyperv_wmi_classe= s.h index b0f3e3c..0b8e29c 100644 --- a/src/hyperv/hyperv_wmi_classes.h +++ b/src/hyperv/hyperv_wmi_classes.h @@ -28,6 +28,14 @@ # include "hyperv_wmi_classes.generated.typedef" =20 =20 +# define ROOT_CIMV2 \ + "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/*" + +# define ROOT_VIRTUALIZATION \ + "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/*" + +# define ROOT_VIRTUALIZATION_V2 \ + "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/= *" =20 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * * Msvm_ComputerSystem --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344815660322.765626089115; Tue, 4 Apr 2017 15:26:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C1FF1556C; Tue, 4 Apr 2017 22:26:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19B909D057; Tue, 4 Apr 2017 22:26:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C334C18523CF; Tue, 4 Apr 2017 22:26:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQQed020699 for ; Tue, 4 Apr 2017 18:26:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id B38B27FCEC; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AACFB784D7 for ; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 519C3A3292 for ; Tue, 4 Apr 2017 22:26:24 +0000 (UTC) Received: by mail-qk0-f169.google.com with SMTP id d10so155310060qke.1 for ; Tue, 04 Apr 2017 15:26:24 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:22 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C1FF1556C Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4C1FF1556C Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="HDrrInc/" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 519C3A3292 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 519C3A3292 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=RbCD0Lgc4HovjGMzSdDo6QHMllNqdAK6RB/VJa/OdQ0=; b=HDrrInc/g63DLcFD9kJbOKhQFWrJ0FMyHDw0czmgZqJqMp05+nU+PM9iaF/kaxEnnl 3KznLOD4ly6e7vio5Sa9wYBntauOp+UfDvC3oMaE/c330HC+3PpStOc50D8O+1b3z1dV S4TVrTl8Z2nNrJd/5fC3MGmKTdeU0hM/ubct55cJhwMxALrUGIORlZSPH6V1IEVOeGiQ CxsEmFtEb0ioVwS6qvADcw0cEyXfZY+nwzGLBCscTrLvq0evMIpqI9jZcSC2ns0eoM7+ rStrDyrWHsYsQzwLRDenvbixl3qfpe3FZMJEReQgqikis55GPrwTy/uQoBbI9zo5QZw/ 5xnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=RbCD0Lgc4HovjGMzSdDo6QHMllNqdAK6RB/VJa/OdQ0=; b=pIey1IpPmhAlaIRSwmJG+uUfyy8K1DX0lVM5/YnzZq9oDJxRX0QZVswNqlbXYxe+8c oPZnU4h8pwR/66IxmItjKoVcVxb9ipnxEVLmQGglExQtccHnOwVmo6ibx/K8ZqX/jBR9 tuDldL43vLfUgu6LijUa2ZCKGsWzKdoYFjFkwqL6d37do8VU+sw7K1zRHS20TTzq8/9n uvs1bE6x/CD/xvBBW0EObP35jT4kDaEclpCppbkbOPQckV9vWWh/PZHW0B/TTTw2e9Sc m41c3Vq2VKdUkKNpgghU5NzQnltRkLeYVC2sGFKr5bexMPg39JAY9O/oXrW4fv6Pwksk svtw== X-Gm-Message-State: AFeK/H1BZYoRAKWr+eqiJfeNLxf0kPttp/fGMhGZeVhnCnU4Nwf0ipn1wPBvQL2PtNZ/+1rl X-Received: by 10.55.161.6 with SMTP id k6mr10193565qke.148.1491344783101; Tue, 04 Apr 2017 15:26:23 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:13 -0400 Message-Id: <20170404222616.15382-10-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:24 +0000 (UTC) for IP:'209.85.220.169' DOMAIN:'mail-qk0-f169.google.com' HELO:'mail-qk0-f169.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 1.969 * (BAYES_50, DCC_CHECK, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.169 mail-qk0-f169.google.com 209.85.220.169 mail-qk0-f169.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 09/12] hyperv: port rest of the driver to new stucts. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 04 Apr 2017 22:26:55 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" basically s/data->/data.common->/ Because the data member of hypervObject is a union, get the data via the "common" member everywhere - existing driver does not require special handling for v1 vs v2 separately. --- src/hyperv/hyperv_driver.c | 76 +++++++++++++++++++++++-------------------= ---- src/hyperv/hyperv_wmi.c | 21 ++++++++----- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index b642a02..5d01c1f 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -240,7 +240,7 @@ hypervConnectGetHostname(virConnectPtr conn) goto cleanup; } =20 - ignore_value(VIR_STRDUP(hostname, computerSystem->data->DNSHostName)); + ignore_value(VIR_STRDUP(hostname, computerSystem->data.common->DNSHost= Name)); =20 cleanup: hypervFreeObject(priv, (hypervObject *)computerSystem); @@ -282,7 +282,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr in= fo) "{Win32_ComputerSystem.Name=3D\"%s\"} " "where AssocClass =3D Win32_ComputerSystemProcessor " "ResultClass =3D Win32_Processor", - computerSystem->data->Name); + computerSystem->data.common->Name); =20 if (hypervGetWin32ProcessorList(priv, &query, &processorList) < 0) goto cleanup; @@ -295,7 +295,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr in= fo) } =20 /* Strip the string to fit more relevant information in 32 chars */ - tmp =3D processorList->data->Name; + tmp =3D processorList->data.common->Name; =20 while (*tmp !=3D '\0') { if (STRPREFIX(tmp, " ")) { @@ -313,16 +313,16 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr = info) } =20 /* Fill struct */ - if (virStrncpy(info->model, processorList->data->Name, + if (virStrncpy(info->model, processorList->data.common->Name, sizeof(info->model) - 1, sizeof(info->model)) =3D=3D NU= LL) { virReportError(VIR_ERR_INTERNAL_ERROR, _("CPU model %s too long for destination"), - processorList->data->Name); + processorList->data.common->Name); goto cleanup; } =20 - info->memory =3D computerSystem->data->TotalPhysicalMemory / 1024; /* = byte to kilobyte */ - info->mhz =3D processorList->data->MaxClockSpeed; + info->memory =3D computerSystem->data.common->TotalPhysicalMemory / 10= 24; /* byte to kilobyte */ + info->mhz =3D processorList->data.common->MaxClockSpeed; info->nodes =3D 1; info->sockets =3D 0; =20 @@ -331,8 +331,8 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr in= fo) ++info->sockets; } =20 - info->cores =3D processorList->data->NumberOfCores; - info->threads =3D info->cores / processorList->data->NumberOfLogicalPr= ocessors; + info->cores =3D processorList->data.common->NumberOfCores; + info->threads =3D info->cores / processorList->data.common->NumberOfLo= gicalProcessors; info->cpus =3D info->sockets * info->cores; =20 result =3D 0; @@ -372,7 +372,7 @@ hypervConnectListDomains(virConnectPtr conn, int *ids, = int maxids) =20 for (computerSystem =3D computerSystemList; computerSystem !=3D NULL; computerSystem =3D computerSystem->next) { - ids[count++] =3D computerSystem->data->ProcessID; + ids[count++] =3D computerSystem->data.common->ProcessID; =20 if (count >=3D maxids) break; @@ -532,7 +532,7 @@ hypervDomainSuspend(virDomainPtr domain) if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0) goto cleanup; =20 - if (computerSystem->data->EnabledState !=3D + if (computerSystem->data.common->EnabledState !=3D MSVM_COMPUTERSYSTEM_ENABLEDSTATE_ENABLED) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not active")); @@ -560,7 +560,7 @@ hypervDomainResume(virDomainPtr domain) if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0) goto cleanup; =20 - if (computerSystem->data->EnabledState !=3D + if (computerSystem->data.common->EnabledState !=3D MSVM_COMPUTERSYSTEM_ENABLEDSTATE_PAUSED) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not paused")); @@ -666,7 +666,7 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoP= tr info) virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not lookup %s for domain %s"), "Msvm_VirtualSystemSettingData", - computerSystem->data->ElementName); + computerSystem->data.common->ElementName); goto cleanup; } =20 @@ -676,7 +676,7 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoP= tr info) "{Msvm_VirtualSystemSettingData.InstanceID=3D\"%s\"}= " "where AssocClass =3D Msvm_VirtualSystemSettingDataC= omponent " "ResultClass =3D Msvm_ProcessorSettingData", - virtualSystemSettingData->data->InstanceID); + virtualSystemSettingData->data.common->InstanceID); =20 if (hypervGetMsvmProcessorSettingDataList(priv, &query, &processorSettingData) < 0) { @@ -687,7 +687,7 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoP= tr info) virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not lookup %s for domain %s"), "Msvm_ProcessorSettingData", - computerSystem->data->ElementName); + computerSystem->data.common->ElementName); goto cleanup; } =20 @@ -697,7 +697,7 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoP= tr info) "{Msvm_VirtualSystemSettingData.InstanceID=3D\"%s\"}= " "where AssocClass =3D Msvm_VirtualSystemSettingDataC= omponent " "ResultClass =3D Msvm_MemorySettingData", - virtualSystemSettingData->data->InstanceID); + virtualSystemSettingData->data.common->InstanceID); =20 if (hypervGetMsvmMemorySettingDataList(priv, &query, &memorySettingData) < 0) { @@ -709,15 +709,15 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInf= oPtr info) virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not lookup %s for domain %s"), "Msvm_MemorySettingData", - computerSystem->data->ElementName); + computerSystem->data.common->ElementName); goto cleanup; } =20 /* Fill struct */ info->state =3D hypervMsvmComputerSystemEnabledStateToDomainState(comp= uterSystem); - info->maxMem =3D memorySettingData->data->Limit * 1024; /* megabyte to= kilobyte */ - info->memory =3D memorySettingData->data->VirtualQuantity * 1024; /* m= egabyte to kilobyte */ - info->nrVirtCpu =3D processorSettingData->data->VirtualQuantity; + info->maxMem =3D memorySettingData->data.common->Limit * 1024; /* mega= byte to kilobyte */ + info->memory =3D memorySettingData->data.common->VirtualQuantity * 102= 4; /* megabyte to kilobyte */ + info->nrVirtCpu =3D processorSettingData->data.common->VirtualQuantity; info->cpuTime =3D 0; =20 result =3D 0; @@ -803,7 +803,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not lookup %s for domain %s"), "Msvm_VirtualSystemSettingData", - computerSystem->data->ElementName); + computerSystem->data.common->ElementName); goto cleanup; } =20 @@ -813,7 +813,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) "{Msvm_VirtualSystemSettingData.InstanceID=3D\"%s\"}= " "where AssocClass =3D Msvm_VirtualSystemSettingDataC= omponent " "ResultClass =3D Msvm_ProcessorSettingData", - virtualSystemSettingData->data->InstanceID); + virtualSystemSettingData->data.common->InstanceID); =20 if (hypervGetMsvmProcessorSettingDataList(priv, &query, &processorSettingData) < 0) { @@ -824,7 +824,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not lookup %s for domain %s"), "Msvm_ProcessorSettingData", - computerSystem->data->ElementName); + computerSystem->data.common->ElementName); goto cleanup; } =20 @@ -834,7 +834,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) "{Msvm_VirtualSystemSettingData.InstanceID=3D\"%s\"}= " "where AssocClass =3D Msvm_VirtualSystemSettingDataC= omponent " "ResultClass =3D Msvm_MemorySettingData", - virtualSystemSettingData->data->InstanceID); + virtualSystemSettingData->data.common->InstanceID); =20 if (hypervGetMsvmMemorySettingDataList(priv, &query, &memorySettingData) < 0) { @@ -846,7 +846,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned in= t flags) virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not lookup %s for domain %s"), "Msvm_MemorySettingData", - computerSystem->data->ElementName); + computerSystem->data.common->ElementName); goto cleanup; } =20 @@ -854,34 +854,34 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned = int flags) def->virtType =3D VIR_DOMAIN_VIRT_HYPERV; =20 if (hypervIsMsvmComputerSystemActive(computerSystem, NULL)) { - def->id =3D computerSystem->data->ProcessID; + def->id =3D computerSystem->data.common->ProcessID; } else { def->id =3D -1; } =20 - if (virUUIDParse(computerSystem->data->Name, def->uuid) < 0) { + if (virUUIDParse(computerSystem->data.common->Name, def->uuid) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not parse UUID from string '%s'"), - computerSystem->data->Name); + computerSystem->data.common->Name); return NULL; } =20 - if (VIR_STRDUP(def->name, computerSystem->data->ElementName) < 0) + if (VIR_STRDUP(def->name, computerSystem->data.common->ElementName) < = 0) goto cleanup; =20 - if (VIR_STRDUP(def->description, virtualSystemSettingData->data->Notes= ) < 0) + if (VIR_STRDUP(def->description, virtualSystemSettingData->data.common= ->Notes) < 0) goto cleanup; =20 - virDomainDefSetMemoryTotal(def, memorySettingData->data->Limit * 1024)= ; /* megabyte to kilobyte */ - def->mem.cur_balloon =3D memorySettingData->data->VirtualQuantity * 10= 24; /* megabyte to kilobyte */ + virDomainDefSetMemoryTotal(def, memorySettingData->data.common->Limit = * 1024); /* megabyte to kilobyte */ + def->mem.cur_balloon =3D memorySettingData->data.common->VirtualQuanti= ty * 1024; /* megabyte to kilobyte */ =20 if (virDomainDefSetVcpusMax(def, - processorSettingData->data->VirtualQuantit= y, + processorSettingData->data.common->Virtual= Quantity, NULL) < 0) goto cleanup; =20 if (virDomainDefSetVcpus(def, - processorSettingData->data->VirtualQuantity) = < 0) + processorSettingData->data.common->VirtualQua= ntity) < 0) goto cleanup; =20 def->os.type =3D VIR_DOMAIN_OSTYPE_HVM; @@ -930,7 +930,7 @@ hypervConnectListDefinedDomains(virConnectPtr conn, cha= r **const names, int maxn =20 for (computerSystem =3D computerSystemList; computerSystem !=3D NULL; computerSystem =3D computerSystem->next) { - if (VIR_STRDUP(names[count], computerSystem->data->ElementName) < = 0) + if (VIR_STRDUP(names[count], computerSystem->data.common->ElementN= ame) < 0) goto cleanup; =20 ++count; @@ -1154,7 +1154,7 @@ hypervDomainHasManagedSaveImage(virDomainPtr domain, = unsigned int flags) if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0) goto cleanup; =20 - result =3D computerSystem->data->EnabledState =3D=3D + result =3D computerSystem->data.common->EnabledState =3D=3D MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED ? 1 : 0; =20 cleanup: @@ -1177,7 +1177,7 @@ hypervDomainManagedSaveRemove(virDomainPtr domain, un= signed int flags) if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0) goto cleanup; =20 - if (computerSystem->data->EnabledState !=3D + if (computerSystem->data.common->EnabledState !=3D MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain has no managed save image")); @@ -1280,7 +1280,7 @@ hypervConnectListAllDomains(virConnectPtr conn, =20 /* managed save filter */ if (MATCH(VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE)) { - bool mansave =3D computerSystem->data->EnabledState =3D=3D + bool mansave =3D computerSystem->data.common->EnabledState =3D= =3D MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED; =20 if (!((MATCH(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE) && mansave)= || diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index a853f75..cd18134 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -446,6 +446,8 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDom= ainPtr domain, virBuffer query =3D VIR_BUFFER_INITIALIZER; Msvm_ConcreteJob *concreteJob =3D NULL; bool completed =3D false; + const char *resourceUri =3D MSVM_COMPUTERSYSTEM_V2_RESOURCE_URI; + =20 virUUIDFormat(domain->uuid, uuid_string); =20 @@ -454,6 +456,9 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDom= ainPtr domain, virAsprintf(&properties, "RequestedState=3D%d", requestedState) < = 0) goto cleanup; =20 + if (priv->wmiVersion =3D=3D HYPERV_WMI_VERSION_V1) + resourceUri =3D MSVM_COMPUTERSYSTEM_V1_RESOURCE_URI; + options =3D wsmc_options_init(); =20 if (options =3D=3D NULL) { @@ -466,7 +471,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDom= ainPtr domain, wsmc_add_prop_from_str(options, properties); =20 /* Invoke method */ - response =3D wsmc_action_invoke(priv->client, MSVM_COMPUTERSYSTEM_RESO= URCE_URI, + response =3D wsmc_action_invoke(priv->client, resourceUri, options, "RequestStateChange", NULL); =20 if (hypervVerifyResponse(priv->client, response, "invocation") < 0) @@ -515,7 +520,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDom= ainPtr domain, goto cleanup; } =20 - switch (concreteJob->data->JobState) { + switch (concreteJob->data.common->JobState) { case MSVM_CONCRETEJOB_JOBSTATE_NEW: case MSVM_CONCRETEJOB_JOBSTATE_STARTING: case MSVM_CONCRETEJOB_JOBSTATE_RUNNING: @@ -574,7 +579,7 @@ int hypervMsvmComputerSystemEnabledStateToDomainState (Msvm_ComputerSystem *computerSystem) { - switch (computerSystem->data->EnabledState) { + switch (computerSystem->data.common->EnabledState) { case MSVM_COMPUTERSYSTEM_ENABLEDSTATE_UNKNOWN: return VIR_DOMAIN_NOSTATE; =20 @@ -614,7 +619,7 @@ hypervIsMsvmComputerSystemActive(Msvm_ComputerSystem *c= omputerSystem, if (in_transition !=3D NULL) *in_transition =3D false; =20 - switch (computerSystem->data->EnabledState) { + switch (computerSystem->data.common->EnabledState) { case MSVM_COMPUTERSYSTEM_ENABLEDSTATE_UNKNOWN: return false; =20 @@ -659,17 +664,17 @@ hypervMsvmComputerSystemToDomain(virConnectPtr conn, return -1; } =20 - if (virUUIDParse(computerSystem->data->Name, uuid) < 0) { + if (virUUIDParse(computerSystem->data.common->Name, uuid) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not parse UUID from string '%s'"), - computerSystem->data->Name); + computerSystem->data.common->Name); return -1; } =20 if (hypervIsMsvmComputerSystemActive(computerSystem, NULL)) - id =3D computerSystem->data->ProcessID; + id =3D computerSystem->data.common->ProcessID; =20 - *domain =3D virGetDomain(conn, computerSystem->data->ElementName, uuid= , id); + *domain =3D virGetDomain(conn, computerSystem->data.common->ElementNam= e, uuid, id); =20 return *domain ? 0 : -1; } --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344810562267.56214543287376; Tue, 4 Apr 2017 15:26:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 100AA15567; Tue, 4 Apr 2017 22:26:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2DEA9D05E; Tue, 4 Apr 2017 22:26:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8995F18523CE; Tue, 4 Apr 2017 22:26:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQPpH020686 for ; Tue, 4 Apr 2017 18:26:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id B74299AB62; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0E769AB5C for ; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com [209.85.216.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3460445C3 for ; Tue, 4 Apr 2017 22:26:24 +0000 (UTC) Received: by mail-qt0-f172.google.com with SMTP id i34so151729822qtc.0 for ; Tue, 04 Apr 2017 15:26:24 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:23 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 100AA15567 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 100AA15567 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="ozVXrkEO" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C3460445C3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C3460445C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=+d2yUZNmImMrvsV3aieOVDIgyobBzUma7mGtqG4Tjgc=; b=ozVXrkEOPE2m+KxfmirK9Lkih2sbGyMi006qRHS+ftSjDT+lpsR4CB3Qo4il66AQnF qwVoIh4fRJPPPQP4ch3Jd8Bv0mwWv0wslNbCNLxwT5X/6OaZBws6/ZTarp+yN5yutiv7 rVx0OI5H2uyWsNpdu6ySMnMz+3UwfwNiS+aQUwJtaObmyIfHcADvtk1HpqWMdXwU8Oaz OyttcXRc98WKQS25YJqaoLK8oukx2s89BH/Utw/nDwatlXKxBN8YfbBzhlUSqmUECRg3 MQENHHzbLr/GzSyNc2ntPXD14oHJaW/y1nv3waJDT5LduTt4qF8luLZORmjDHY46RSXn U1nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=+d2yUZNmImMrvsV3aieOVDIgyobBzUma7mGtqG4Tjgc=; b=IlgutvfdmTHx90bMJF+tgTOARQVZlg4F72DFcnI5zecITOb92QX/gGRx2uG1S32p6W bGUZNs8gZJiTyBtPkjnSLw9GNIm703P5ZfNKRpxw15a95t7/CsLOAXYMBoKAX8QQAqIu D9vCP9eR+yEz52mWzMsnCrrmT5YT40C5VpEoHRuHH4pIynxijTg2iZjBs3RaSNCnOuZy 35piGyisfBildW7I6u5UaycVHcUto8HRZRcwTTWW1BN+uT/jy0+XpaeJA5Xr12o3P4r/ LBkiscMJF39B5GG/mtD6d/XqBxJ8fcbwty7Ky5hySLkWFvabgufCInFHnIK84te3G1kd MBiw== X-Gm-Message-State: AFeK/H2C3DmwXthH+fqqtOryJSfmCXNgoCS63FgaEF0q+BhPHDumcHW7CSd056XnO2EuCx0U X-Received: by 10.237.37.71 with SMTP id w7mr25102826qtc.34.1491344783656; Tue, 04 Apr 2017 15:26:23 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:14 -0400 Message-Id: <20170404222616.15382-11-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:25 +0000 (UTC) for IP:'209.85.216.172' DOMAIN:'mail-qt0-f172.google.com' HELO:'mail-qt0-f172.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.172 mail-qt0-f172.google.com 209.85.216.172 mail-qt0-f172.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 10/12] hyperv: add hypervInitConnection. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 04 Apr 2017 22:26:49 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This function detects hyperv version by issuing a simple query using "v2" namespace and falling back to "v1". --- src/hyperv/hyperv_driver.c | 90 +++++++++++++++++++++++++++---------------= ---- 1 file changed, 54 insertions(+), 36 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 5d01c1f..34e7f82 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -55,7 +55,60 @@ hypervFreePrivate(hypervPrivate **priv) VIR_FREE(*priv); } =20 +static int +hypervInitConnection(virConnectPtr conn, hypervPrivate *priv, + char *username, char *password) +{ + hypervWqlQuery wqlQuery =3D HYPERV_WQL_QUERY_INITIALIZER; + hypervObject *computerSystem =3D NULL; + int ret =3D -1; =20 + /* Initialize the openwsman connection */ + priv->client =3D wsmc_create(conn->uri->server, conn->uri->port, "/wsm= an", + priv->parsedUri->transport, username, passw= ord); + + if (priv->client =3D=3D NULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not create openwsman client")); + goto cleanup; + } + + if (wsmc_transport_init(priv->client, NULL) !=3D 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not initialize openwsman transport")); + goto cleanup; + } + + /* FIXME: Currently only basic authentication is supported */ + wsman_transport_set_auth_method(priv->client, "basic"); + + virBufferAddLit(&wqlQuery.query, MSVM_COMPUTERSYSTEM_WQL_SELECT); + virBufferAddLit(&wqlQuery.query, "WHERE "); + virBufferAddLit(&wqlQuery.query, MSVM_COMPUTERSYSTEM_WQL_PHYSICAL); + + wqlQuery.info =3D Msvm_ComputerSystem_WmiInfo; + + /* try query using V2 namespace (for Hyperv 2012+) */ + priv->wmiVersion =3D HYPERV_WMI_VERSION_V2; + + if (hypervEnumAndPull(priv, &wqlQuery, &computerSystem) < 0) { + /* fall back to V1 namespace (for Hyper-v 2008) */ + priv->wmiVersion =3D HYPERV_WMI_VERSION_V1; + + if (hypervEnumAndPull(priv, &wqlQuery, &computerSystem) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("%s is not a Hyper-V server"), conn->uri->ser= ver); + goto cleanup; + } + } + + ret =3D 0; + + cleanup: + hypervFreeObject(priv, computerSystem); + + return ret; +} =20 static virDrvOpenStatus hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, @@ -67,8 +120,6 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr = auth, hypervPrivate *priv =3D NULL; char *username =3D NULL; char *password =3D NULL; - virBuffer query =3D VIR_BUFFER_INITIALIZER; - Msvm_ComputerSystem *computerSystem =3D NULL; =20 virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); =20 @@ -147,41 +198,9 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPt= r auth, goto cleanup; } =20 - /* Initialize the openwsman connection */ - priv->client =3D wsmc_create(conn->uri->server, conn->uri->port, "/wsm= an", - priv->parsedUri->transport, username, passw= ord); - - if (priv->client =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Could not create openwsman client")); - goto cleanup; - } - - if (wsmc_transport_init(priv->client, NULL) !=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Could not initialize openwsman transport")); - goto cleanup; - } - - /* FIXME: Currently only basic authentication is supported */ - wsman_transport_set_auth_method(priv->client, "basic"); - - /* Check if the connection can be established and if the server has the - * Hyper-V role installed. If the call to hypervGetMsvmComputerSystemL= ist - * succeeds than the connection has been established. If the returned = list - * is empty than the server isn't a Hyper-V server. */ - virBufferAddLit(&query, MSVM_COMPUTERSYSTEM_WQL_SELECT); - virBufferAddLit(&query, "where "); - virBufferAddLit(&query, MSVM_COMPUTERSYSTEM_WQL_PHYSICAL); - - if (hypervGetMsvmComputerSystemList(priv, &query, &computerSystem) < 0) - goto cleanup; =20 - if (computerSystem =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s is not a Hyper-V server"), conn->uri->server); + if (hypervInitConnection(conn, priv, username, password) < 0) goto cleanup; - } =20 conn->privateData =3D priv; priv =3D NULL; @@ -191,7 +210,6 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr= auth, hypervFreePrivate(&priv); VIR_FREE(username); VIR_FREE(password); - hypervFreeObject(priv, (hypervObject *)computerSystem); =20 return result; } --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344818258545.9093715576439; Tue, 4 Apr 2017 15:26:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 036B8E1CAD; Tue, 4 Apr 2017 22:26:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FCB3A0FE6; Tue, 4 Apr 2017 22:26:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 54B7C5EC68; Tue, 4 Apr 2017 22:26:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQSEA020734 for ; Tue, 4 Apr 2017 18:26:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39D007E22A; Tue, 4 Apr 2017 22:26:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 327847E216 for ; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: from mail-qt0-f172.google.com (mail-qt0-f172.google.com [209.85.216.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C90C4445C3 for ; Tue, 4 Apr 2017 22:26:25 +0000 (UTC) Received: by mail-qt0-f172.google.com with SMTP id n21so151625346qta.1 for ; Tue, 04 Apr 2017 15:26:25 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:23 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 036B8E1CAD Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 036B8E1CAD Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="ZjOFfOOe" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C90C4445C3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C90C4445C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=GRExEeZVJJBivonK3NSA0suNKyfVg4d44omO8vmhhas=; b=ZjOFfOOetk0hiEGfgCAt1E57Vayeui8/RInEIaUCNkVnagV7zdoOLYh1J9xhpyB+ZF MYeTCG25lTth97QZ4BeYlu03Sh1qzCK95y8sKztXu/trq2WtydHNQa6aOgqL4bw49N6e iW/gwjd2ESlXI7xZTDkx0wZh0dD71qBiuLQ6n9AcQNsWzgjoW941c5vcfJK/fPkKU214 JT/Dq1XTRH5awCupqQo/QKKjMJLtRxhHVJgAnFsWipgwvkqkBC1MkDKtPNLkkMWsW+WH HH4buh6s3Re+AfRFFanupTm4FxdgvQlHf3rUEQ0BAAD/deB2CWz2fuPMUEL7ltyaIkFu 60JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=GRExEeZVJJBivonK3NSA0suNKyfVg4d44omO8vmhhas=; b=eurDUnn6z3rvZKpqqXOWrBcjtdBCoNF53SMCOQC9bsyQeEdqL9+vJniNww3kUasTCz DfYOyll7F3TMTVNAwElIrr8AsSweACUtXMrxR7cZhVVmdjGNz6kdmTuiaK0nl4dBj7BI hWt01yYCgr8Lh57S4JkPchcv5mMOFVh91qGzIRzqLxiqThmBMOfedIxPgNwgeSel8Dct gMF4rsPdE5mJOycjGoeuX2S18/QUHlpuS8XOxfIjVYdyYUSVMXd32EE8uYJ51VHwFO7J moSlHMJADzn5peabD5gsLc840w71HqAN/asq3qA19/liO1ZG6aIXlc+084AnB3vIUJmj LRWQ== X-Gm-Message-State: AFeK/H1+sXifMr3/UbFjrSlKiYsvu0iVewQZfgGtL4KcGXErTzsMIPrUFoCwoqmMQiweKPpN X-Received: by 10.237.48.228 with SMTP id 91mr28364817qtf.292.1491344784679; Tue, 04 Apr 2017 15:26:24 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:15 -0400 Message-Id: <20170404222616.15382-12-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 04 Apr 2017 22:26:26 +0000 (UTC) for IP:'209.85.216.172' DOMAIN:'mail-qt0-f172.google.com' HELO:'mail-qt0-f172.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.172 mail-qt0-f172.google.com 209.85.216.172 mail-qt0-f172.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 11/12] hyperv: update driver documentation. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 04 Apr 2017 22:26:57 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- docs/drvhyperv.html.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/drvhyperv.html.in b/docs/drvhyperv.html.in index 7acf86f..411895a 100644 --- a/docs/drvhyperv.html.in +++ b/docs/drvhyperv.html.in @@ -5,7 +5,7 @@

Microsoft Hyper-V hypervisor driver

    - The libvirt Microsoft Hyper-V driver can manage Hyper-V 2008 R2. + The Microsoft Hyper-V driver can manage Hyper-V 2008 R2 and newer.

    =20 =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 01:36:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1491344819235544.1412377196764; Tue, 4 Apr 2017 15:26:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1EF7C05678E; Tue, 4 Apr 2017 22:26:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94B9F80F87; Tue, 4 Apr 2017 22:26:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 51FA25EC6B; Tue, 4 Apr 2017 22:26:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v34MQRRa020721 for ; Tue, 4 Apr 2017 18:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92A998FE4F; Tue, 4 Apr 2017 22:26:27 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C9E9A0FEA for ; Tue, 4 Apr 2017 22:26:27 +0000 (UTC) Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com [209.85.216.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4B3F4E4F3 for ; Tue, 4 Apr 2017 22:26:26 +0000 (UTC) Received: by mail-qt0-f181.google.com with SMTP id x35so151196751qtc.2 for ; Tue, 04 Apr 2017 15:26:26 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id d142sm9590549qkc.32.2017.04.04.15.26.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 15:26:24 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E1EF7C05678E Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E1EF7C05678E Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="pabVU+DP" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B4B3F4E4F3 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B4B3F4E4F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=JYIlDijouJPAmKrC1h3ecnAv+ePLOxERiZn+oILE3uE=; b=pabVU+DP+9Xhqk8NfQS17mv3l7+5ftvlM3iyychN28IAZiVflUAffQfz6xIlVwJwc3 ncDWKXw+LaQs2MIBDHz2KXqxDp0+1v6N/2nb1S2qc23WtWrKnJ7Q0imWGLsJCahglqtj crWgX6u1ZAuegSH1+BpP1npOGR3xeCWYOZwmbnbJ2C50TA3qBQ0pH13vH0/FWuDicoSa cahmwx0pg6luxHx0fN0S1fwA9aWaV9kyGzADnw6BlA1SEkkJyZ/BzjD7SHuzAWsCd6pq CFMm1U9intLM3SMYXoN0G0pTPbq0zVXkwX0JZ/fkWTlvgxJge6OcVxPbmBONIOGugWU5 QFuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=JYIlDijouJPAmKrC1h3ecnAv+ePLOxERiZn+oILE3uE=; b=qoCzGWA8F518CKOkpS6J8QHe4EAeeEShCu6pQOpSiMQi/pmjTxsZGvv5T5WinsFnrB fh/hxtmCVXZWwYCaFkLVf4cEJFUxPRHWoajNVBgFXADfVZ9VrfporczEpPyztXf6SkLJ jf2Y46LSxKn/6QfWl4Tb6BCbF8e+LKH/v5+K/A1kTIEOoSh4IXbRw8JOquj44CNYy1oy uzPbkxez3EljBx1xxObN8siskwY4SCbRp5/1ywMug9lVDLprObvij6s7KSPIwKFYs6ei k4HBbcnchkFD3Wx9kq2pIvCpRo9q6EKle/TUSCxDYWAhJ9JWiCsDR+h7FbOviXJlCO6b L3Gw== X-Gm-Message-State: AFeK/H3/JOvoS4JnJsmG0awn1F6h8SETQ7yUUWUYUuGABx19uB1rRczGRptgC/fVt46CgU5A X-Received: by 10.200.46.155 with SMTP id h27mr28270990qta.158.1491344785672; Tue, 04 Apr 2017 15:26:25 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 4 Apr 2017 18:26:16 -0400 Message-Id: <20170404222616.15382-13-dzamirski@datto.com> In-Reply-To: <20170404222616.15382-1-dzamirski@datto.com> References: <20170404222616.15382-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 04 Apr 2017 22:26:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 04 Apr 2017 22:26:26 +0000 (UTC) for IP:'209.85.216.181' DOMAIN:'mail-qt0-f181.google.com' HELO:'mail-qt0-f181.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.179 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.181 mail-qt0-f181.google.com 209.85.216.181 mail-qt0-f181.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v4 12/12] news: update for Hyper-V 2012+ support. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 04 Apr 2017 22:26:58 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- docs/news.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 9c0dcfd..39631c3 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -37,6 +37,17 @@
    + + + The libvirt Hyper-V driver now supports Hyper-V 2012 and newer. + + + Starting with Hyper-V 2012 the API has changed causing the exi= sting + driver to be unable to send and process requests properly. Thi= s has + been resolved by adding abstractions to handle the differences= and + ease handling such breaks if they happen in the future. + +
    --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list