From nobody Sun May 5 12:26:46 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=1561738600; cv=none; d=zoho.com; s=zohoarc; b=gt0aRhaMKRtgkvDI+l1uDJM+Rkm1BTl3YSY5Uh1ikQapI5j7WcN3ojW/KgmJ0FJQi+3jeyvO90cqjkv7Go8xgzljzrwpr6hGUTA7Yvk9o2R6/EEgpDqW0ceyu49izBjBPqVhP4BdVIDxr5s6MBQeJ3GRAvEA14+Py/IRZzRgrKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561738600; 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=qGFAyRMKL3dv0buUiARIoTE+ISnENVBPKamUk5zRBpQ=; b=MvOHMNojR+ym9FC8CCswfNhDCNCLz7QmQvfFz4i8XkxznxLcZwLGkoOh0u/GM8A7imkW0GCX5P0HJ14pN0aSlwD74wkss2R10hRerJzlHIQKsDgrZR2zu23PVQpfNvzSKVQz+vJNwlXIu7WbbQrUJnJfNRsB/bnNKjF1jd6gOfs= 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 1561738600994563.851391527808; Fri, 28 Jun 2019 09:16:40 -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 2BEF030832F4; Fri, 28 Jun 2019 16:16:17 +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 252765DC19; Fri, 28 Jun 2019 16:16:08 +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 ECB07206D2; Fri, 28 Jun 2019 16:15:42 +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 x5SGFcJP002118 for ; Fri, 28 Jun 2019 12:15:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id DE9F8608CD; Fri, 28 Jun 2019 16:15:38 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D7EFD608CA for ; Fri, 28 Jun 2019 16:15:36 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.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 2A08F30C0DDA for ; Fri, 28 Jun 2019 16:15:25 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id s3so9638782wms.2 for ; Fri, 28 Jun 2019 09:15:25 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id p26sm3742029wrp.58.2019.06.28.09.15.21 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 28 Jun 2019 09:15:22 -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=BFdSMMK/flPZk4is42WW3rPhB57j2iJdKTjiP1YLDSw=; b=tCy+Wuzrqpsrk9hoPrCWBNpyJp+EacU3HdYQvqo2j1gMZ6lf4WBB3HQNJndh385sWi dyl1xi+5Tj3+23Oxuw/VTKaiGzSSnE60fIzU7uICWeF2gjV74p+XBMadsOYVHDHa3a9J 6Xo4RzofgA+SsQVKIx5UWEh+MzvFHFyTWkNACQyWA8CIfsgnkWA7DCDMNiuaUARhd5g2 aqYq0zQre3N83knRb3e/OhRgB3fhnwanZifB+FykOJNXjm/z07LPYNmnvZiWOYk7g9Q3 H2FK/W2Prk0wd1orXONA61BrZdOlHWljdxcONT4cib6dI4MSPeobcGPRxviJRjto/vn2 hADA== 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=BFdSMMK/flPZk4is42WW3rPhB57j2iJdKTjiP1YLDSw=; b=gg9q+rRgoix3RJJUE4LSDB3ZcggFWTBaXQ2hrUE9wq+pGVwkeArSA+XfsnDk/24XQ2 ZrX06YgOK6JCh+m8ppgjYDR661El3j2rDKt3ynCRA6wpMwhe/Wy+wvnJfSOd5f6qownQ qoRn5kg/9jz3T8hh9Siq73/8PL7P8gxWXw6oqXVvIpFMxk/68IeQup6BQ2wrXfeBRwDL 46KHOgyrihZhsd/wL2S9f5iQDKdH+9RRAeuHNdE/oFCNMkY3dZvRauEhqMCcdjk93EXW uNd0olfVA8v0KmCaC3JUuXJNdE2gPFSQ6ZrTaoqKe5JERhtJqrXZqgH9vlAoiPS3HBH1 ZZHQ== X-Gm-Message-State: APjAAAX71IejWHouLdlQhrQdbVFEXqNRhdeQdKkz6NCmr+Um54gmMe0X PD3Z37LRf8ATpvgwVTl+5U8exKEenqDL9g== X-Google-Smtp-Source: APXvYqyiCdoHusyb3bl2VXBLLj2eA0KunKkDt/+kRjoamTdNChij0VnxfEPPaq9wktJFgjG1kpSIVw== X-Received: by 2002:a1c:1fc2:: with SMTP id f185mr8128351wmf.154.1561738523321; Fri, 28 Jun 2019 09:15:23 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Fri, 28 Jun 2019 18:15:01 +0200 Message-Id: <20190628161501.10344-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.45]); Fri, 28 Jun 2019 16:15:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 28 Jun 2019 16:15:25 +0000 (UTC) for IP:'209.85.128.66' DOMAIN:'mail-wm1-f66.google.com' HELO:'mail-wm1-f66.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.128.66 mail-wm1-f66.google.com 209.85.128.66 mail-wm1-f66.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] test_driver: virDomainGetPerfEvents 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.44]); Fri, 28 Jun 2019 16:16:31 +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 | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 4b1f2724a0..215171839c 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3293,6 +3293,53 @@ static int testDomainGetDiskErrors(virDomainPtr dom, return ret; } + +static int +testDomainGetPerfEvents(virDomainPtr dom, + virTypedParameterPtr *params, + int *nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virTypedParameterPtr par =3D NULL; + size_t i; + int maxpar =3D 0; + int npar =3D 0; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG | + VIR_TYPED_PARAM_STRING_OKAY, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjUpdateModificationImpact(vm, &flags) < 0) + goto cleanup; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + for (i =3D 0; i < VIR_PERF_EVENT_LAST; i++) { + if (virTypedParamsAddBoolean(&par, &npar, &maxpar, + virPerfEventTypeToString(i), + def->perf.events[i] =3D=3D VIR_TRISTA= TE_BOOL_YES) < 0) + goto cleanup; + } + + VIR_STEAL_PTR(*params, par); + *nparams =3D npar; + npar =3D 0; + + ret =3D 0; + cleanup: + virDomainObjEndAPI(&vm); + virTypedParamsFree(par, npar); + return ret; +} + + static char *testDomainGetSchedulerType(virDomainPtr domain ATTRIBUTE_UNUS= ED, int *nparams) { @@ -7287,6 +7334,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetAutostart =3D testDomainGetAutostart, /* 0.3.2 */ .domainSetAutostart =3D testDomainSetAutostart, /* 0.3.2 */ .domainGetDiskErrors =3D testDomainGetDiskErrors, /* 5.4.0 */ + .domainGetPerfEvents =3D testDomainGetPerfEvents, /* 5.6.0 */ .domainGetSchedulerType =3D testDomainGetSchedulerType, /* 0.3.2 */ .domainGetSchedulerParameters =3D testDomainGetSchedulerParameters, /*= 0.3.2 */ .domainGetSchedulerParametersFlags =3D testDomainGetSchedulerParameter= sFlags, /* 0.9.2 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list