From nobody Wed Nov 27 00:29:50 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=Zykvhs7aTRhQ4BkqatjH3C/+naZ406bONJxVmP9HrZR5sGn46evjXyHzHqer5ui/fssahRfKBfQQKQp63D6MHHQ4dBbwbMi7QE1KnSqZmVMt6THyx6/Hwmu7N+ckEV7dYHCEP+/t9uZLIqX3v9bSNKrYMOal8a6XwbNVAJEI1q8= 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=3f94nKA0P6jdsX2wlhgdLsXPLFDxjSJ817vHrlDID7A=; b=gqOnSksuAekqcWhKRRLIAAn2RAOBzHUfmZJhnrWnkqu1LhT/g+O4VNTzqRvO91qGwsd+ZX4YfR2kHR/eUP3noAvOBUtgvcM/gBXs5cBK8P280dLAUQvar3gjSM4DH8nr4q+SleAHxzWMf3LuS+z3iK1vz8TXUb+WGDI0whG0A+w= 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 1562075521345793.4417856370798; Tue, 2 Jul 2019 06:52:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 88057C024906; Tue, 2 Jul 2019 13:51:47 +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 5770F17AA7; Tue, 2 Jul 2019 13:51:43 +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 10B0D18363C3; Tue, 2 Jul 2019 13:51:40 +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 x62Don2D028112 for ; Tue, 2 Jul 2019 09:50:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2254AF6CE; Tue, 2 Jul 2019 13:50:49 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C710196E5 for ; Tue, 2 Jul 2019 13:50:46 +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 9C47730BBE9A for ; Tue, 2 Jul 2019 13:50:30 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id v19so1104393wmj.5 for ; Tue, 02 Jul 2019 06:50:30 -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.27 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 06:50:27 -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=0xwQnvDqrVlX8IdQTR9pjU59yf61L0udQbAzc5rOtto=; b=R9V+xlGY8Q6wjDGZxeWEQsA+s9cA18g5SSYh+h0z6AgOXW3pEBfXa6nREL7hxxU6yy 0aRCq3KbemN46mJ+XmmzWSpeHdxzH15xhw+BGM3c8mDfewY0u0IBIB9Glk6BtX4RzAug gofkGYkuyj0v6x2V9ghyTM+67YQNAc9ECGHInmb1p829arqoB00hTL/GvOo9TgZzWktG Jvt9pOeZ8OCjGN2JiQhu4wi9ChtDopVOeyBglI0tg7gZzsPxomw5/jSYiUO4do5ISZQX 7G5UPM9AliBs6uIuDwCHFFKXiXC6Yz1ENdeLV0P96jjU0hpgdfoAZVT/lh5PVCvFviOg +i4A== 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=0xwQnvDqrVlX8IdQTR9pjU59yf61L0udQbAzc5rOtto=; b=t0/GkGqB6xoNf0t3Ag7ugHFhbrz4W5mB1cIrTw3CFbS7VOpSUamopRm5GghboKZt0u AaaG8iJ/CjUH6kNEKbR7QCMR7wc8rLvWdp4i6Gs+PFmHomqaiLrEZC1q0mf9iv6gfzm7 zKNTp9FHKy/5ROwWsWjulheedlDXzybJIo8dBQbqwvH8uHWx6ayXlRZcytvOhmjs1jKa 1XGD7gz7Ayq5xXzfOSg1np5R5WWx/hJGVkUfywT400ZPzQXUoJrwb/u7uBjZbDoR+KPP M9+yxE7fhRx+XTXq3yReDNMQkk6sKMHdyMKW221DZv4PDX3KWW3mL2E2I1kCfmQ+LUmx IxEQ== X-Gm-Message-State: APjAAAWUlP8Ka/XCCqdg0i6gjota7h18IGsbCx+7/mFA2OPU/AUu5ZNJ UlnVlLS4Kugq6yO/Ievos52DG2OA/14= X-Google-Smtp-Source: APXvYqyKg2J5FBt5zIYKFzPKB8SN8GGt6TnCb0Wb7Y+cT9eYSYjyy4fB29b99twirsHuPKiwR1c/tw== X-Received: by 2002:a1c:e108:: with SMTP id y8mr3498846wmg.65.1562075428563; Tue, 02 Jul 2019 06:50:28 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 15:49:41 +0200 Message-Id: <20190702134944.6258-2-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.49]); Tue, 02 Jul 2019 13:50:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 02 Jul 2019 13:50:30 +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.11 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_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.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/4] test_driver: introduce TEST_SET_PARAM macro 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 02 Jul 2019 13:51:59 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This macro can be used by most or all of the DomainGetXXXParameters APIs. Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 4b1f2724a0..c0608a4bea 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2844,6 +2844,16 @@ static char *testDomainGetXMLDesc(virDomainPtr domai= n, unsigned int flags) return ret; } + +#define TEST_SET_PARAM(index, name, type, value) \ + if (index < *nparams && \ + virTypedParameterAssign(¶ms[index], name, type, value) < 0) \ + goto cleanup + + +#undef TEST_SET_PARAM + + static int testConnectNumOfDefinedDomains(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Nov 27 00:29:50 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 Reviewed-by: Erik Skultety --- 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 From nobody Wed Nov 27 00:29:50 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=1562075566; cv=none; d=zoho.com; s=zohoarc; b=lCr/bvsu2dR/C70+1yYoh3R0TxOPXFnyYL5Lp56OYBRGA0DZm+mbrh+8yY8/qHi0NEQOKz0KuW8ydoAn3LdPLChPyoh93nwtmPeYbsuD6/TZQ1AqirYPs5ocgdUCO5B5YwZ+8fTYRJJhEdhUf3FAUYp4Ql+1LBAr3Q9XlxllYH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562075566; 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=3NXFQ1F8BpWCWKR3SjP95lG262vLcl0KEijTKIx6/q4=; b=X48tn7AMLXv/Wrbh9pdqNmpqMWREJf/q0AM0UuGdwOJ+IrpajX6eQN0ZP6WM658+dJXRSnRvjal6/h65QDs1tHwkjVDeMy/iZdWv6TuEFtcicyRuePHbz6kUPyFawl2MD6BB7eS2JcHgxuLwUFE/4SqMj8gIAowxkj0k0o5dfks= 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 1562075566874249.53577683557205; Tue, 2 Jul 2019 06:52:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 21B542F8BF0; Tue, 2 Jul 2019 13:52:30 +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 E3D1317AA7; Tue, 2 Jul 2019 13:52:27 +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 9C412206D5; Tue, 2 Jul 2019 13:52:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x62Dpcn8029153 for ; Tue, 2 Jul 2019 09:51:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9DD7E1001DEF; Tue, 2 Jul 2019 13:51:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 993E31001DEE for ; Tue, 2 Jul 2019 13:51:36 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (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 0867631628FF for ; Tue, 2 Jul 2019 13:51:22 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id u8so1135304wmm.1 for ; Tue, 02 Jul 2019 06:51:21 -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.51.18 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 06:51:18 -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=uemAFiV310kkUlsJqqHwPJNnX3ORwXLSP8IV3FWA0qc=; b=kidu8HDv9U7WUwH+BMPQlKyBa28/KIJXAyhkCpZ+bNntCn0mtUNRl9vNFsXOvAjm/m 670ceQRrpzAtkRImzxVs5GHfMnpTD+S6H2Hq7zjyQTxCiWkRFhciTwcIpaeLwl7Dy5Rl DIgsXHmNoef68/+Xf7eplqx6LIzrjn1l4oNrL6/Amt2Q+xO6dzWmn2NEaeAAJa1oP6Gq LMMweOOtmINgLWR9ducufWg8e2nCW/CpcjrjqGfP6W2vaCR43P6a7EEpIc2CM/XwlgNL 82Fsz+SwEnmGRVWQ0irgvExR5XveWVX6/DVQGmeYycfq6ugPVF577XDSKMCR4XROTifY MRNg== 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=uemAFiV310kkUlsJqqHwPJNnX3ORwXLSP8IV3FWA0qc=; b=ZKhdzEs6FO8YnJPBlfPfwuL4xetbtzmSGZyAe6fjTMhVxrxSppZQlE92kXDy9ZwIKe R+9zdIA6x/bQwCZVkk90rUtB0m8RbY5h3MlGViPqDyqaIIj3eLg0uGQbK1Ype7FnrKvS AEFMy3FoWMTsWCg0DaksYxZQipf04HanR7uKFKADmCZLPnRU94Vp4Z6PxPee8Do8OFX0 sQv4PL5w4rkrjypdvPmP+wwv76v3qeDVtAKc8MqpA7eGManyJkDPUnjw+7EeZ0L60wYH cRm6p4OeIhGhKXeJ17rS3QdYERGSz2De6k7AAPNt8+cQYhGAf0tGU6s4PD562btAq+m4 eTTg== X-Gm-Message-State: APjAAAUjhq7vKDOF1VItg562XhEzHAkewf45vGQaqOAiE22CBE9v28er Uvha9nCFMGerfjpbtqWqVRxNWdbNBOw= X-Google-Smtp-Source: APXvYqyhyTokRGsBwpr7U7Uz+5uWpGu2RmYU4zc0rpkB7RiBTyslf228xPZF1T6oQBSPdVJGtdAUKg== X-Received: by 2002:a1c:e356:: with SMTP id a83mr3746991wmh.38.1562075479653; Tue, 02 Jul 2019 06:51:19 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 15:49:43 +0200 Message-Id: <20190702134944.6258-4-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.41]); Tue, 02 Jul 2019 13:51:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 02 Jul 2019 13:51:22 +0000 (UTC) for IP:'209.85.128.67' DOMAIN:'mail-wm1-f67.google.com' HELO:'mail-wm1-f67.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.391 * (DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.128.67 mail-wm1-f67.google.com 209.85.128.67 mail-wm1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/4] test_driver: implement virDomainGetNumaParameters 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 02 Jul 2019 13:52:40 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 44090a7d71..15894d98ad 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2889,6 +2889,52 @@ testDomainGetMemoryParameters(virDomainPtr dom, return ret; } + +static int +testDomainGetNumaParameters(virDomainPtr dom, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virDomainNumatuneMemMode mode =3D VIR_DOMAIN_NUMATUNE_MEM_STRICT; + VIR_AUTOFREE(char *) nodeset =3D NULL; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG | + VIR_TYPED_PARAM_STRING_OKAY, -1); + + if ((*nparams) =3D=3D 0) { + *nparams =3D 2; + return 0; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + ignore_value(virDomainNumatuneGetMode(def->numa, -1, &mode)); + nodeset =3D virDomainNumatuneFormatNodeset(def->numa, NULL, -1); + + TEST_SET_PARAM(0, VIR_DOMAIN_NUMA_MODE, VIR_TYPED_PARAM_INT, mode); + TEST_SET_PARAM(1, VIR_DOMAIN_NUMA_NODESET, VIR_TYPED_PARAM_STRING, nod= eset); + + nodeset =3D NULL; + + if (*nparams > 2) + *nparams =3D 2; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + #undef TEST_SET_PARAM @@ -7325,6 +7371,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .domainGetMemoryParameters =3D testDomainGetMemoryParameters, /* 5.6.0= */ + .domainGetNumaParameters =3D testDomainGetNumaParameters, /* 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 From nobody Wed Nov 27 00:29:50 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=1562075544; cv=none; d=zoho.com; s=zohoarc; b=F/3BXs6N/YsXbT5WVX+pqejBaztpDaijBtUljwNfQMnjS+m3rgLTD1wTps9wrmBFsMeXo0eq1xPYMgNIPz79/3SE1usdiwHEkb8V+VHdD9Rb+6dxDcP5Q1PULBtHiUSx+VmJ4xoVwpH7g1Xpcyve/9im9bUlLGvXqpEcJzDb5SU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562075544; 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=gGeZ9Z+edJGIDPniSW/cqulq+oIHheqIETZANVO9mNg=; b=oK5NANDskMwAIt8EQE78C9OSKyhM+Lb7TCDh3al6pAJ5tRhK3PcU5HOzLEbkE1mgJdAv7Sbwn9RuYmFwFmFF3pXfvMgxUT/eVtLZlVXqT8cu1ukEboJwEUkXB7gpY5yWOILFfgFN8+WHIm6i3I7jdEPKxsvIEYX6EEoS/1drmeU= 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 1562075544201221.9926780353935; Tue, 2 Jul 2019 06:52:24 -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 D19D03091851; Tue, 2 Jul 2019 13:52:10 +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 032C917508; Tue, 2 Jul 2019 13:52:09 +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 B628C18363C1; Tue, 2 Jul 2019 13:52:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x62Dq5Rx030072 for ; Tue, 2 Jul 2019 09:52:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 98DFE17508; Tue, 2 Jul 2019 13:52:05 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92FCF5C29A for ; Tue, 2 Jul 2019 13:52:03 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (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 300B130833BE for ; Tue, 2 Jul 2019 13:51:46 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id n4so17897385wrw.13 for ; Tue, 02 Jul 2019 06:51:46 -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.51.43 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 06:51:43 -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=8tpG0XuxsnW/g9sXmPRZp6tJOrxT9fNaROKggEG1ggk=; b=uHbIaGo5zTQRacRCuP+Q8AtjsHSJdgoYA0/TWsGU7qLtS8oUXTHRnUftE8gEWCtspr RRyJstE6KOS7Zy8vGnzIdeJ9zBkdBeQ+lVNXbgMY178TJo4kYEuxI+nvLuwkXYsMd3/1 rlGxld4dxVLBr6nzEBn8O0+cQD1/vK9WHaFn+O9vmjAXMfxiFq4wGJSeBxksVkf2wv10 tJ6OkugHRAoyrIBybPO1cccmTbi4qt0fCh33C5OEFwwdHhv1Gfc6jHPk1KOiZT8rfzWY 57maNoKwVfqlWdAXp9ErGE+JDEZgnNovEnNHL4HVCtzpmi9dz1aHptyQa9F6yNR1eFL4 HhHw== 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=8tpG0XuxsnW/g9sXmPRZp6tJOrxT9fNaROKggEG1ggk=; b=PP491J5o24ldUTqp9D4VvBtCfYz4VzsRug2bjmWgBTSulPbQQYMa9YJ9LKzBfPbCCa LU9TT6jG1w5CE6tClbAbOGpVkY8PY/CFl2VCgnw/CZBKlS0GPgwlVcxGZP2Q5Svrl+Rv kS3kjwkt+cYtgqdhjftEmvZYF4HNAK93Z3pafFkLFOCnth3iIe/bPif7PDSZZ0YXl9OC QA6SMGuygazUvPtv+tgwML27UrJ5SQ3ccWoby7GX0JRLAodM1uSCzRcIdbxlPKu9GUL9 gOaqYH6/wbYkDAZAAPqIhCVaWHUd1KS1MpZ+iX1z9QrwFJANIaPE6x1G8oB1tnpqWKty LjAw== X-Gm-Message-State: APjAAAX+tRoAUys7oTJvQp/DgbLSMqW1Z/5DnnhzG0z4pW/hSI7GQf5F cQ8/NEal8VxPP21vK/bpnwqMauBk6sE= X-Google-Smtp-Source: APXvYqyo3td0VkRp3vfVS6Ydls1oyEXdr5R13y5nhtExLIrhQgk38jnJM0+G/XQUkBuEO4kNgmqWBw== X-Received: by 2002:adf:f483:: with SMTP id l3mr25372661wro.256.1562075504513; Tue, 02 Jul 2019 06:51:44 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 15:49:44 +0200 Message-Id: <20190702134944.6258-5-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.44]); Tue, 02 Jul 2019 13:51:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 02 Jul 2019 13:51:46 +0000 (UTC) for IP:'209.85.221.65' DOMAIN:'mail-wr1-f65.google.com' HELO:'mail-wr1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.392 * (DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.221.65 mail-wr1-f65.google.com 209.85.221.65 mail-wr1-f65.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 4/4] test_driver: implement testDomainGetInterfaceParameters 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.16 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:52:23 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis Reviewed-by: Erik Skultety --- src/test/test_driver.c | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 15894d98ad..d2a7d2f840 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2935,6 +2935,63 @@ testDomainGetNumaParameters(virDomainPtr dom, } +static int +testDomainGetInterfaceParameters(virDomainPtr dom, + const char *device, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + virNetDevBandwidthRate in =3D {0}; + virNetDevBandwidthRate out =3D {0}; + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virDomainNetDefPtr net =3D NULL; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG | + VIR_TYPED_PARAM_STRING_OKAY, -1); + + if ((*nparams) =3D=3D 0) { + *nparams =3D 7; + return 0; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + if (!(net =3D virDomainNetFind(def, device))) + goto cleanup; + + if (net->bandwidth) { + if (net->bandwidth->in) + in =3D *net->bandwidth->in; + if (net->bandwidth->out) + out =3D *net->bandwidth->out; + } + + TEST_SET_PARAM(0, VIR_DOMAIN_BANDWIDTH_IN_AVERAGE, VIR_TYPED_PARAM_UIN= T, in.average); + TEST_SET_PARAM(1, VIR_DOMAIN_BANDWIDTH_IN_PEAK, VIR_TYPED_PARAM_UINT, = in.peak); + TEST_SET_PARAM(2, VIR_DOMAIN_BANDWIDTH_IN_BURST, VIR_TYPED_PARAM_UINT,= in.burst); + TEST_SET_PARAM(3, VIR_DOMAIN_BANDWIDTH_IN_FLOOR, VIR_TYPED_PARAM_UINT,= in.floor); + TEST_SET_PARAM(4, VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE, VIR_TYPED_PARAM_UI= NT, out.average); + TEST_SET_PARAM(5, VIR_DOMAIN_BANDWIDTH_OUT_PEAK, VIR_TYPED_PARAM_UINT,= out.peak); + TEST_SET_PARAM(6, VIR_DOMAIN_BANDWIDTH_OUT_BURST, VIR_TYPED_PARAM_UINT= , out.burst); + + if (*nparams > 7) + *nparams =3D 7; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + #undef TEST_SET_PARAM @@ -7372,6 +7429,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .domainGetMemoryParameters =3D testDomainGetMemoryParameters, /* 5.6.0= */ .domainGetNumaParameters =3D testDomainGetNumaParameters, /* 5.6.0 */ + .domainGetInterfaceParameters =3D testDomainGetInterfaceParameters, /*= 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