From nobody Thu Apr 25 20:23:34 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=1557260658; cv=none; d=zoho.com; s=zohoarc; b=mklws+ClL9G0mP2q4mwnWRbhG4aKVfa3dCyNWukoZwtWW3m4JbcOIbGHmYWjtr1qo2C+k4wIbBEwgkISjaAJfpQxNlt2qGYM4KG35CNn/g+SQEjzxFuVCT9Dtyej6hUWJbXRW9pqiwBXSDJJpeRK9hj575jPlqD6YLvKzMK2UbA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557260658; h=Content-Type:Content-Transfer-Encoding:Cc: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=21EfaDk/4eJR17BkQ3GdIDcsl+0MXt+t32XLXS+zFR0=; b=OGYM8o61hnGiIxI1jRknxoYQ9bzKOqhNuF3sZgKDjbCKjPcT6Pz3Cg7q268LfCejCXuI04cMBy7ff/mx3YsQM52Qk9ZUKK/pb1iFelpqz5Pd16ngwe2zw6UfHCQIGC12pYc4tsGuh4Oxe216CvRNW+yl6JZKsvBczNe8kh5P/uI= 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 1557260658407887.4904071799745; Tue, 7 May 2019 13:24:18 -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 88F623079B74; Tue, 7 May 2019 20:24: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 5F76F2E030; Tue, 7 May 2019 20:24: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 1AE3141F3D; Tue, 7 May 2019 20:24:16 +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 x47KOE3e017422 for ; Tue, 7 May 2019 16:24:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id C01FA3D8F; Tue, 7 May 2019 20:24:14 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 830033AA8; Tue, 7 May 2019 20:24:12 +0000 (UTC) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.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 8BEBE307D95F; Tue, 7 May 2019 20:24:10 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id w33so17600457edb.10; Tue, 07 May 2019 13:24:10 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id u10sm4335937edj.22.2019.05.07.13.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 13:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Z/0YgO16G9oWh+KlSwR8Ga35pE7QME0HZLuYErfaPV8=; b=Ph9Uc4/G3lUWE5GWNJzeRr2kR/xc/Qkhl4ShYA9RAHmb2zaoYMgvD4ITF5Wu5FbGAL /AvukRVrc5SrFzdHVKObZchNa6BqbqIDw+zjiEilvW7CKN1p3t4kJ95ltBel6MLbjuH2 9dCalrYS9cHpkzT2o1SDvx/b6yVNw+L4oo/J+EiRgBUik7anIqiZnmjWrvA/AbZYFFGT ws5FXq+ydjz1ubVpv8/VKp9hw9n3c+jRnKgTFivlU5Xw4xrppoFMpD1YpkNVw9Eg0qLq txkWTXixPQ3vqmtC+Dd0uWrIfutxC+8vfFeAh7gi16pcr8eANGz9/4PSjwTejH2eo7c6 AtpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Z/0YgO16G9oWh+KlSwR8Ga35pE7QME0HZLuYErfaPV8=; b=HgVTirdBdg/BcbtuqLjqFbckVUN76WShHgIK5CvvfFsOMBql4JXH3d54LxadapIbtK IMIB/Blqm7dyso8440rSnIkRPymdccRS+s5eoMtP/bmcv3SKKC7/ij5Bt4iEZNrf7xra DgqK6RSQvnA9Jewto+/JT6ca4Ds2WpI3uN6NFAp3YBVRhgZP91EQbYtGooLOko0QF9tZ Xm1jjhcVeh6hXcfLH95MCosWeQ3aJBOfdgCwr0it+VRgyCZWf21PvNo9ZdcfzWnPxqnf OcYAU09W9FPhq5K69KDII3D5V4ukVNSHpiZtJXwHcMJ5ze7YWi07hnSKc4tuMARhOxyF Khfg== X-Gm-Message-State: APjAAAXHnQ7ktT+TNsiKJ7XnuXGnYyXWgVUeIbi56pQy4ONmR9ccHVc/ VdNzFY/42pD3sE2v6+bRew7992FbcE+3XFmv X-Google-Smtp-Source: APXvYqwekdSNQiUAmOxvyy3mhAnRnC4/Ivc3NKrU/t2Z5L7QPvwiaUGMLG7s7Ot8q/9DWD2b119BcQ== X-Received: by 2002:a17:906:b20b:: with SMTP id p11mr4436292ejz.233.1557260648841; Tue, 07 May 2019 13:24:08 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 7 May 2019 22:23:20 +0200 Message-Id: <20190507202320.32233-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.48]); Tue, 07 May 2019 20:24:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 07 May 2019 20:24:10 +0000 (UTC) for IP:'209.85.208.67' DOMAIN:'mail-ed1-f67.google.com' HELO:'mail-ed1-f67.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.208.67 mail-ed1-f67.google.com 209.85.208.67 mail-ed1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Ilias Stamatis Subject: [libvirt] [PATCH] test_driver: implement virDomainGetDiskErrors 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.41]); Tue, 07 May 2019 20:24:17 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Return the number of disks present in the configuration of the fake driver when called with @errors as NULL and @maxerrors as 0. Otherwise return 0 as the number of errors encountered. Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 460c896ef6..5fa9ab30f1 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3046,6 +3046,32 @@ static int testDomainSetAutostart(virDomainPtr domai= n, return 0; } =20 +static int testDomainGetDiskErrors(virDomainPtr dom, + virDomainDiskErrorPtr errors, + unsigned int maxerrors ATTRIBUTE_UNUSED, + unsigned int flags) +{ + int ret =3D -1; + virDomainObjPtr vm =3D NULL; + + virCheckFlags(0, -1); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + if (!errors) + ret =3D vm->def->ndisks; + else + ret =3D 0; + + cleanup: + virDomainObjEndAPI(&vm); + return ret; +} + static char *testDomainGetSchedulerType(virDomainPtr domain ATTRIBUTE_UNUS= ED, int *nparams) { @@ -6833,6 +6859,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainUndefineFlags =3D testDomainUndefineFlags, /* 0.9.4 */ .domainGetAutostart =3D testDomainGetAutostart, /* 0.3.2 */ .domainSetAutostart =3D testDomainSetAutostart, /* 0.3.2 */ + .domainGetDiskErrors =3D testDomainGetDiskErrors, /* 5.4.0 */ .domainGetSchedulerType =3D testDomainGetSchedulerType, /* 0.3.2 */ .domainGetSchedulerParameters =3D testDomainGetSchedulerParameters, /*= 0.3.2 */ .domainGetSchedulerParametersFlags =3D testDomainGetSchedulerParameter= sFlags, /* 0.9.2 */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list