From nobody Tue Apr 30 18:25:07 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 1491263552943428.5451001982208; Mon, 3 Apr 2017 16:52:32 -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 A328620264; Mon, 3 Apr 2017 23:52:30 +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 6EAC44F9E0; Mon, 3 Apr 2017 23:52:30 +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 204A118521C8; Mon, 3 Apr 2017 23:52:29 +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 v33NqP6G015697 for ; Mon, 3 Apr 2017 19:52:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6857871C99; Mon, 3 Apr 2017 23:52:25 +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 60C414DA61 for ; Mon, 3 Apr 2017 23:52:22 +0000 (UTC) Received: from mail-qk0-f179.google.com (mail-qk0-f179.google.com [209.85.220.179]) (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 EDEC57E9C5 for ; Mon, 3 Apr 2017 23:52:21 +0000 (UTC) Received: by mail-qk0-f179.google.com with SMTP id p22so128711158qka.3 for ; Mon, 03 Apr 2017 16:52:21 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:20 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A328620264 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 A328620264 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="P7YTGDDd" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EDEC57E9C5 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 EDEC57E9C5 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=P7YTGDDdZisOJF2nna5lkDrfmMiNFaXOLYTt0FPjq103FXP87k9f5Snx+yl6DR/6j4 hgYlh2KdJzvmpEdRj/DtP2iLXzLkkzMSNJtCdApuik4EibF7VQb2r1xu4mIl5lQZ+ch2 qiGYzmEQDaAr96iA7LATyoUVE7EUKHoLsjwUu+pHGA/D1Zp6I09K+YsGqHUeDzyBqDqM 0MhuxMSUubtydyccCN95vkpEeVKU/EXJJg0rgotBOwpiz8Ngi3kVSz2OPYHr7N/3IekI 6A6yl2FuAUBfdy2Of4G+UR/2qK/+AtGFgi0Wyg9Td7EbJMaRx0+MkMviyPVpqjT+mTwT aJjA== 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=NvRYXkAar64R1B8UySucSNcZP2Xp3NklfHvYKQVmFddibcifSg+DbirxcqL7qGSaLJ 89GyV6MBNT8kvp8n/mQunSkvslCpEwRLe042uNqlXgcsTyEHHR72lXngvFaUN5Tv38BD aLrW3UqPpsHq8LuvCGod46MtkhxiBWdVMw5o/e0sBkuGTuSQOkV7B1ZWINhHjRmbO/sj eC7RgSnw7DpoirbEq3wX//ie3OreRDLaj0X5ZLRmqVeVGD2YUHK/A0b6NQVeuJRn6la1 HVUPh6YLgHDI0RBjBi28S4OGR2muGcvDm5o0zNLgWtilWjcdh9TpBF+i59eaX18kSfOP nF6g== X-Gm-Message-State: AFeK/H2rxy2jCDPI8IimlAVdYDaGUdtxYrL0inrlQnIpRXDHTM672vsGrXTr4jCTz5qEEO/x X-Received: by 10.55.60.196 with SMTP id j187mr21273403qka.93.1491263541031; Mon, 03 Apr 2017 16:52:21 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:08 -0400 Message-Id: <20170403235219.19721-2-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Apr 2017 23:52:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Apr 2017 23:52:22 +0000 (UTC) for IP:'209.85.220.179' DOMAIN:'mail-qk0-f179.google.com' HELO:'mail-qk0-f179.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.179 mail-qk0-f179.google.com 209.85.220.179 mail-qk0-f179.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 v3 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 23:52:31 +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 Tue Apr 30 18:25:07 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 1491263574041222.37571909630435; Mon, 3 Apr 2017 16:52:54 -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 882A7C03BD6F; Mon, 3 Apr 2017 23:52:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5FC725C6D2; Mon, 3 Apr 2017 23:52: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 1292F5EC66; Mon, 3 Apr 2017 23:52:52 +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 v33NqRnr015708 for ; Mon, 3 Apr 2017 19:52:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 359FB78F19; Mon, 3 Apr 2017 23:52:27 +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 2F63078F30 for ; Mon, 3 Apr 2017 23:52:24 +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 CECA761D03 for ; Mon, 3 Apr 2017 23:52:22 +0000 (UTC) Received: by mail-qt0-f178.google.com with SMTP id r45so126245867qte.3 for ; Mon, 03 Apr 2017 16:52:22 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:21 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 882A7C03BD6F 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 882A7C03BD6F 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="XTmPDqx+" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CECA761D03 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 CECA761D03 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=XTmPDqx+exXyzmEg6Z/TTezgn1KkgIKQXcN2wWLO85rg+CKlAAqs9HQVRfgqPNdo0S P7dcDMxOBtvLoUoDMAs5JQ5kXZ8uCyYY/QgHbx+9kRbvLA7Qo+9u4F/7XfnfyWyUBGtq rRoItEC/9Afe6SwFHaOermg6uF+yKlQptDA4ZtADUeMiA20k84dZcAiltu96vr8BB3QS vRjQtAXtF/KuliR4JFtvqvh88pFP2De6mMtq98N5KhPkRLUeutkySt/nlRju5KwYxnMb wcAXyvRJyz4Ks/KS3XIwk89nFNNdXJllR0aNetuEAM72mzCHuKNhLDVyzV2f7/rr2S4W /jNg== 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=PPC1jzRo1Oil+7+9R3p5KXyCt6te/FUie2Eirbi875Emihgj68Jgd+dcgWgEHohzk9 0UonUJREPRttrMbhqsX5KxtHypTxz8bE1GmaZgFIsqOp47Wxq8YWMHSSsofeibwbHlsc C+0uzavZFffaKn6ishWvamXwb0SKm6sSgRhLrTdzEw80MWOkgYZMRb6hb7gveUQfTktD 4Pbk1rRGnPnkL3PNUKAodBxbH0uC/Cu997EOKvFt8a9egn3/RSajmr66RplBZpaNjlMS /uUVRXlSVX9oyfrRNPTEsv3sBuzBCtGa+WUVfp6SJuxnm/MvOUdumwP+rGeUAFOv2iPN Zetw== X-Gm-Message-State: AFeK/H2CHq9Bi0Rv0A8AgdYAP8YQaBiQ5K7GGgOiWFRNeX4yIvdubn0sOxFZ1YzNBosrFBXI X-Received: by 10.200.56.86 with SMTP id r22mr20027783qtb.190.1491263541774; Mon, 03 Apr 2017 16:52:21 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:09 -0400 Message-Id: <20170403235219.19721-3-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 23:52:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 23:52:23 +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.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 03 Apr 2017 23:52: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" 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 Tue Apr 30 18:25:07 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 1491263577171136.6008979033403; Mon, 3 Apr 2017 16:52:57 -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 D401A51453; Mon, 3 Apr 2017 23:52:55 +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 A868B17D43; Mon, 3 Apr 2017 23:52:55 +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 5ACA618523CF; Mon, 3 Apr 2017 23:52:55 +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 v33NqSgq015717 for ; Mon, 3 Apr 2017 19:52:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id F277118A72; Mon, 3 Apr 2017 23:52:27 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB79618A6B for ; Mon, 3 Apr 2017 23:52:24 +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 ADE0EC049D59 for ; Mon, 3 Apr 2017 23:52:23 +0000 (UTC) Received: by mail-qt0-f170.google.com with SMTP id n21so126474389qta.1 for ; Mon, 03 Apr 2017 16:52:23 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:21 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D401A51453 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 D401A51453 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="Fg4Hmztb" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com ADE0EC049D59 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=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com ADE0EC049D59 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=Fg4HmztbQx2Qf0kOV/J88LnHvgBvfXx8dfmI5PgXm80QxUYuaq4fM5OHf9Xryzn9TP 6kgNP2hMJdpd0/IdvC8K4bYE8/OhNvPVzKtVORh2+33aK74OPPX9Y5Ar7Nc7t9PHTmGk KDsiPXN+XiT82SiSJDbPL4iWTOyxhrNj8lGNF0JIEPq0NyC6/Sq7yYy92S6LiEwcaToN MRa/ey9uswOLUJX51MHvcqKIYtLe6ch4a8+UCn+edvqDd3ZTjaEMCgE1HAuEHOZuQFI8 uimxgsd2yWGUEHdQ61E9NIyrzRghD4rlSyftGCcDkHarxq3qVvZnDFrB06WC4gwNzSdy 7Ezw== 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=HIS9mitGowtaygvJXY1TfPGwi5zcnSn5rvd379DkOOxRWQfJ2nxQ53+kH52f5SsoJM 5yWTjrZE/uKJs84Tl6X/cM7TsAub1MHNgq9TMmrndZxG4qp2R+HHkHtKyiCcSGUS0oQ+ 2sKA8oXAfMhHCLXNhV2lfz7PqoXkGfvO3B7wp0vbukKCG0zjI8ujo2elQZHS4TRB/SeO zJcQYAUuIsG6fwTDgvhGR4fKYGolCCGuXWr2pBsOykedXYnLBkiSxYQ8v0w1Hx9fFBdq FH5uKlOtSSNMsol3ihPDbXodIiE5ZG+B5U3sIadU/Ib28gwqt+TQyNvg6FX6pCYjeFCc njww== X-Gm-Message-State: AFeK/H20x+LSTOMCgUtSKRpGlR5CYiEV6YaHLfxr4+EvjOCGZL7ROR6xNyHbeDfX6GoegN+o X-Received: by 10.200.0.136 with SMTP id c8mr19242349qtg.223.1491263542687; Mon, 03 Apr 2017 16:52:22 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:10 -0400 Message-Id: <20170403235219.19721-4-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 03 Apr 2017 23:52:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 03 Apr 2017 23:52: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.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 23:52:56 +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 Tue Apr 30 18:25:07 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 1491263570665258.05342237435787; Mon, 3 Apr 2017 16:52:50 -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 4413864D97; Mon, 3 Apr 2017 23:52:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 130005C6D8; Mon, 3 Apr 2017 23:52: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 BAA954ED26; Mon, 3 Apr 2017 23:52: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 v33NqRSo015707 for ; Mon, 3 Apr 2017 19:52:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34DB378F0C; Mon, 3 Apr 2017 23:52:27 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D57C78F2C for ; Mon, 3 Apr 2017 23:52:25 +0000 (UTC) Received: from mail-qt0-f180.google.com (mail-qt0-f180.google.com [209.85.216.180]) (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 442A720264 for ; Mon, 3 Apr 2017 23:52:24 +0000 (UTC) Received: by mail-qt0-f180.google.com with SMTP id x35so126131596qtc.2 for ; Mon, 03 Apr 2017 16:52:24 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:22 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4413864D97 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 4413864D97 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="H6ILascJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 442A720264 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=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 442A720264 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=0Sc8LBGZVkb1svUqAzg8aanWrzL+ik5/juiK6tzBq1U=; b=H6ILascJjhWHPpiSUP6S+mT3C3kJDj0vTxHRkyMPCKRklGIpW8py+1KkLaRoksPf4I QWnnJj5ItvtUuty9AMYXOAik8zmIZIAZN/1JqxB6FuIjA2tKW3t9YUjFt/8xB/2wzVf3 tMYD01Ra2xbCFFW1c0uRffgysmoxA1n7vUmOiSJtpnxJtxr/Mt0sJDeNxijw4V5fCjKC eIVb6776CBpv9EieN1ZVx/oslAlURShNRZM/ZSqNag9bykcd1MV692coMBhBuZKTnZ6M EiHXSWb4VwzGNPI5YtWH1nWBsJFO5iKFbujkzpvpG8XLK+jgQt4uqIU1/FoON/x1YWoS rVvg== 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=0Sc8LBGZVkb1svUqAzg8aanWrzL+ik5/juiK6tzBq1U=; b=o6cb0QIUGnA8Vkwfu73uPqxBRIsg/LM66WGV+9US8IRQkE1yAIXUnkHPe4XHb3kR9y BedswPbpN/dpDsb5MMBgD0C9ZC2tWkYajflo1ahCVWZ1Yt9cjAubHLyYEK9wWfZue1p5 88MU3E9UU9GoTG37yB9INUeX4jv9uZKFJe0+yeqzpuS9WomdXf/UoNCO7bN1ifvsyVY8 ehWZt5hjchNGjp3FL7Ao2dPUa5XugsOSBTL58c/vyN1/Mj/I8qzNRBEydCV2ta5bzPwu Kw9LBwbXVw9hspS1GpQ5ly6cOl851EV+JyNFBrnPx8ccLpUzk+MBDWTJkhLlJkpEpJ5i vOpA== X-Gm-Message-State: AFeK/H3LZO82TXPHJeZBZALY30gwD0vrDccscb2uY+iFaAK/iW8GDsF5Vay7TJutCHC4YOlJ X-Received: by 10.200.56.48 with SMTP id q45mr20406016qtb.220.1491263543247; Mon, 03 Apr 2017 16:52:23 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:11 -0400 Message-Id: <20170403235219.19721-5-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 23:52:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 23:52:24 +0000 (UTC) for IP:'209.85.216.180' DOMAIN:'mail-qt0-f180.google.com' HELO:'mail-qt0-f180.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: -0.321 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.216.180 mail-qt0-f180.google.com 209.85.216.180 mail-qt0-f180.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 03 Apr 2017 23:52: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" 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..12b94af 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 {NULL, 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 { + const char *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 Tue Apr 30 18:25:07 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 149126357085985.0801524782504; Mon, 3 Apr 2017 16:52: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 5D43B80472; Mon, 3 Apr 2017 23:52: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 29B9C18A72; Mon, 3 Apr 2017 23:52: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 C684F18523CD; Mon, 3 Apr 2017 23:52:48 +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 v33NqStF015719 for ; Mon, 3 Apr 2017 19:52:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id F381218A6D; Mon, 3 Apr 2017 23:52:27 +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 EBCAA18A6C for ; Mon, 3 Apr 2017 23:52:25 +0000 (UTC) Received: from mail-qt0-f180.google.com (mail-qt0-f180.google.com [209.85.216.180]) (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 BAF3D7E9C9 for ; Mon, 3 Apr 2017 23:52:24 +0000 (UTC) Received: by mail-qt0-f180.google.com with SMTP id r45so126246266qte.3 for ; Mon, 03 Apr 2017 16:52:24 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:23 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5D43B80472 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=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5D43B80472 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="qq6NJLFK" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BAF3D7E9C9 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 BAF3D7E9C9 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=H3wD11PTquyz7ZdnKOft6mflAdXv1PcMGXSK521JUuo=; b=qq6NJLFKZFzptbOblKshp9oCWsJR322RgSSOj5a5NXVJP7uGFsKZyblbdtCnNItAGU Y/nz9TwOJW63lXCWMwgnIu6QuU+RM1hC4pqaedwrm0zFNavFo5Ijon+jLo/yMxo6fhVz EDFFdgXdAeJrSj6QYh33Iv3lXYvfHs1K5dTQwr5CKvJJxMPsoOjBDUFvHtHPJoqW+vQM CbEt5Nh6modrCR2NCnjJcBveNzUApzbWCWRcKUmaBxrRTx/zV2mM3C+ScUtQa8kFbzSQ FRab08N/P3XIwZB/P8BSml4y5GJCEBHZl8cLENt9bu0yTKbBS9qkPs4YTa4g1TPI9Ybu yPgA== 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=H3wD11PTquyz7ZdnKOft6mflAdXv1PcMGXSK521JUuo=; b=e5fFbso6mjb4aZ0yY6Sk6UfVpr40WMWg8l1AkS3D26nUAk7s+Uynf/FYk7N6zUacVz XNMHLYPsuRFYHLdHkJbUxNFyFvyXynS9SzY0Ag2XMbq+QgufFvGg5CfOcdbxH37pUyOv LyXMMouBwqXHibNg/9Xj3g7G4OwYMs6ZNYVN2qZi6P3di9ynn8Z3lveyHJqaVf33VQW5 bYDiGbOGRDPUzQE+xPp9fhNgvZvehGdS03W8GUxd+eC3Q2NR9x/+dL10owSiFeymqaL3 3n58ngTElQAgaqj2ozjdbTDBzLK+VxBvUdC69j+uIQCBUSIkuiJyPGdLXWuMyf4LVxkr Rx/A== X-Gm-Message-State: AFeK/H12kkDxKx1ygvUCyEIYmtAATX8GHGS/tra1gU4dnDnDj3q9lbYlh2VTz5UzQh+riUXY X-Received: by 10.237.37.229 with SMTP id y34mr20542572qtc.30.1491263543713; Mon, 03 Apr 2017 16:52:23 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:12 -0400 Message-Id: <20170403235219.19721-6-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Apr 2017 23:52:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Apr 2017 23:52:25 +0000 (UTC) for IP:'209.85.216.180' DOMAIN:'mail-qt0-f180.google.com' HELO:'mail-qt0-f180.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: -0.321 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.216.180 mail-qt0-f180.google.com 209.85.216.180 mail-qt0-f180.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 03 Apr 2017 23:52:50 +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 | 40 ++++++++++++++++++---------------------- src/hyperv/hyperv_wmi.h | 17 ++++------------- 2 files changed, 22 insertions(+), 35 deletions(-) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 069bcc9..5cac58d 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,13 @@ 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 +159,14 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr q= uery, const char *root, XML_TYPE_PTR data =3D NULL; hypervObject *object; =20 - if (virBufferCheckError(query) < 0) { - virBufferFreeAndReset(query); - return -1; - } - query_string =3D virBufferContentAndReset(query); - 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) + return -1; + serializerContext =3D wsmc_get_serialization_context(priv->client); =20 options =3D wsmc_options_init(); @@ -182,7 +177,7 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr que= ry, const char *root, goto cleanup; } =20 - filter =3D filter_create_simple(WSM_WQL_FILTER_DIALECT, query_string); + filter =3D filter_create_simple(WSM_WQL_FILTER_DIALECT, wqlQuery->quer= y); =20 if (filter =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -190,7 +185,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 +197,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 +227,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 +243,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,13 +280,12 @@ 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 } =20 - VIR_FREE(query_string); ws_xml_destroy_doc(response); VIR_FREE(enumContext); hypervFreeObject(priv, head); diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index 12b94af..8ce32a9 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -32,7 +32,6 @@ =20 # define HYPERV_WQL_QUERY_INITIALIZER {NULL, 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 Tue Apr 30 18:25:07 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 1491263578267807.0269584170467; Mon, 3 Apr 2017 16:52:58 -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 CE44237EE1; Mon, 3 Apr 2017 23:52:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1A5B5C6E6; Mon, 3 Apr 2017 23:52: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 55E485EC67; Mon, 3 Apr 2017 23:52: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 v33NqUTC015793 for ; Mon, 3 Apr 2017 19:52:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 87B1E5C6D2; Mon, 3 Apr 2017 23:52:30 +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 80B6C19F0A for ; Mon, 3 Apr 2017 23:52:26 +0000 (UTC) Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (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 55EBD61D04 for ; Mon, 3 Apr 2017 23:52:25 +0000 (UTC) Received: by mail-qt0-f182.google.com with SMTP id r45so126246386qte.3 for ; Mon, 03 Apr 2017 16:52:25 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:23 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CE44237EE1 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 CE44237EE1 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="evQn+vVt" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 55EBD61D04 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 55EBD61D04 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=evQn+vVtmR7nTYp1WJeGVALgCVdB0TKAdVrgMurTRBEsY3lb30XR9DOM5jMhMZVDZ0 54QRHdiB8f1l/adKH9zNdfCa6k73Eas9BjzUfBu2oEURdol0dVXoIbK7naGfH/ZgZx9/ fKY912c6osh4wPjGsnOQtqE865kS9yoZw+hQvC4IXl9M4/i2WMCRjuJMZTAsE76NUpKo 2XgXMsrqVyUZDSQwTdrBpd/E4DtFyowYbot5yiHDeeGyplnoofAy2tQBNESPBGv+Idlf e5ZGYyMM4NdjzsDDZ3Z2Caf0iMoli2wxJGree17IPZXiJPvq4EtAxAG5/N6a1kRejgvK 2CTQ== 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=ry3BY1yGrINUWMUwjFNGpEUObxck2ea/18xLcYlKML0kIfIz9ZCAnZqw2c0sT+H+Nc HguCUDvGmYuSWm4cQGXwRsWKe381Cp57iFEDR2B7ikKFFv66YBgvqu/hYmpBCytsx+8E AMrsVCiBZG9Dw9gzfNUSwvSlVAR1Qff4TAPrnqdJCLsRIxoY+/X+gM1vyP0k0Iy9pjru lhidb4n9RznRbLQTP/aMBv/1+pSOP8UcY+ofp4h7RkGs0Psg2lCVfU3Ic98AFPJOnGQw h8FNoRIBCpeGmO0t1z/DP9FZ3TQneCN4VlXZbxw7I4cJtUoxYFmgeV1vBRTH79MtwD96 frbw== X-Gm-Message-State: AFeK/H14BhKW0/KaYt+prGW34vhgSW3FQwZpFk6PeExqnlaO4QHmZ71EFdLlxA6FZjoUhS+5 X-Received: by 10.200.53.237 with SMTP id l42mr19336925qtb.264.1491263544250; Mon, 03 Apr 2017 16:52:24 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:13 -0400 Message-Id: <20170403235219.19721-7-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 23:52:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 23:52:25 +0000 (UTC) for IP:'209.85.216.182' DOMAIN:'mail-qt0-f182.google.com' HELO:'mail-qt0-f182.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.182 mail-qt0-f182.google.com 209.85.216.182 mail-qt0-f182.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 23:52: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" 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 Tue Apr 30 18:25:07 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 1491263574129668.4998087212916; Mon, 3 Apr 2017 16:52:54 -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 8D8B8C05490C; Mon, 3 Apr 2017 23:52:52 +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 6139C18A7E; Mon, 3 Apr 2017 23:52: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 166AA18523CD; Mon, 3 Apr 2017 23:52:52 +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 v33NqS0Y015725 for ; Mon, 3 Apr 2017 19:52:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0922E17D43; Mon, 3 Apr 2017 23:52:28 +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 EF06B7D69C for ; Mon, 3 Apr 2017 23:52:27 +0000 (UTC) Received: from mail-qt0-f182.google.com (mail-qt0-f182.google.com [209.85.216.182]) (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 014EF7704 for ; Mon, 3 Apr 2017 23:52:26 +0000 (UTC) Received: by mail-qt0-f182.google.com with SMTP id r45so126246524qte.3 for ; Mon, 03 Apr 2017 16:52:25 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:24 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8D8B8C05490C 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 8D8B8C05490C 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="CGbMNyKl" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 014EF7704 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 014EF7704 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=XLau8gjVFNO/F6j0nEtX1ga1//HeF3j5OExKvRZZAbA=; b=CGbMNyKlww2AsIdayFDnIEek3EQllgPoHgVglifAr5Q9AR3M5x00zQql5YIYWPdcrl oSpl6kVOBQFseyZVrZRE1UaCG/QBWhSajJIbC8eR6R+8enfIG1L8bmAQUVNvBIUsn+xj wD0RqnbJLurfVSLi0yZUXpksYHfsqdOcz3f2gXJyGXALX03radhorxUv6d9j+M1yRtp+ D0ZMBQXTeGxq5lBEDMYRxvWbIB3u9so54RqxDJuB0K56xgC8TyoQM0ybUapjudAlo4Xn vkQgK0nnRjRBbEeHBUouSlClOiaQ3MHHOIAIvk+TZEWdn37xT7Ls6tEhABC2TjDiJjye JwTw== 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=XLau8gjVFNO/F6j0nEtX1ga1//HeF3j5OExKvRZZAbA=; b=tnDRtF9mYsuaS6ZkPOaECVWmkLFbbXVdH925fFapCb52YdNJ55R3qmC37a7WRn2dOt XSCDoo/8tF6lmdrtMSlueZFG92LCPZ+3eKrz/38ttfYxeU7oIOcnAxl31X/jwcdQzP9M YaU0X1RIcZVAWeuUPMWBTTe7Tc3KiJMrSn8+F5for9gOtxzTS8pNXuuA9H3CPLXQYT/+ ZlYfl1wDcC2WRacbwOY+vxFkPR8CRct8II8iLzgR2MBsMf4J8Jh465wgwqIpWZ+aNWQm O/1Miy4Kq8UukPrgJIgB6m3odzs+gb3Lmyt+s10GCmJ8ylC2fcAbxeBFMNX0bBAbFnQq GENg== X-Gm-Message-State: AFeK/H3b2WXhWLeNnKiUkwsyFejJHB37mFAfLuWY58NN2mhaLNCBnH/ZPSVCQT+8fUqBRj4R X-Received: by 10.200.44.71 with SMTP id e7mr19874486qta.210.1491263544756; Mon, 03 Apr 2017 16:52:24 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:14 -0400 Message-Id: <20170403235219.19721-8-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 03 Apr 2017 23:52:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 03 Apr 2017 23:52:26 +0000 (UTC) for IP:'209.85.216.182' DOMAIN:'mail-qt0-f182.google.com' HELO:'mail-qt0-f182.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.182 mail-qt0-f182.google.com 209.85.216.182 mail-qt0-f182.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.32]); Mon, 03 Apr 2017 23:52: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" 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 | 385 +++++++++++++++++++++++++++------= ---- 1 file changed, 288 insertions(+), 97 deletions(-) diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 8c62882..f2c9cde 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, identfi= es + 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 struc 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 + """ + + 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" =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" + 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" proptery + 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(): @@ -268,7 +461,7 @@ def main(): line =3D line.lstrip().rstrip() =20 if len(line) < 1: - continue + continue =20 if line.startswith("class"): if block is not None: @@ -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 Tue Apr 30 18:25:07 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 1491263553110855.1067589093177; Mon, 3 Apr 2017 16:52:33 -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 686687E9CB; Mon, 3 Apr 2017 23:52:31 +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 3A19A19F0A; Mon, 3 Apr 2017 23:52:31 +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 ABA0F18521CB; Mon, 3 Apr 2017 23:52:28 +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 v33NqSnj015718 for ; Mon, 3 Apr 2017 19:52:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 008CA78F19; Mon, 3 Apr 2017 23:52:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDFE478F0C for ; Mon, 3 Apr 2017 23:52: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 4C72731F3E1 for ; Mon, 3 Apr 2017 23:52:26 +0000 (UTC) Received: by mail-qt0-f181.google.com with SMTP id x35so126132010qtc.2 for ; Mon, 03 Apr 2017 16:52:26 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:24 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 686687E9CB 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 686687E9CB 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="r60crroN" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C72731F3E1 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=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4C72731F3E1 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=vBDq+aGf/sSRkO7/d20BBvxUgdIsVVfePb4UiBvR0hI=; b=r60crroNga2Mjt0Az1g/8Xyfmo+qje7xNzUADUxmypmrRL/N7tasuXkBfIr8QA/8Zm GH/PyB8ZMayRswlvfF1Trwv6tm4qGS3f184xVbEngBAVAaxYHU97d6OCF4GZKuDF/KUw evyOAvXAa24lTOj40oObxLFd/6886UcU27mU+e484f8rPO/y/beodMB7pxt1bevUGw+A eG+aIPcp4WcVkKxPcCp74uokELbZMV+0WnyDF5Fse6eVg1tUKKnIzRDHH8wCnSn32Clb fL2iv10jRt25DbUfCiHoZ8/8QIQmsBnpLJSvF2p0WeFCmbe4gtwXqsep640L8Cr1FKOw uSCg== 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=vBDq+aGf/sSRkO7/d20BBvxUgdIsVVfePb4UiBvR0hI=; b=c0YqbvItX6KUW5LQK+2iH3dysfutUF6tKBmAifuh9jQSLheMUNZMq5XuI6Y++wU3Pg lIV/WpEGaYJorw6j1iq/k5xSR9LnG/gGSJSTwKl8Xz4R9ckhrToRcbL/gdRvwrvqlH3G BSUd+nYf9WsLvVTA7D4RyYbg6qbi4LXfHY8xhdd0UKwplml5biWJKVzmYw+ovSW9cj0q Qp1AqFM6AOaZDC5W3lEdCbjsAXJYJHvPtSAdiu4+Fju6AWVWYLq/BSNa/q9eb7b12btb JK3Du9Eh+tbhDc8v3whrjiEhEhoCI255p/3L7X5d+l6bdGvVI0NXrU03fuBTr/oq3SJ8 6aOg== X-Gm-Message-State: AFeK/H310UgM71ZmnQxowVWRJJk+foCVbDAH5sMeKrpzO9frqMpHKldMR2dj89d1vBqv8BJb X-Received: by 10.200.50.92 with SMTP id y28mr22352168qta.289.1491263545215; Mon, 03 Apr 2017 16:52:25 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:15 -0400 Message-Id: <20170403235219.19721-9-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 23:52:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 03 Apr 2017 23:52: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.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.26]); Mon, 03 Apr 2017 23:52:32 +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 5cac58d..c2d64ba 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 virBufferContentAndReset(query); + + return hypervEnumAndPull(priv, &wqlQuery, wmiClass); +} + int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, const char *detail) @@ -694,5 +700,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 8ce32a9..2d90a3b 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 Tue Apr 30 18:25:07 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 1491263587396691.0530143130458; Mon, 3 Apr 2017 16:53:07 -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 0C7D87E9DB; Mon, 3 Apr 2017 23:53:06 +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 D147A71D4C; Mon, 3 Apr 2017 23:53:05 +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 880EB18523D4; Mon, 3 Apr 2017 23:53:05 +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 v33NqTk7015755 for ; Mon, 3 Apr 2017 19:52:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2985C17D43; Mon, 3 Apr 2017 23:52:29 +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 22D607D69C for ; Mon, 3 Apr 2017 23:52:28 +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 094C580467 for ; Mon, 3 Apr 2017 23:52:27 +0000 (UTC) Received: by mail-qt0-f177.google.com with SMTP id r45so126246736qte.3 for ; Mon, 03 Apr 2017 16:52:26 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:25 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0C7D87E9DB 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 0C7D87E9DB 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="rX/X6Y4E" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 094C580467 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 094C580467 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=IUHor+2tXg9QqhyFNwzj05i1wvd/JO27aVNLmeDgUCc=; b=rX/X6Y4EvDxI/EDoUjpremKu2M/yzTEHKYS408LEIl9uzrV4KoidWEZ1hOyb1VJkLD CdnSgY97X17WkZHslzZnbiJuDYCTvbegv/sCXHYTOE3RpWgWTcGRTD5XYR8PGGghArZN taz+T/P3AaWjFOvqZ3KzgD/yFr/cjy+IY6k7n8wYOP4zOEozKVxuUPFFrzCEu48YFSB/ uhirNPnQ7afU8AZt26i5MssixqZwIgNM5KtWXDPeYPJA8ziiqrBMwi1b+9VE4LJHA2io AX8hFsjmIr2h2cuRhvRIzknguKNuiNhsQDXCsGSO8vlNNZ6LpzIj7R8Nn9jUFZFNbon/ M0Ug== 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=IUHor+2tXg9QqhyFNwzj05i1wvd/JO27aVNLmeDgUCc=; b=A8Ru/5W6QOAr00tH8UJsGSIrNo94GMEvISHlK2r6ucXklsy/+d0ZJ7wiAxDpmb+384 hBhy80OYdMnhH7Vv7/SQBV4yjXSm0aoaXFI1gEw6C6dQKF2rdBmSNYqbv7pvcnx5YB1g hRQJ+Q37/EvYd3KDhB772rc0pRvo1Gpupfb6sybjh1Xd07eVTKFF0Gz7c3XXmfVqwpyy rWzhOMYMt5bO5UIBTrxAZyVejcUpzWJMa76SN9cMn+YaCWAwrmRShcbhExkEDB9Cl4Fz 6TymiP1YCIm9ykj6oBBdP3eoy3RBhqJ55gvqIPuSEw9rgwG7T5vP7ml2ALXnRfbnDj9n upzg== X-Gm-Message-State: AFeK/H3UytAlnezgWPpKTSPthknfznFbtVq7YsX/CPc1cC+Egd/nC8q9WNlq0LLEADDy1vjl X-Received: by 10.200.2.150 with SMTP id p22mr21988516qtg.197.1491263545882; Mon, 03 Apr 2017 16:52:25 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:16 -0400 Message-Id: <20170403235219.19721-10-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 03 Apr 2017 23:52:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 03 Apr 2017 23:52:27 +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.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 03 Apr 2017 23:53:06 +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 c2d64ba..5d258a6 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -439,6 +439,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 @@ -447,6 +449,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) { @@ -459,7 +464,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) @@ -508,7 +513,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: @@ -567,7 +572,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 @@ -607,7 +612,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 @@ -652,17 +657,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 Tue Apr 30 18:25:07 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 1491263580842920.7876719489885; Mon, 3 Apr 2017 16:53:00 -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 6286C51469; Mon, 3 Apr 2017 23:52:59 +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 3BE8B5C6D2; Mon, 3 Apr 2017 23:52:59 +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 E307018523D2; Mon, 3 Apr 2017 23:52:58 +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 v33NqSBm015744 for ; Mon, 3 Apr 2017 19:52:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id F09DB78F0C; Mon, 3 Apr 2017 23:52:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAE0278F29 for ; Mon, 3 Apr 2017 23:52:28 +0000 (UTC) Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.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 8F664C0467CA for ; Mon, 3 Apr 2017 23:52:27 +0000 (UTC) Received: by mail-qk0-f175.google.com with SMTP id g195so56687336qke.2 for ; Mon, 03 Apr 2017 16:52:27 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:26 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6286C51469 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 6286C51469 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="H6sAQSsb" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8F664C0467CA 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=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8F664C0467CA 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=D8p9vNNUtmo6lI1CYiZDJuKlQ/a2jvTbY3nojzB7P8g=; b=H6sAQSsbgTBhGhRcTB+Zdtf0aCbMxIG+VkXXKqgYHHIRWsuah4sD49sd0ul0Qg5wh+ RCmkrX/oluQsDRGlG6V/Ia0aZNmqMEMXAqqvFLn3AoyOYHg2WXW+spCi1RFcN3Mh3a2x X/CW6QXptEeFVf8MQcjm6hmO+PCbCDmWK4KFwAScr3Tb1FEReng1/5cjVaprvlYahlLR QZXFf+ApjUhX4waHTtCkjs+UxXy/ZTJmaCqX5WucsveknfJ6EwoWo79w8gL03bBgjmj+ cBiywSlLlVJAQD27+PpnqbsagTTWqjKeQtO05guqOdgkxjUfxaPtDaD9nslQRfrUMeUm cTkw== 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=D8p9vNNUtmo6lI1CYiZDJuKlQ/a2jvTbY3nojzB7P8g=; b=umMxgQcgrEaR3DHLEmW1zy9pqFoWSCbW5qkIHor8fklZ0bpsiryIxHtstQWyBngnfp dvi9BI+igMmlkFWRsC8XE8tFkNe99zecePvuK4/Vtx4xMfsgZGCfkDYNzNi5e9iU+Rvi kvhkQ2+WcxJbANQtnDuYArWGDOS36NDISPUg1zggWE7X5S894MQL0WXHX9mJYBNQLjru N+gIyru4Aidbdy5/54Etiklo9KJ5gY7pteXbbwHhnf1KvXucgAm01EAkNrLFcaQ8giEj 4wpWk/RUQ01U/tH2GofG31URTcLRRambsC1YYb8ZnOlGh6SuDtdmW6OGd1Iu9OfH+AG6 icKA== X-Gm-Message-State: AFeK/H0FIxzMBzl3+pVY/kXGUNLgBHjFMyec6zeqNTr/4FvShcv7zZ83bHOiAQVshNE268se X-Received: by 10.55.67.66 with SMTP id q63mr18558192qka.49.1491263546597; Mon, 03 Apr 2017 16:52:26 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:17 -0400 Message-Id: <20170403235219.19721-11-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 03 Apr 2017 23:52:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 03 Apr 2017 23:52:27 +0000 (UTC) for IP:'209.85.220.175' DOMAIN:'mail-qk0-f175.google.com' HELO:'mail-qk0-f175.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: -1.911 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.175 mail-qk0-f175.google.com 209.85.220.175 mail-qk0-f175.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 03 Apr 2017 23:53:00 +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 | 92 ++++++++++++++++++++++++++++--------------= ---- 1 file changed, 56 insertions(+), 36 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 5d01c1f..0913517 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -55,7 +55,62 @@ hypervFreePrivate(hypervPrivate **priv) VIR_FREE(*priv); } =20 +static int +hypervInitConnection(virConnectPtr conn, hypervPrivate *priv, + char *username, char *password) +{ + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + hypervWqlQuery query =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(&buf, MSVM_COMPUTERSYSTEM_WQL_SELECT); + virBufferAddLit(&buf, "WHERE "); + virBufferAddLit(&buf, MSVM_COMPUTERSYSTEM_WQL_PHYSICAL); + + query.query =3D virBufferContentAndReset(&buf); + query.info =3D Msvm_ComputerSystem_WmiInfo; + + /* try query using V2 namespace (for Hyperv 2012+) */ + priv->wmiVersion =3D HYPERV_WMI_VERSION_V2; + + if (hypervEnumAndPull(priv, &query, &computerSystem) < 0) { + /* fall back to V1 namespace (for Hyper-v 2008) */ + priv->wmiVersion =3D HYPERV_WMI_VERSION_V1; + + if (hypervEnumAndPull(priv, &query, &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 +122,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 +200,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 +212,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 Tue Apr 30 18:25:07 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 1491263585191971.1924464076139; Mon, 3 Apr 2017 16:53:05 -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 DB1623D945; Mon, 3 Apr 2017 23:53:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (unknown [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7E1DE71D65; Mon, 3 Apr 2017 23:53:03 +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 40A945EC69; Mon, 3 Apr 2017 23:53:02 +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 v33NqTkA015746 for ; Mon, 3 Apr 2017 19:52:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 024994DA61; Mon, 3 Apr 2017 23:52:29 +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 F01A071D52 for ; Mon, 3 Apr 2017 23:52:28 +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 1549983F42 for ; Mon, 3 Apr 2017 23:52:28 +0000 (UTC) Received: by mail-qt0-f178.google.com with SMTP id x35so126132400qtc.2 for ; Mon, 03 Apr 2017 16:52:28 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:26 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DB1623D945 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 DB1623D945 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="vkfvGOhM" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1549983F42 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 1549983F42 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=zQVEZwEIMwVJ7O/a0+KWDpfq9seEzGzO7q+h1tyoalM=; b=vkfvGOhMZsEEuqRHGtVTgcEyBI7/59JgNg7aFWGdqMCiXiHvq1X5bYr4sSIo/lk29R hZshcZocaCwgtLI6FQDisWUFfQiMsPAXHiedWkr2zKJUjgrXwBNZq8221aIMViOtu4U/ +2p4SFP49uh/jy2kaGknmwz3WYo1QSd8wt/xWWmc/EIAXYAM6eiYHXNWGqS2X4sQz6Lc +kTql+rOGH81mKQfwRRi1AbBnXCtwFYyi94bd8kp2S850L3TkWqNGEZCpfHN4cAXJJSz 2d0V9KdYmiAhw13+W8EDA2/wcBmYhUP5Kc7xWflpCM61fTuweWqL2yyNoaXBe77/4V7j 1ffA== 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=zQVEZwEIMwVJ7O/a0+KWDpfq9seEzGzO7q+h1tyoalM=; b=SB64xanP3aEojU2AyOGu7zCJQ0GuGO4yaIZuGB29i6f7ncfqUS+yUpiqMBzojduuH0 PWRTxnXkuLtm9WpQBeQMg+2/Z+fnC7MeGgcrPxSZq9t2NKRSIT71C8Z67nxzT6iNhd2x VOK6DV1vz8xDDQ+Il0tZiBvE/uadjwOQN260ERfpnGLfP48HIiMxdxcizmdsX7n1C4FB kBLZ9av62SYe/gw6uo7R7AqCQd7qBl3eJdW4Jj3enMeeLRql2twKvv+MELmn0N48XHal hFYGwqXQbl5rqLo1bKiunpviKEW1ZdshJLoZP7KKC+ShDYrISpksm2W9EWeVkBe0t5UZ 1kQA== X-Gm-Message-State: AFeK/H1pTFQanbb6OizhRtOL9yzbD2PcznfYjLaG57E3Y8bpWBSMhGXTctELcqTRbD5mk7eC X-Received: by 10.200.35.135 with SMTP id q7mr22071018qtq.170.1491263547075; Mon, 03 Apr 2017 16:52:27 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:18 -0400 Message-Id: <20170403235219.19721-12-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 03 Apr 2017 23:52:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 03 Apr 2017 23:52:28 +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.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 03 Apr 2017 23:53:04 +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..e87d8cb 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 libvirt Microsoft Hyper-V driver can manage Hyper-V 2008 R2 an= d 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 Tue Apr 30 18:25:07 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 1491263591062138.9988860619477; Mon, 3 Apr 2017 16:53:11 -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 7019BC05681A; Mon, 3 Apr 2017 23:53:09 +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 2F5C871D52; Mon, 3 Apr 2017 23:53:09 +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 D02F218523D4; Mon, 3 Apr 2017 23:53:08 +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 v33NqTHP015768 for ; Mon, 3 Apr 2017 19:52:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 79DAA17D55; Mon, 3 Apr 2017 23:52:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7309D17D43 for ; Mon, 3 Apr 2017 23:52:29 +0000 (UTC) Received: from mail-qt0-f171.google.com (mail-qt0-f171.google.com [209.85.216.171]) (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 958F48123D for ; Mon, 3 Apr 2017 23:52:28 +0000 (UTC) Received: by mail-qt0-f171.google.com with SMTP id n21so126475451qta.1 for ; Mon, 03 Apr 2017 16:52:28 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f28sm10658242qtf.44.2017.04.03.16.52.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 16:52:27 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7019BC05681A 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 7019BC05681A 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="icq/eGT8" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 958F48123D Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 958F48123D 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=icq/eGT8kM2+FtXfpoxh82keL0Wqsn6gTM0GX8Hvouw3sOVArITeImKU6Cprqp0OCK zfa+0VS5t47HyCocHDDy3M3Xygfix5cbJxf0BEUX2N4GQnzD4z7jR2KTuvTTOp47Jj3k GVz2rcoU3mQEiuKzCxHaLsZvu9jC6OZ0W2a9Z1BbucjTMtJZaxfiGVmg9Ao+ovsrjAlg k6oyKER6zyma6Ygz4bFxQiQ10gFf9Rs02FZLy4yBImqB618iLr2prTzS15ysmhP6+HkO q5yFwan40UG1sSYEQiP4R5iQIcvUvi/mh5huhBwnBEbOI46Jmo1HtPaK+0dbg5WJKRR9 HPhQ== 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=E/qtfap52EB4UzVaNfNm4C+6Pj1B1/qpFO/ZNSiJIRbEJN790uKPw2LsUvo0TQFNsL ATm+JiPZL/pH52BYJwkjXbapwF26aYmRmZ/Cjkr9npsqiDcXqDtsvJLlR9onQ+jZmhfh WDeqgE8WNTrAU1f5wh7LSmmTxQgyDMlJ0KmUdpR7k+62OaijDLlw5dkrIH/k1sh9M7TW qXXf/5FlzLNOvf17hjw5rcdJF/1MPqrrxXS6xQFBSdkdLHl9AY0KtyvQgLr8I6uJoqkX 43OPGZFCGiMBqki61Bg8DQpCiXmeNO+TLXdQd763xZ+cQisbD7LFbsAbCbzmhp+7oMv3 Ap/w== X-Gm-Message-State: AFeK/H1CJDGzmpdSGpNb2ixMD40VZryl9GPGnNurCTRigAaKNvGIG4HIMFqh5l4AdzJ79TOY X-Received: by 10.237.41.100 with SMTP id s91mr21801674qtd.143.1491263547555; Mon, 03 Apr 2017 16:52:27 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 3 Apr 2017 19:52:19 -0400 Message-Id: <20170403235219.19721-13-dzamirski@datto.com> In-Reply-To: <20170403235219.19721-1-dzamirski@datto.com> References: <20170403235219.19721-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 03 Apr 2017 23:52:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 03 Apr 2017 23:52:28 +0000 (UTC) for IP:'209.85.216.171' DOMAIN:'mail-qt0-f171.google.com' HELO:'mail-qt0-f171.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.171 mail-qt0-f171.google.com 209.85.216.171 mail-qt0-f171.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 03 Apr 2017 23:53:10 +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