From nobody Tue Apr 30 11:10:07 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=1560434920; cv=none; d=zoho.com; s=zohoarc; b=HsZlmzNjpJzAhECxipBpermTqkHyj0ZXtd4vErszY1/d8bCzF0bROWg61NJdo/6IWgqbfMmqmRRQK3pp2mKIfBscmCWJMv+6/UZwz+nwt62tJOvT5Kg8fw6m5Ope1UE4xxUwvXcWJDUSopCC6/qGe1eo3xCphStjD3tqB0yGR0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560434920; 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=au16nw3XGUF9JYlrjVUeTHrvGPYelwFjyDFQ08+y3o8=; b=aAHTo5NkfejO79ptDsudLXG10lXIpSm6O3JvalJvx9zsgP7gtTUq8H2EcoOgP9lxuBPbttqVeH6iVmg5UoAHzSdqxkKbs5CbW68rUtPvW+bargl6ev0rHoIdRd9DpSJRkjsgs3swkxomJ9XNiDmKPgQWjybv+bfVjIM77O7nPLo= 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 1560434920764259.7769514647084; Thu, 13 Jun 2019 07:08:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 120B6B746E; Thu, 13 Jun 2019 14:07:57 +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 587D880886; Thu, 13 Jun 2019 14:07:51 +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 D027FE160; Thu, 13 Jun 2019 14:07:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5DE7WsQ009651 for ; Thu, 13 Jun 2019 10:07:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id B8A4179012; Thu, 13 Jun 2019 14:07:32 +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 AE5D378DFD for ; Thu, 13 Jun 2019 14:07:28 +0000 (UTC) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 5773D7F746 for ; Thu, 13 Jun 2019 14:07:07 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id x25so14087187ljh.2 for ; Thu, 13 Jun 2019 07:07:07 -0700 (PDT) Received: from archlap.localdomain (188.146.174.30.nat.umts.dynamic.t-mobile.pl. [188.146.174.30]) by smtp.gmail.com with ESMTPSA id y127sm615566lff.34.2019.06.13.07.07.03 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 13 Jun 2019 07:07:04 -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=g61k7k2mC83NL4flKb2kQmSn2hJ8XIwqLEC4cDhvCOA=; b=uq8I9AeXWHNDc3gwFfgwFFPi6KDnunDLo3s/u1vouJLc9seEpWLGOT7YtHHtpcUiMb rd1AA/5y+EhMTGVJRAo1geLXAU3MVu8RIXMmw+A4dVW++R7f9M5VWOlhcOX5bJigbefR qPxFNIRBMNFttCQlJE+YeJQeP+PVQdD4ujO5fTOLIatmR3Pbf4UASAfdOUvu5Nc1IqIz cOT/e3bbXBiyQg73XzLWaXaRhWLioSIro7215T3EQ1LaqRtyWVUQ0z+MYwZHezHsQi2e k/qYyyoE+5kooAhZMVk9JNlBqewmKA2amaEoOS+34rXEKsjqz+Hsf5wQ7YcSUufQp1Iw pF+Q== 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=g61k7k2mC83NL4flKb2kQmSn2hJ8XIwqLEC4cDhvCOA=; b=d2NSe+iAQ18B78aR7aKLtefz1jDtI9jku8ycSvqNo2Ju4cv+rqde4zvC8W2jGFgPWg 7wwSjaHLjMg1WSVhCnJOXP/anTniXoaiGhKhKAp4es56Vf/iTr/Fnw/FA/jF2J5xEUhi rI7eqhOgzGiVQ2tNujsm8hcoN/myUfnCbn6WGjoczOm2TYSHioH9VV9aHU9Pm1OYRCxW AYlY7e1UJbCLAQnH2eolKmZ0ccaiwRQshDyNcxNqyPm4F0C5bBUEzzZu5ZLEUVCWu6Ha yt6SLF4913s2Uo7wz47SQAdtj/LJULKCnK+Io1jqBdKOx8CgJA1hZLeJ6EB1UuTbQcX4 ZlmA== X-Gm-Message-State: APjAAAVVnNvigQDVsgoV+xrOcnTNREf6E0f1lns4ETUSbg9Rl1EkeqYv OT2xytsjPTERb8LnLGsqS75oA/UB6VI= X-Google-Smtp-Source: APXvYqxtLjSgrzFl702ZX8Ky4IARlsVot+GgXrIg8Ocn/pOantOZv387MQGYq/ccEWnzxX2DrYHu6g== X-Received: by 2002:a2e:9654:: with SMTP id z20mr21015947ljh.52.1560434825436; Thu, 13 Jun 2019 07:07:05 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 13 Jun 2019 16:06:59 +0200 Message-Id: <20190613140659.26426-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.27]); Thu, 13 Jun 2019 14:07:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Jun 2019 14:07:07 +0000 (UTC) for IP:'209.85.208.194' DOMAIN:'mail-lj1-f194.google.com' HELO:'mail-lj1-f194.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.109 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.208.194 mail-lj1-f194.google.com 209.85.208.194 mail-lj1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 13 Jun 2019 14:08:34 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 8ef843b203..9e8236a5b6 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1474,6 +1474,7 @@ static int testConnectGetMaxVcpus(virConnectPtr conn = ATTRIBUTE_UNUSED, return 32; } + static char * testConnectBaselineCPU(virConnectPtr conn ATTRIBUTE_UNUSED, const char **xmlCPUs, @@ -2498,6 +2499,50 @@ testDomainGetMaxVcpus(virDomainPtr domain) VIR_DOMAIN_VCPU_MAXIMUM)); } + +#define TEST_ASSIGN_MEM_PARAM(index, name, value) \ + if (index < *nparams && \ + virTypedParameterAssign(¶ms[index], name, VIR_TYPED_PARAM_ULLO= NG, \ + value) < 0) \ + goto cleanup + +static int +testDomainGetMemoryParameters(virDomainPtr dom, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + int ret =3D -1; + virDomainObjPtr vm =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; + + TEST_ASSIGN_MEM_PARAM(0, VIR_DOMAIN_MEMORY_HARD_LIMIT, vm->def->mem.ha= rd_limit); + TEST_ASSIGN_MEM_PARAM(1, VIR_DOMAIN_MEMORY_SOFT_LIMIT, vm->def->mem.so= ft_limit); + TEST_ASSIGN_MEM_PARAM(2, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT, vm->def->m= em.swap_hard_limit); + + if (*nparams > 3) + *nparams =3D 3; + + ret =3D 0; + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} +#undef TEST_ASSIGN_MEM_PARAM + + static int testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus, unsigned int flags) @@ -7162,6 +7207,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.5.0= */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .connectListDefinedDomains =3D testConnectListDefinedDomains, /* 0.1.1= 1 */ .connectNumOfDefinedDomains =3D testConnectNumOfDefinedDomains, /* 0.1= .11 */ -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list