From nobody Sun May 5 03:28:34 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1561933192; cv=none; d=zoho.com; s=zohoarc; b=NtHi/7YyfXofXR1NkzockdHyFdmeSiWKJmCFbWAPH+ktrGEII+vuszP9lFw9RrWl15H3Fr2+mlNwGSu0JCfLmIexgIu0Sr3ddv5ncXLQXm2FOG7wDNNAIoAk3dDFsva5gua9aF21MlhSC5XmNVCOgqak8MKii7EALFicA44B6cY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561933192; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=r6T9tJeWY8cGsjxNeeD5U8NiZWfT46v67pgqy/xxPBA=; b=mAQ/9GUh1iV7e6G0zNj9nBxWp0cqguVsAZMDaTysOFHkU5mX+F6VenGIjHSvW8v5oTJDbfN/9/0aIvo6Z7bmOX6mpse0VCk3VsRQZr+LXMFBNGqoDkckz4FstmemsQ9PZw9MpKDWypKVNy+rzKh0F3r+2QB6t8SodCgkPMVVVg8= ARC-Authentication-Results: i=1; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561933192356292.0598227505542; Sun, 30 Jun 2019 15:19:52 -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 E749FC057F2B; Sun, 30 Jun 2019 22:19:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A892F6A49E; Sun, 30 Jun 2019 22:19:47 +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 EDC743D87; Sun, 30 Jun 2019 22:19:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5UMJePd024589 for ; Sun, 30 Jun 2019 18:19:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id DE4B619C4F; Sun, 30 Jun 2019 22:19:40 +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 D93E92E03B for ; Sun, 30 Jun 2019 22:19:38 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (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 205315AFE3 for ; Sun, 30 Jun 2019 22:19:27 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id h19so13227435wme.0 for ; Sun, 30 Jun 2019 15:19:27 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id f190sm9003991wmg.13.2019.06.30.15.19.23 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 30 Jun 2019 15:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=HLUKNLkMrWL/qDa4qWWmWcrKw79nafnHjmPLqnUK42I=; b=u+AgYvDfXSevtr67G4jLKbqcegka7oSzcrZtXPokWwVL8xTBig+iofLc1OMqyJAxoZ 8K/G875dOKRmREB5oFOmJMPukt/cH1r+8Zyxg2W9ZJScj3neoIXMm8SeucOnjD0EBB9i eWbgeGMSzPBPmhc3paf0CUOwJRuHv627mQAdr+all9VHSJRNcuFQC/vsl8CSy9AoeDTh tG8PPG9PDiAdywXg1h/zZ50qsHakpQazChL6whO9FnPtJ+ecGySRO0DmFO6G9q0Zy0xh KjMpn9LXS7YbQZvO/TXRTxLO+VxuhtPlm9oeH6qblUk8ZY7QPYa7Oabob5Gz9+IBxrEP bwlA== 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:mime-version :content-transfer-encoding; bh=HLUKNLkMrWL/qDa4qWWmWcrKw79nafnHjmPLqnUK42I=; b=XZBjRbR32WDXl5PawQfjscY0JQd5xXRu5nhcEU0P9kWws7hszz+ohHTnqHm9g9Nm23 oOUp7FgfSyOW5/2NBBpqlE5yihpPTOUMCYJiCiD8ng5e0bLGAVEHBAFjIgBaR6NH9Iwf /s9eyozBBVaT6Oo70K/jqOA7C75FTMC1L07yNgNJzbJX2YVkDB5jNGM0gKbZ0euZ7F/8 tNlZVtiCZp7lYA/DJvH48FSHNXoLlC38K6cPs/9CB0zCl35Oipvf2vR/AaggEbSaTo0Q qvssHMijAzZfriOSlRJI4OHpggwu/3uKSzdwkPLL8JDcGt8bHSEXtuDYqRg+Q4LMVALJ +B5w== X-Gm-Message-State: APjAAAWfB+zFZZq/aZWJE9bEqnlXn0FwYOalMWNWGEqpbsxwvGVIDnKN cD8avtD/v5xPA0BCtdC5VTu036LRVwgdZg== X-Google-Smtp-Source: APXvYqzTOs3TV1URckrTBZXEp44RfKPbQHEc1Bbqq03cfApYP09clq1iVGBKkTJFx3SLIF+dYBFeQg== X-Received: by 2002:a1c:ac81:: with SMTP id v123mr15092083wme.145.1561933165183; Sun, 30 Jun 2019 15:19:25 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 1 Jul 2019 00:19:19 +0200 Message-Id: <20190630221919.18640-1-stamatis.iliass@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 30 Jun 2019 22:19:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 30 Jun 2019 22:19:27 +0000 (UTC) for IP:'209.85.128.66' DOMAIN:'mail-wm1-f66.google.com' HELO:'mail-wm1-f66.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.11 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.128.66 mail-wm1-f66.google.com 209.85.128.66 mail-wm1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] test_driver: implement virDomainGetMemoryParameters 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: , 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.32]); Sun, 30 Jun 2019 22:19:50 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- Things changed since v1: - virDomainObjGetOneDef is used in order to get the appropriate def - the TEST_ASSIGN_MEM_PARAM macro got removed src/test/test_driver.c | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 4b1f2724a0..01b3ed88f3 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2514,6 +2514,57 @@ testDomainGetMaxVcpus(virDomainPtr domain) VIR_DOMAIN_VCPU_MAXIMUM)); } + +static int +testDomainGetMemoryParameters(virDomainPtr dom, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + int ret =3D -1; + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG | + VIR_TYPED_PARAM_STRING_OKAY, -1); + + if ((*nparams) =3D=3D 0) { + *nparams =3D 3; + return 0; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + if (*nparams > 0 && + virTypedParameterAssign(¶ms[0], VIR_DOMAIN_MEMORY_HARD_LIMIT, + VIR_TYPED_PARAM_ULLONG, def->mem.hard_limi= t) < 0) + goto cleanup; + + if (*nparams > 1 && + virTypedParameterAssign(¶ms[1], VIR_DOMAIN_MEMORY_SOFT_LIMIT, + VIR_TYPED_PARAM_ULLONG, def->mem.soft_limi= t) < 0) + goto cleanup; + + if (*nparams > 2 && + virTypedParameterAssign(¶ms[2], VIR_DOMAIN_MEMORY_SWAP_HARD_LI= MIT, + VIR_TYPED_PARAM_ULLONG, def->mem.swap_hard= _limit) < 0) + goto cleanup; + + if (*nparams > 3) + *nparams =3D 3; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus, unsigned int flags) @@ -7275,6 +7326,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetVcpus =3D testDomainGetVcpus, /* 0.7.3 */ .domainGetVcpuPinInfo =3D testDomainGetVcpuPinInfo, /* 1.2.18 */ .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ + .domainGetMemoryParameters =3D testDomainGetMemoryParameters, /* 5.6.0= */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .connectListDefinedDomains =3D testConnectListDefinedDomains, /* 0.1.1= 1 */ .connectNumOfDefinedDomains =3D testConnectNumOfDefinedDomains, /* 0.1= .11 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list