From nobody Tue Feb 10 04:02:43 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 1490892477526340.3196145281398; Thu, 30 Mar 2017 09:47:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 157F28AE6C; Thu, 30 Mar 2017 16:47:56 +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 DADED77DDE; Thu, 30 Mar 2017 16:47: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 858D218523CF; Thu, 30 Mar 2017 16:47: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 v2UGlcvx016956 for ; Thu, 30 Mar 2017 12:47:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A15117AFA; Thu, 30 Mar 2017 16:47:38 +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 3317F17ADA for ; Thu, 30 Mar 2017 16:47:38 +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 5F5078F4FB for ; Thu, 30 Mar 2017 16:47:36 +0000 (UTC) Received: by mail-qk0-f175.google.com with SMTP id r142so45347443qke.2 for ; Thu, 30 Mar 2017 09:47:36 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id j1sm1730322qkf.57.2017.03.30.09.47.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Mar 2017 09:47:34 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 157F28AE6C 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=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 157F28AE6C 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="RSXA2aA2" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5F5078F4FB 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 5F5078F4FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ncyUxgDqk9hi/cu3RhCSAgTQR9+33MlbHHXD4m9em4I=; b=RSXA2aA2YWHEZpgpnVrchPvkmiA2k5UxImZD9E+HHMK3hy9qCwJM9N5qk+77UKuiZQ mwPue1/EsTFbzqBuzyEoJ/H3k52IKB/EUsiYn8/Ys7e0HoOjqq2P+S4ov+GPxPNAJjTv Iay20M8tquR4fRDayUC6IkWXefm3HA8izEc1fdiUFJAbOUmOLXmxgTpt88wCRm09CnMc O2UzB2G09fE7xAGsAQhQ597dn5u2PbStJ1VAhZ6TMez2d6iIc0D7fbAYQA4WKTRcte+S OcbTHVxT95PUwFZyTMivz0EsPKu7NeotgM4NXxw8Mmh473jw1Jqst/53GEIJQpksELUq wZcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ncyUxgDqk9hi/cu3RhCSAgTQR9+33MlbHHXD4m9em4I=; b=S/thdg+9CTAUTUJPKl7mPlbeU7GsoH/Ao2QMuqjxlACAEHGvRw075n5lJCt62VfxBR DJIx2Sq1roz9K0CcsKZTKeL9oO6GyREX3AIBws1LneF27ICV4lDXlrRBx6LVtiM4zUjr 0DUd/wD4BGLbK2tPyNneSDIK0WlZ3ANPfFBBGqSn7hZuN51s/tW2P2ecsJ3WjhzC4E/3 66Wo/r5Gi1G6mVxhqbVJmBORAr4LrbDV1G7LcGgxbnvfef3DxLS2AQUphVshmTUwXuO5 uQ2XPpVM4BRzP6VORMXo19ClytpLbHvb1xHZnFUkQbE+xsjAtLWmVL4yU9eaAUQ6eSen 51Jw== X-Gm-Message-State: AFeK/H3SAQCgnxRjH1ygmdpbs1HCRRIM3yrIoFCQb/Wyg5noLemiYKxT6pMHvsK4Zn1cndYL X-Received: by 10.55.133.193 with SMTP id h184mr699034qkd.205.1490892455116; Thu, 30 Mar 2017 09:47:35 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Thu, 30 Mar 2017 12:47:27 -0400 Message-Id: <20170330164728.32215-11-dzamirski@datto.com> In-Reply-To: <20170330164728.32215-1-dzamirski@datto.com> References: <20170330164728.32215-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 30 Mar 2017 16:47:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 30 Mar 2017 16:47:36 +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.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Sri Ramanujam Subject: [libvirt] [PATCH 10/11] 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 30 Mar 2017 16:47: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" 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 498b1ed..831bcb3 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -437,6 +437,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 @@ -445,6 +447,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_V2_RESOURCE_URI; + options =3D wsmc_options_init(); =20 if (options =3D=3D NULL) { @@ -457,7 +462,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) @@ -506,7 +511,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: @@ -565,7 +570,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 @@ -605,7 +610,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 @@ -649,20 +654,20 @@ 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 - *domain =3D virGetDomain(conn, computerSystem->data->ElementName, uuid= ); + *domain =3D virGetDomain(conn, computerSystem->data.common->ElementNam= e, uuid); =20 if (*domain =3D=3D NULL) return -1; =20 if (hypervIsMsvmComputerSystemActive(computerSystem, NULL)) { - (*domain)->id =3D computerSystem->data->ProcessID; + (*domain)->id =3D computerSystem->data.common->ProcessID; } else { (*domain)->id =3D -1; } --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list