From nobody Thu Apr 18 14:36:37 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=1562844139; cv=none; d=zoho.com; s=zohoarc; b=hVu3wfP0X26H2MDD3lCyePaJ+dEy2G/Lkycv1hIlHfjhcv3mS7dH8hL/pp8pnpcPAIv8ba6JcAHJDyjOmDB9pmU5OG1Uof7uVSklC8ixW1Z7h2Jfi729c8jzMDmI/LqfC0UEeoVopw5dDGAyUPKa+lj+FFeWQnWMNBiPUz3F0JY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562844139; 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=9i05wkApKdA9UIQ8TTP2XW9kyI+19vb+SKWqSFzAmU4=; b=aGJFqpvMvXQnaT1dW7HuwSBel2NFES4jXsSTHT/ku7Nr8EdU3sbRJs0zshiKA5Kka/10VQoNCJmp3UdtriEHAPCkc5mylzhCFoRjxZHuEAoObptzI1CQEviIZ8sv1q4jasWEeqqRydiOobMQC1CP0U5sWgudtG49x1+W/XYF3II= 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 1562844139795625.4233076322593; Thu, 11 Jul 2019 04:22:19 -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 B2DFB308624A; Thu, 11 Jul 2019 11:22:16 +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 50F261A4D9; Thu, 11 Jul 2019 11:22:16 +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 341828E1F; Thu, 11 Jul 2019 11:22:15 +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 x6BBMDMI028146 for ; Thu, 11 Jul 2019 07:22:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9953060600; Thu, 11 Jul 2019 11:22:13 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 939BB60603 for ; Thu, 11 Jul 2019 11:22:11 +0000 (UTC) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.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 5DAA681F01 for ; Thu, 11 Jul 2019 11:22:10 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id f9so5824560wre.12 for ; Thu, 11 Jul 2019 04:22:10 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id m16sm4969549wrv.89.2019.07.11.04.22.07 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 11 Jul 2019 04:22:07 -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=Br3r98XRmWhJB9vg3P8Kjj8rHKPxMdRIt5STQL9pL/s=; b=e2Sd1kxPmFcJsEw4ej3NGYxNctCMmaG6wWaCRgpQvx/IkECYasfoWgPKRRXVWYhO7r CSjIoGlmACD1eLjazMzw4FYWTRJKMaSTlR+4fizdVZJlzulBngEyaL6KtF5Q++KhhMeZ t1Zh2UsolP0x8K3n9/ocVHGSCkcvo0k1n3ee6ygS0FExqPUgag9lv2OXOAaBKElcxC84 W3K3sSwaY6dtw6IXpHG2AEvDAn10A9HeMk8/ekB7q4UhKa9FXYT29wOi8BbdDp1Ao9ku klZzrBi2tHKgxmvc94jy/ZoTjC7T29eTUImDgKp0ngAignWj0sA+0jrACYz0H4uXls4a iGzA== 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=Br3r98XRmWhJB9vg3P8Kjj8rHKPxMdRIt5STQL9pL/s=; b=ozVhy7sq216a+4JPvGnCOraW6gsuvn/Vk19isUtPRMnHXgfYWQchRJfBlBb58D+Ccr 371Qg7Otos8C9ZStvlmP2smljAoSOvMIaDlwl3ctd2PbVamrpHctEv2Vn8+WJ6uv22vz 7CtRjtqs0uSArtLEpJuIi7mU9Tp3n46raZHJ4GZdox/4t/ugIxKD5yPVN2SSHqcO+jpz VlCpfIDBzbnoqyC7my0Lg0KRp3eBPpkEnD4t4VxKqp/tgb0wm6B+4RPo2xwQ2RUpYSWx m3xb/hqjaEO4c0ARzJHm0pFrFopmWATnFqOGr8DcFrX60G/hQVB3dr786LJJhKqiNSPc S3Gw== X-Gm-Message-State: APjAAAVwZbnPAMzE0FqnbzVtwArRAyLIcsYzFNuhgA+cBLS9xzeI5N7Q wqGq4vRXvhCQ10dHBSRYv16Tj9Kz/aU= X-Google-Smtp-Source: APXvYqxfTDnmCvPCisgXAEEcG6sQZbBp7oRHczDm3Mr3/SrNC8oHP+nCuQst183WIHnZB4uyd1X/Bw== X-Received: by 2002:adf:ebcd:: with SMTP id v13mr4679236wrn.263.1562844128456; Thu, 11 Jul 2019 04:22:08 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 11 Jul 2019 13:22:02 +0200 Message-Id: <20190711112202.18865-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.25]); Thu, 11 Jul 2019 11:22:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 11 Jul 2019 11:22:10 +0000 (UTC) for IP:'209.85.221.66' DOMAIN:'mail-wr1-f66.google.com' HELO:'mail-wr1-f66.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.194 * (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, PDS_NO_HELO_DNS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.221.66 mail-wr1-f66.google.com 209.85.221.66 mail-wr1-f66.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] test_driver: implement virDomainSetMemoryStatsPeriod 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.49]); Thu, 11 Jul 2019 11:22:18 +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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index c10344f6cd..b6394fad2b 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2469,6 +2469,40 @@ static int testDomainSetMaxMemory(virDomainPtr domai= n, return 0; } + +static int testDomainSetMemoryStatsPeriod(virDomainPtr dom, + int period, + unsigned int flags) +{ + virDomainObjPtr vm; + virDomainDefPtr def; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + if (!virDomainDefHasMemballoon(def)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("No memory balloon device configured, " + "can not set the collection period")); + goto cleanup; + } + + def->memballoon->period =3D period; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory, unsigned int flags) @@ -7619,6 +7653,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetMaxMemory =3D testDomainGetMaxMemory, /* 0.1.4 */ .domainSetMaxMemory =3D testDomainSetMaxMemory, /* 0.1.1 */ .domainSetMemory =3D testDomainSetMemory, /* 0.1.4 */ + .domainSetMemoryStatsPeriod =3D testDomainSetMemoryStatsPeriod, /* 5.6= .0 */ .domainSetMemoryFlags =3D testDomainSetMemoryFlags, /* 5.6.0 */ .domainGetHostname =3D testDomainGetHostname, /* 5.5.0 */ .domainGetInfo =3D testDomainGetInfo, /* 0.1.1 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list