From nobody Thu May 15 11:43:34 2025 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 1507273618534306.6608535125871; Fri, 6 Oct 2017 00:06: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 62DCD627EF; Fri, 6 Oct 2017 07:06:57 +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 3E73D6136B; Fri, 6 Oct 2017 07:06:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0463218355C9; Fri, 6 Oct 2017 07:06:57 +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 v966lq12020272 for ; Fri, 6 Oct 2017 02:47:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7FBB960472; Fri, 6 Oct 2017 06:47:52 +0000 (UTC) Received: from dhcp-1-107.brq.redhat.com (ovpn-204-170.brq.redhat.com [10.40.204.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB35F61359; Fri, 6 Oct 2017 06:47:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 62DCD627EF Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Ladi Prosek To: libvir-list@redhat.com Date: Fri, 6 Oct 2017 08:47:35 +0200 Message-Id: <20171006064735.29638-4-lprosek@redhat.com> In-Reply-To: <20171006064735.29638-1-lprosek@redhat.com> References: <20171006064735.29638-1-lprosek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 06 Oct 2017 07:06:57 +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 Reviewed-by: John Ferlan --- 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