From nobody Wed Nov 27 02:22:14 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=1562075521; cv=none; d=zoho.com; s=zohoarc; b=gqHVAcWfhGI+0k1MH8RRLyRqu23rrTinxJDm6bbni0wuRRaCQzfrbyiIXEpQrrf0Az4FiqczN/xcFuXW20xAqlpUeW/8ThG7Tqdy3zpsSusSghJmeuWwzGq91an9UeTzpgP5KV5knr7YSkBbqvtIfvVrIuHVJGqo32cJ+byVGuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562075521; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=KVRIse+/lG0mKFYcWZbMjevgLHzS4nl+QvTMHWr+hqs=; b=E1R95WmFxgX/h1s5IpvXDBoiRBr+pykXkkLC1W7Qa5BEjp9ijW5EZKWCrqIxASvt3YRAWm21Fs87RlML5Iq01UDOPQmrf4gOzaU4VF4Q+dTgx8f4SLIBQBhkBiAESOsnNZSaikrjR2tVWRNC72CyGtHqXF+LFeSiVCc0wG+49is= 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 156207552137037.26942096841117; Tue, 2 Jul 2019 06:52:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBCFA305883A; Tue, 2 Jul 2019 13:51:28 +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 3732F1001DEA; Tue, 2 Jul 2019 13:51:25 +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 CE185206D1; Tue, 2 Jul 2019 13:51:17 +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 x62DpECD028625 for ; Tue, 2 Jul 2019 09:51:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id 403365D968; Tue, 2 Jul 2019 13:51:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3AF5837D6 for ; Tue, 2 Jul 2019 13:51:11 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (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 CF7CEA3EAB for ; Tue, 2 Jul 2019 13:50:55 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id s3so941420wms.2 for ; Tue, 02 Jul 2019 06:50:55 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id p4sm15355004wrx.97.2019.07.02.06.50.53 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 06:50:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=seXxAbPI6BP1TRxpDxmawkl6Y7lSbH5oiSKMVw9Bp18=; b=I9W5FI8ktJGz+2InduJJ+WlQ+51bcqiqLq0Jh48dba/jSTgAb4G5S61dyoKsbcXp4Y AeeClrm/m8QDWMyS/pnF7ilqUmudUWXvz+gXolD2kYsXEre2uCpdQ8slD60UnZTWqgi0 Doa52w8lpdcAtrkZGZa6qaf6bsjsgsHvgjRoLaWVGlV3YoCtWBFvb8w8IXlLw4DlOsq8 YJ7Rt6cFJ1dqCDUAggQTQ72U0uUT/IOIM3zbM/6EvZMIF5Lo0MLTRsN6w5hCb8aWBdsn vcp2XyyX5X6GQhTmiaF9XkqCJjLThFLXtlIOXYuUL1sSDDyBQYI2ayIpj3GY+sxricjB 13iw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=seXxAbPI6BP1TRxpDxmawkl6Y7lSbH5oiSKMVw9Bp18=; b=uI31dhLkYf/kikXwgOY0+Tf5dFtntHBID5p7iRTxBZFOoq3sfCPHXEB21t34LzL9PT TKILe8HXS4YTa2aoLSVUyGd44q8oAc1VX/Zm94OT22ofFuO79ktDfCEyFRAQb+7NX38k Gp59GsKY3EhH5+48KvtMoCgvQnCW29JkZKEtCB5h80K9Zkah1YfUsa00v/XDLwlTdukK /Y7Qwi2IlvFnfjdWnWVTWK6dx9IYUus7a9Gpbf8AU/HEw2KnDl9rsIGGskawFugdypo/ RgSm+9iLgKiPGfx8cgy25NAvIkQLNCFVU23/4ID9ik0xhsRvo0j05rz2lwCtVD8rAlzc J86w== X-Gm-Message-State: APjAAAVJqu5fr5aAiU4NBF6P1zWXDBbXoekdKJwaQ/Eyqs6O9ud6HwVN UjoaVMSiUYRY2YBSXbvqtmDqxy766og= X-Google-Smtp-Source: APXvYqyAwWPO94kyzJcoEqrlCoeevrlAndvlxhfCEv2pSa102Av5S+eAuUGU3MxHqGck3pF4qBJnpw== X-Received: by 2002:a7b:cc86:: with SMTP id p6mr3254633wma.123.1562075453999; Tue, 02 Jul 2019 06:50:53 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 15:49:42 +0200 Message-Id: <20190702134944.6258-3-stamatis.iliass@gmail.com> In-Reply-To: <20190702134944.6258-1-stamatis.iliass@gmail.com> References: <20190702134944.6258-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.30]); Tue, 02 Jul 2019 13:50:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 02 Jul 2019 13:50:56 +0000 (UTC) for IP:'209.85.128.68' DOMAIN:'mail-wm1-f68.google.com' HELO:'mail-wm1-f68.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.227 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.128.68 mail-wm1-f68.google.com 209.85.128.68 mail-wm1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 2/4] 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 02 Jul 2019 13:51:51 +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 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index c0608a4bea..44090a7d71 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2851,6 +2851,44 @@ static char *testDomainGetXMLDesc(virDomainPtr domai= n, unsigned int flags) goto cleanup +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; + + TEST_SET_PARAM(0, VIR_DOMAIN_MEMORY_HARD_LIMIT, VIR_TYPED_PARAM_ULLONG= , def->mem.hard_limit); + TEST_SET_PARAM(1, VIR_DOMAIN_MEMORY_SOFT_LIMIT, VIR_TYPED_PARAM_ULLONG= , def->mem.soft_limit); + TEST_SET_PARAM(2, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT, VIR_TYPED_PARAM_U= LLONG, def->mem.swap_hard_limit); + + if (*nparams > 3) + *nparams =3D 3; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + #undef TEST_SET_PARAM @@ -7286,6 +7324,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetVcpuPinInfo =3D testDomainGetVcpuPinInfo, /* 1.2.18 */ .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ + .domainGetMemoryParameters =3D testDomainGetMemoryParameters, /* 5.6.0= */ .connectListDefinedDomains =3D testConnectListDefinedDomains, /* 0.1.1= 1 */ .connectNumOfDefinedDomains =3D testConnectNumOfDefinedDomains, /* 0.1= .11 */ .domainCreate =3D testDomainCreate, /* 0.1.11 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list