From nobody Mon May 6 02:19:01 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=1562070700; cv=none; d=zoho.com; s=zohoarc; b=RV2eFwMe1GQzOsaM1+ARQ2XdbYm+wc8jiRQpcBTAcxJ3V2yzE/CsETZq/lhL+s1gHk3rJOHzHd1OA63tfxenD/okiXYE8HLatQzAzZkNfI1KUm2lAc5czJklL5Jz3oc3gxHoKedHzSO6dnRvOEPGaYALm27SZG5XFc9sKMTzRhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562070700; 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=jZzNaO89Jk9IGIH0jDpNdbUKedAC0ZOpf3c+zEpWdgw=; b=I3CngxuGZ6xD6p1OsawCMZC+JbiuITH4x3MeR4BYlgFrdQZGZQpXY8sf6sr/GbQNAwjjQNePY7BBdwjLovIvyRs+Dvica2tN/JgUx1th3jSMYE8yYF4FrTpUzMJeShXoAUvFw+x0FsG0j/v6Z8gUaliB9mZ3oIIpQvVfb1JRXbE= 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 1562070700417493.19738346462054; Tue, 2 Jul 2019 05:31:40 -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 9E03B8B288; Tue, 2 Jul 2019 12:30:58 +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 387F11001B14; Tue, 2 Jul 2019 12:30:33 +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 7CAA41806B0F; Tue, 2 Jul 2019 12:29:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x62CTold005985 for ; Tue, 2 Jul 2019 08:29:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4F7F56B8DC; Tue, 2 Jul 2019 12:29:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49E8C2E034 for ; Tue, 2 Jul 2019 12:29:47 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.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 38322308FBB1 for ; Tue, 2 Jul 2019 12:29:34 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id c27so9908257wrb.2 for ; Tue, 02 Jul 2019 05:29:34 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g2sm2573991wmh.0.2019.07.02.05.29.31 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 05:29:31 -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=5/zCbV/vkjPVyEVEebE7w4xWuIsSLQuHHUicvoJqecQ=; b=ioIdtx5LlnMGn/r+vEuo30AhXNQY+OLZTAjNCAAu8UDJEWroVSgmqIQMi5/+T3j93D 2pwysV2UUpSLK/FkVjgWiWUt8/WOE2t15BA9ColteO54cAad/0sfPtVeeJeBiMaO+Xm0 OigtmCbMJ5HBuisSbIqnylwoQShpiIneckAgEx7g+xxtIAw8utgOv2sJOYv0jTy8/X6j n+1GvXBO46CyyOkLcwFai/1GUETU5LkqfYWf3UtmWgTwBZ2q7Nj92BDEjw5Bx86x4SVf cHlJC5f7cDU/q53cOXDZyQ/IEz2lnMlGFE2ZEqqkCoPclhztqPT9qFWQOhLz9j0+/0o1 1EbQ== 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=5/zCbV/vkjPVyEVEebE7w4xWuIsSLQuHHUicvoJqecQ=; b=LgBoNuYVyuZaYrl/jt1q4Hju6c02WfCv0XKIk+Iy4x8Sazcah3GOXC9fAz369BM3TK X2ImGqU+c1TaMw8kfjygARdEn8DfP+kccTz16Nz5ya/0iW5vItn5L9b1u1HApwiRoVLQ PwHX2ijbLmAz19oA3Zx181K9Da4fGetjgEQXdE5DVghdhg9JRqSF/6mmukz9dLriGLc8 46u8qCtXKgWHkOnIuTrCZxd71w/9XYHlVeHCH7QGwISBdvUUSGuWx5wzPl4ISr3debCR ag9OwqBz/7MWt8opkINAcy2yd9mohQXmb/60xiCuhAvqThynh3H0RahDoQfyIhYnyu8k IDEw== X-Gm-Message-State: APjAAAXSheZRup+rT6FR1Xu6IZWj2CjinXN9jqOmeOU/whN5CUohyhfC zrry1mKg92+e0PCvZPBn1p62+FtY6ZA= X-Google-Smtp-Source: APXvYqwPwvrj8Xw8O7AbYTwxBbDSjhh+4qQfi8ij6Uq3f5fCaDQhaoALIl93S9zSkcHNZdOl0Jm9Qg== X-Received: by 2002:a5d:628d:: with SMTP id k13mr24816914wru.317.1562070572537; Tue, 02 Jul 2019 05:29:32 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 14:28:59 +0200 Message-Id: <20190702122902.10726-2-stamatis.iliass@gmail.com> In-Reply-To: <20190702122902.10726-1-stamatis.iliass@gmail.com> References: <20190702122902.10726-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.43]); Tue, 02 Jul 2019 12:29:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 02 Jul 2019 12:29:34 +0000 (UTC) for IP:'209.85.221.68' DOMAIN:'mail-wr1-f68.google.com' HELO:'mail-wr1-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.221.68 mail-wr1-f68.google.com 209.85.221.68 mail-wr1-f68.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 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.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.30]); Tue, 02 Jul 2019 12:31:38 +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 --- src/test/test_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 4b1f2724a0..29b388e2d3 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2844,6 +2844,13 @@ 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 + + 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 Mon May 6 02:19:01 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=1562070821; cv=none; d=zoho.com; s=zohoarc; b=lrSzdaHtue+RIuMjhjrt4eva8JoRcvmkjZO1bX7W9CPylqr8MHWu5b8QcEwXdEwKg2pKQ3xcAy7QXSiUPxGXw+a1B5mqdpbYwUUrUBCyBUIDv2di/ow9YyB541tjLUInLhg3lVRxMlSRNQzRvumvswyr6shmIVxzYBSHM+31XWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562070821; 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=1qd+Du5N24GP4uW+8GmXCMnAlATbKZb0ZYbVqBQxJ+8=; b=Zso7BM/zwR95C7yUAx+k5Fsix4++TA3RmCgVLQ7IjWTDuP5eds9HnZzraxdyI5iAOi9PBRJfgRMmEtfJcPCxqC48yHi7N/WdRxZ/XYYSsaOvDUmslQn+BhuHJhLe7z0DnwfopO1pZKEMkuC0f+/HJ98MGNqiuKTDCrFSnZm7Wsc= 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 1562070821798398.6794640642112; Tue, 2 Jul 2019 05:33:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23CD5C057F2E; Tue, 2 Jul 2019 12:33:34 +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 E630B5D968; Tue, 2 Jul 2019 12:33:29 +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 95D69206D4; Tue, 2 Jul 2019 12:33:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x62CTwu2006168 for ; Tue, 2 Jul 2019 08:29:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 140812E036; Tue, 2 Jul 2019 12:29:58 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DA252E034 for ; Tue, 2 Jul 2019 12:29:58 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.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 46DA4309266B for ; Tue, 2 Jul 2019 12:29:44 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id x4so17603289wrt.6 for ; Tue, 02 Jul 2019 05:29:44 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g2sm2573991wmh.0.2019.07.02.05.29.41 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 05:29:42 -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=Q4XFsWQimx/KdxWsP/s+UZ70t9e2/KXY1NRXRa/dxSg=; b=LCllLeOkOcIniolr8cOSgI+kb26G20abVBqQZYQqpp+QAAXqsWqwiYku0a9wYMfNIj RxlCKuZMzJmdB4CtdlwUNF6fxkJre04piHB4OcjySPvrCBApiMIHUC5kFtC/JQBEGqEm R56c5o2C/phYvifHXt9+9Cfn/LULN7h+WAVlkrhHLp9k9Wt0esJv2dCfb7GNUkmCV+DY 7/EuppBe5VK5Z0jtl9fL8g0f3iBP0CHThyuabvQhvzWg3/ER1qjaJDTIs4srgSk3crY0 gPxNdKaPHJXvDkSteN4h1HYD5OXZTjXNt9lw2l7MFj+bk4s/cU612ZElXm/UeS0r6mD1 r0kQ== 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=Q4XFsWQimx/KdxWsP/s+UZ70t9e2/KXY1NRXRa/dxSg=; b=Wd6UF9Tj0yWVProj1IAFlHCr0+ho/hEyLHVFFymWpyEvwAORXY9K69fntGdoZtb1ut FboCoUGl7ENRRvzIIxDMFELPWPVDVFxkMY2sjNPljG+uZk9pDCmJT5wuUolZnJT+Tgyb xqU2CarelTcyN7FobCR9uzcel2gaf65BVzgWciFu0bAI9CQOrP5ITzcJ2yeXmniBzeeg wJ5lvsy2wkd0z2aPOq3bxiGxipmwfXQiQ++HfV0Jy8w2s2WOLqxB6A7gsolUTHusccIK 04w9I5e6nyGNSfBXDg0MGEmfDtkax3ueGuN6yI6YpYxMNTB3mQASesXA1Mo5h89nnhKc kfkA== X-Gm-Message-State: APjAAAWbiijF17P+BCX5brbnAm9gMWFcFc+Q0XzZVbsr3cM3ZqV+VYAt NF2+JrwDbu+ezHNlYWOliBAWg62YijM= X-Google-Smtp-Source: APXvYqx4aXZUoUzRKq3VQYeWt+AcNACZhKjfD1goVcrdpgYVPenu5H7+sLsFNILQSoOT64qq0n68pA== X-Received: by 2002:a5d:628d:: with SMTP id k13mr24817400wru.317.1562070582652; Tue, 02 Jul 2019 05:29:42 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 14:29:00 +0200 Message-Id: <20190702122902.10726-3-stamatis.iliass@gmail.com> In-Reply-To: <20190702122902.10726-1-stamatis.iliass@gmail.com> References: <20190702122902.10726-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.43]); Tue, 02 Jul 2019 12:29:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 02 Jul 2019 12:29:44 +0000 (UTC) for IP:'209.85.221.67' DOMAIN:'mail-wr1-f67.google.com' HELO:'mail-wr1-f67.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.221.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 02 Jul 2019 12:33:40 +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 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 29b388e2d3..3c60d8dd0a 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2851,6 +2851,45 @@ 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; +} + + static int testConnectNumOfDefinedDomains(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; @@ -7283,6 +7322,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 Mon May 6 02:19:01 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=1562070838; cv=none; d=zoho.com; s=zohoarc; b=LU3WDQ0TfQi5/MrFpM0W4iNUDTXBte9MCKoG6HI0k/iJrzaFBan/qiEKYQsn4DsxtzbC8UGaxdEFbofd+Gh05uRFuStyuPH4WNdLB+ll80hePIkHPNJ3g0n3/27AtjQCDsmdEupvmQeMDwXKTMnS4PRsniTF4tmXyHWAen9XZ3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562070838; 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=T0xxv7CjMnfnCvlsODRo/QoJ/KZKcyPZPIt6ATqnSpk=; b=Vm87Q+NJ6Hfp1y3q/P2+IQPoaCXJjiS56/qrUFeRTV7Qrafer/QFQqECBizuRLY83ge9UIrWDYqfdoa56qzLaj/11Cy/31Vzx8R0LBBji5Bv82/61jUaJKCK9x6NxxBj0FxwW14aJ/5AWMssDBdgLA3PRrDgR1ZJAtyG0kuOr+M= 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 1562070838662673.4688778597563; Tue, 2 Jul 2019 05:33:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEC2C30C1328; Tue, 2 Jul 2019 12:33:44 +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 82DC519730; Tue, 2 Jul 2019 12:33: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 419331834FC5; Tue, 2 Jul 2019 12:33:42 +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 x62CUN1i006746 for ; Tue, 2 Jul 2019 08:30:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 50C0861498; Tue, 2 Jul 2019 12:30:23 +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 441FF4C492 for ; Tue, 2 Jul 2019 12:30:18 +0000 (UTC) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.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 E9AD2356CD for ; Tue, 2 Jul 2019 12:29:56 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id p11so6398993wro.5 for ; Tue, 02 Jul 2019 05:29:56 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g2sm2573991wmh.0.2019.07.02.05.29.54 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 05:29:54 -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=ceTvS7fdhNm/o8cyb4vZt2zK5MRuclU1MgVGUlGkM1A=; b=AdiAj/il2XZWytfaORMgXkhG7srHI7GiB4tuG2sl/JlRjouHbbpBBjxbVwT6TW25o0 P/rs97bf8e9zHzJzWIx5MTiqhawkHqp1KyD5gWFuYXgn5qdDy7LO4/3X9N/Lub9m8v72 yNG5qAnlItG4rqdUNmml61xGN0vKYlEE8lhlzRJQEub7ikUnRMMgBOsYcKMBNmDyguDN mLbPwfcDYN0qIoGPocZA9b9S7KD58TqVuNUU0s6pQG3M7/LtU+53gr3UhzLuAvVaj+eO OdK1WxSvkg8Lc5G9TrxJlJLpzxecaIzf4gnHtNBPpUei/YvcWCKutk8Q7PmMHdAjwTyC 5yhw== 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=ceTvS7fdhNm/o8cyb4vZt2zK5MRuclU1MgVGUlGkM1A=; b=IoTrn3Fv1uTqT38Kfl4i3Ufawes4tjyUDbrwr1HeGu32D8h+rhNfyHDiGYjk4yKqip po1AswAnqdVwE+bIhL+BIBMgx5WsOHlAm6VFcFe9HE3RR7oagnHO5/efsdKAu6KJk8dl 1HhOC68YycQtr/BJWqN7inh3IXd5jRKPbkxcSf+Jgii78yW8KUK79Z4YXhV52nbRcqGT lgfrNvDFuDnoht0eWElyanF1uLrGk/kCDTlfIjxk/WfJ0CB8wyIoaAluPOtIOOQhA4uW BItd+w+XCjEnVZafLS/dEsRV59p7O6OKJSvlN2sXGoVAk7QAVMB/abph2oBcRIpCNG8+ 6nGQ== X-Gm-Message-State: APjAAAUCNWmgTkt81MDqEFYr69M9U6EW84+OywuNCfz0w328N25mUcAR A0p/oi0rVDSfqnmiNUFmq8vzClm/PgI= X-Google-Smtp-Source: APXvYqzkZ0peR46P2OA9TXELIPxQG/wK+0t97Cj9ZLOtd4+Q3dOs4Gius9gOaUJB6fVZU/hbNCcw0A== X-Received: by 2002:a5d:66ca:: with SMTP id k10mr1305396wrw.61.1562070595322; Tue, 02 Jul 2019 05:29:55 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 14:29:01 +0200 Message-Id: <20190702122902.10726-4-stamatis.iliass@gmail.com> In-Reply-To: <20190702122902.10726-1-stamatis.iliass@gmail.com> References: <20190702122902.10726-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 12:29:57 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 02 Jul 2019 12:29:57 +0000 (UTC) for IP:'209.85.221.68' DOMAIN:'mail-wr1-f68.google.com' HELO:'mail-wr1-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.221.68 mail-wr1-f68.google.com 209.85.221.68 mail-wr1-f68.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 02 Jul 2019 12:33:52 +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 3c60d8dd0a..8c3a41b34b 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2890,6 +2890,51 @@ testDomainGetMemoryParameters(virDomainPtr dom, } +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; +} + + static int testConnectNumOfDefinedDomains(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; @@ -7323,6 +7368,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 Mon May 6 02:19:01 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=1562070744; cv=none; d=zoho.com; s=zohoarc; b=olNmc5KRDNmgv3Ftopnsc5Py0qtz6TCs/lRO6nk7B7gDJsS6gmeaHfd+VWdixZCDqF52ghryQckTHz6A7j7Ap/HRiW24/HD5sLLjR4zPnfv79tb5Dd+ZNa6p3VjtV091+PcadCSv1ozp+QdSKBTT72LdUVLhlE+kH35n3V4NsXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562070744; 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=9JH3WZcdgUTKjRszkYxlx3x1IkTqFTv5FNr0wBXXPGU=; b=UlyGCyFdvrQPQjTdAk/qy5wUrRxYeIeAXppF5xjGYxqJZ6ngkaF0q0OPe0jhjOjPLZtdic96A4croVRJ6ZsV/yGqUS6ZxqbPD/g1RcuDMEeoidqU4vE3rPhR0nejwdR4Nv8ZrhqDGcbE5O8/PsCkN6m5lfaUBEOePObgOBY6wYI= 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 1562070744273896.057665173653; Tue, 2 Jul 2019 05:32:24 -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 381983162913; Tue, 2 Jul 2019 12:31:49 +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 E8AE77E56B; Tue, 2 Jul 2019 12:31:45 +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 DE5141833018; Tue, 2 Jul 2019 12:31:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x62CUTWh006886 for ; Tue, 2 Jul 2019 08:30:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2506F6B8DC; Tue, 2 Jul 2019 12:30:29 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D28B7836A for ; Tue, 2 Jul 2019 12:30:26 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.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 A22CF8830F for ; Tue, 2 Jul 2019 12:30:12 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id p13so17578137wru.10 for ; Tue, 02 Jul 2019 05:30:12 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g2sm2573991wmh.0.2019.07.02.05.30.10 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 05:30:10 -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=V6/q2XD4VSi+l/emUTxYoN4/D1DrVjP27HR4LC53fWo=; b=AIuWum+itaWIOwGGUliIQOIjDNaAUueG7e94WMSsLI7FL4FqS13RZhvWKN8/KE4AMQ Ilh6d36lJnqiJQDCgZUrQybM2+VvXOSzUBkmWhHmlM8oAz/6+x/jZOk6llVHSPYQ02mK 6qgATf5R9jJSAQ5qx9UXfVPoMoJo8X+zAMFaMs2dcsrVc+0pMkD2GBXUVz+S/evOpzNk o69+FTpeeYuqO4cnMhsIlzFT3TwT5AxgoP1kpMvWy4mbEBlS+P48oQ9GVTbyyoOgpBka rY2g1X7O/ZsqzdQYrZrFqzWk//dcoQkgK1ZfXQutdYQ4nN03LurD4nqK8v9lSuCVSLyv GyuA== 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=V6/q2XD4VSi+l/emUTxYoN4/D1DrVjP27HR4LC53fWo=; b=kjOP7NC/+paV6f2tZ0x2ihX0yzw7+Cy3AKRB7a2zHpvIhfwkFM1w//pUAFYs708c+e jck0yv4h6NKLT0qE5dW/uRPQCuHyRIOB6jcQQlS/l70Ct3v8+uK7SocfhVb+oxn8micn X1WFvWBKIZc/yPMKXOxqj9/y2vyY8bq/JcP5vTPAItbsPWowCELAT/qWPZmUphQPkKR0 lp+1KYv00XChD9d06YWhM/+LPNgmqtXRiPexd/MygjgEz8B5QH4XZk6slKxN844xycIU db7tcNtT5Nt8nOFtRyU3ivBYCYTkr+g5FsqSHsJpi+K6nDREnOiUdW1Z5kmur6K6qGIk u4KA== X-Gm-Message-State: APjAAAXYDKJZg0P6740jfMEspC2KLV/0VQ5B5WxI68lgD4O/H7A4iY/x +D1tMK3umcK4l4bO9UE4np622NYFIaY= X-Google-Smtp-Source: APXvYqwmcYmo+hZk1MK0LxpJp+Ozjh/K+a0zQpnhc5QvLjmj5fsWzW/0c+d3S/PHzpnIQQFYd3HVkw== X-Received: by 2002:a5d:400f:: with SMTP id n15mr15582157wrp.312.1562070611007; Tue, 02 Jul 2019 05:30:11 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 2 Jul 2019 14:29:02 +0200 Message-Id: <20190702122902.10726-5-stamatis.iliass@gmail.com> In-Reply-To: <20190702122902.10726-1-stamatis.iliass@gmail.com> References: <20190702122902.10726-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.28]); Tue, 02 Jul 2019 12:30:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 02 Jul 2019 12:30:13 +0000 (UTC) for IP:'209.85.221.67' DOMAIN:'mail-wr1-f67.google.com' HELO:'mail-wr1-f67.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.221.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 02 Jul 2019 12:32:15 +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 | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 8c3a41b34b..59937ea968 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2935,6 +2935,69 @@ testDomainGetNumaParameters(virDomainPtr dom, } +static int +testDomainGetInterfaceParameters(virDomainPtr dom, + const char *device, + virTypedParameterPtr params, + int *nparams, + unsigned int flags) +{ + unsigned int in_average =3D 0, in_peak =3D 0, in_burst =3D 0, in_floor= =3D 0; + unsigned int out_average =3D 0, out_peak =3D 0, out_burst =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 && net->bandwidth->in) { + in_average =3D net->bandwidth->in->average; + in_peak =3D net->bandwidth->in->peak; + in_burst =3D net->bandwidth->in->burst; + in_floor =3D net->bandwidth->in->floor; + } + + if (net->bandwidth && net->bandwidth->out) { + out_average =3D net->bandwidth->out->average; + out_peak =3D net->bandwidth->out->peak; + out_burst =3D net->bandwidth->out->burst; + } + + 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; +} + + static int testConnectNumOfDefinedDomains(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; @@ -7369,6 +7432,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