From nobody Mon Feb 9 17:04:57 2026 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 14924686156311002.4952354186152; Mon, 17 Apr 2017 15:36:55 -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 B83284AEB6; Mon, 17 Apr 2017 22:36:53 +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 8C30918E51; Mon, 17 Apr 2017 22:36:53 +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 38E7E18523CC; Mon, 17 Apr 2017 22:36:53 +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 v3HMaPMj017825 for ; Mon, 17 Apr 2017 18:36:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5E2555C48E; Mon, 17 Apr 2017 22:36:25 +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 558C96046B for ; Mon, 17 Apr 2017 22:36:25 +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 43E6980F8E for ; Mon, 17 Apr 2017 22:36:23 +0000 (UTC) Received: by mail-qt0-f182.google.com with SMTP id y33so29146996qta.2 for ; Mon, 17 Apr 2017 15:36:23 -0700 (PDT) Received: from silas.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id m62sm5751088qte.5.2017.04.17.15.36.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Apr 2017 15:36:21 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B83284AEB6 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 B83284AEB6 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="z1fPRuw7" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 43E6980F8E 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=sramanujam@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 43E6980F8E 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=9WkoJftcmSJw63lhAcGSWLMEPpu2QW7jdP07Of5wW60=; b=z1fPRuw7og0xhwPZFh2ciF8lhJG51970UMRQN3DQg+pcrkbq3gh/O5xZOgnwSPq7Cl UMqdntnWoIAFAxn61AYnAfWzT3eL72AE2FWkbnbeqTP/aqUqji9+LecLT42D52cI1O/z aO9wbpcdY8AzCK6PmRqeLDiYZDnFANJZ3AcjZ4M0fm+FImS9j+NdMxwjurIub+2MzkDr 7dSkXFVTEqpZibnxMA7adTqTH7Y6QgEmLSc3kdNYusQycDfwt+g3lEyq75qxtEZ94G4P V89O4FIsvEYnhMG7yD1xrDgiLHCBsSOguCLnhcQAmKoPHxPfkH3ORSpWQ4q5MAWiVIGE a89A== 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=9WkoJftcmSJw63lhAcGSWLMEPpu2QW7jdP07Of5wW60=; b=GxuZFpkyktwSUbx3k02mnpKwM+GfRz5KNkFs4K+Vq8m9lWmnto5+Vt0jkDng25Ikyp SslYxcvwG8lLfEyBSs+nS2YLfzBfvUKWYVzGq1RYumdOed9NvCnOT1fKppZWXBuuvrVf fGSYnK8CbiPdOK4nMGK8P78VAiiihhQ1J28jiHTNMTsqMAell7z40s4CvfsBjF3oD202 7en91Lnu7HX7vO+1Qir9AJcX76nTPhRuSqb8jmZQyH1eOLJ/penHfV0Oc4XqRAL+n3s2 JBC6F92KRMtY9OFsCnmanlpsrGmvKF6Lo/d1eLGbDRWoNXm4gfXyE6XHJDShIJjhHcNd d4zA== X-Gm-Message-State: AN3rC/6PLOR7tJVrmRsNofaXewd0V5M28UZIbnom39iWFWiFzeo5WQg/ pA77r2+yXzPXg6xHVnM= X-Received: by 10.200.35.80 with SMTP id b16mr10687697qtb.205.1492468582384; Mon, 17 Apr 2017 15:36:22 -0700 (PDT) From: Sri Ramanujam To: libvir-list@redhat.com Date: Mon, 17 Apr 2017 18:36:11 -0400 Message-Id: <20170417223615.20817-3-sramanujam@datto.com> In-Reply-To: <20170417223615.20817-1-sramanujam@datto.com> References: <20170417223615.20817-1-sramanujam@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 17 Apr 2017 22:36:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 17 Apr 2017 22:36:23 +0000 (UTC) for IP:'209.85.216.182' DOMAIN:'mail-qt0-f182.google.com' HELO:'mail-qt0-f182.google.com' FROM:'sramanujam@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.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] hyperv: Generate object property type information. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Apr 2017 22:36:54 +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" Update the generator to generate basic property type information for each CIM object representation. Right now, it generates arrays of hypervCimType structs: struct _hypervCimType { const char *name; const char *type; bool isArray; }; --- src/hyperv/hyperv_wmi_classes.h | 19 +++++++++++++++++++ src/hyperv/hyperv_wmi_generator.py | 15 ++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_wmi_classes.h b/src/hyperv/hyperv_wmi_classe= s.h index f7d596f..ce4643e 100644 --- a/src/hyperv/hyperv_wmi_classes.h +++ b/src/hyperv/hyperv_wmi_classes.h @@ -1,6 +1,7 @@ /* * hyperv_wmi_classes.h: WMI classes for managing Microsoft Hyper-V hosts * + * Copyright (C) 2017 Datto Inc * Copyright (C) 2011 Matthias Bolte * Copyright (C) 2009 Michael Sievers * @@ -23,6 +24,7 @@ #ifndef __HYPERV_WMI_CLASSES_H__ # define __HYPERV_WMI_CLASSES_H__ =20 +# include "internal.h" # include "openwsman.h" =20 # include "hyperv_wmi_classes.generated.typedef" @@ -96,6 +98,21 @@ enum _Msvm_ConcreteJob_JobState { }; =20 =20 +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *= * * + * WMI + */ + +typedef struct _hypervCimType hypervCimType; +typedef hypervCimType *hypervCimTypePtr; +struct _hypervCimType { + /* Parameter name */ + const char *name; + /* Parameter type */ + const char *type; + /* whether parameter is an array type */ + bool isArray; +}; + typedef struct _hypervWmiClassInfo hypervWmiClassInfo; typedef hypervWmiClassInfo *hypervWmiClassInfoPtr; struct _hypervWmiClassInfo { @@ -109,6 +126,8 @@ struct _hypervWmiClassInfo { const char *resourceUri; /* The wsman serializer info - one of the *_TypeInfo structs */ XmlSerializerInfo *serializerInfo; + /* Property type information */ + hypervCimTypePtr propertyInfo; }; =20 =20 diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index c15d97a..a51c151 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -122,6 +122,14 @@ class WmiClass: =20 source +=3D "SER_END_ITEMS(%s_Data);\n\n" % cls.name =20 + # also generate typemap data while we're here + source +=3D "hypervCimType %s_Typemap[] =3D {\n" % cls.name + + for property in cls.properties: + source +=3D property.generate_typemap() + source +=3D ' { "", "", 0 },\n' # null terminated + source +=3D '};\n\n' + =20 source +=3D self._define_WmiInfo_struct() source +=3D "\n\n" @@ -222,7 +230,8 @@ class WmiClass: 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 " .serializerInfo =3D %s_Data_TypeInfo,= \n" % cls.name + source +=3D " .propertyInfo =3D %s_Typemap\n" % cls= .name source +=3D " },\n" =20 source +=3D " }\n" @@ -374,6 +383,10 @@ class Property: % (Property.typemap[self.type], class_name.upper(), sel= f.name) =20 =20 + def generate_typemap(self): + return ' { "%s", "%s", %s },\n' % (self.name, self.type.lower()= , str(self.is_array).lower()) + + =20 def open_and_print(filename): if filename.startswith("./"): --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list