From nobody Sun Feb 8 19:54:52 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.zohomail.com; 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 1507025452433182.19287845085717; Tue, 3 Oct 2017 03:10:52 -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 8700681243; Tue, 3 Oct 2017 10:10:50 +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 64B175C89D; Tue, 3 Oct 2017 10:10:50 +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 2317A18355C3; Tue, 3 Oct 2017 10:10:50 +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 v93959G1011563 for ; Tue, 3 Oct 2017 05:05:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 33D5D60487; Tue, 3 Oct 2017 09:05:09 +0000 (UTC) Received: from dhcp-1-107.brq.redhat.com (ovpn-204-56.brq.redhat.com [10.40.204.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7DF96046F for ; Tue, 3 Oct 2017 09:05:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8700681243 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Ladi Prosek To: libvir-list@redhat.com Date: Tue, 3 Oct 2017 11:04:58 +0200 Message-Id: <20171003090458.31130-4-lprosek@redhat.com> In-Reply-To: <20171003090458.31130-1-lprosek@redhat.com> References: <20171003090458.31130-1-lprosek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Tue, 03 Oct 2017 05:41:37 -0400 Subject: [libvirt] [PATCH 3/3] hyperv: Map Limit to max_memory and VirtualQuantity to cur_balloon 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.25]); Tue, 03 Oct 2017 10:10:51 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Hyper-V uses its own specific memory management so no mapping is going to be perfect. However, it is more correct to map Limit to max_memory (it really is the upper limit of what the VM may potentially use) and keep cur_balloon equal to total_memory. The typical value returned from Hyper-V in Limit is 1 TiB, which is not really going to work if interpreted as "startup memory" to be ballooned away later. Signed-off-by: Ladi Prosek --- src/hyperv/hyperv_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 998780b80..4565af3ed 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -920,8 +920,10 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned i= nt flags) def->description =3D virBufferContentAndReset(&buf); } =20 - virDomainDefSetMemoryTotal(def, memorySettingData->data.common->Limit = * 1024); /* megabyte to kilobyte */ - def->mem.cur_balloon =3D memorySettingData->data.common->VirtualQuanti= ty * 1024; /* megabyte to kilobyte */ + /* mebibytes to kibibytes */ + def->mem.max_memory =3D memorySettingData->data.common->Limit * 1024; + def->mem.cur_balloon =3D memorySettingData->data.common->VirtualQuanti= ty * 1024; + virDomainDefSetMemoryTotal(def, memorySettingData->data.common->Virtua= lQuantity * 1024); =20 if (virDomainDefSetVcpusMax(def, processorSettingData->data.common->Virtual= Quantity, --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list