From nobody Sun Feb 8 22:06:12 2026 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=1565622910; cv=none; d=zoho.com; s=zohoarc; b=XYFkJpgnsbIcZkbwMA33MI7ZdVz4M8Mob5nxyCYK2w6dQJbPGgQfSe0CMyepw9ceuuLzwnnYX/wpPX2ULeySllCt7SP9fE245plg7Axvs7DjtWz1S2WfXjvHiRW5TWD5+Gwsxsy3S/+kjC3QE8Bx959PVAYJUSnJhGdqAs9U+fA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565622910; 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=Vncz/tsjpxgsP6xwWzLpHTTYwJIrGQZi3QieDMnKC2A=; b=PUPtfHHWIgS0jMHdIIP44ehHAtjnNVgJodrYNAMzYZszHFra0IN0Zep3UBGcaMgYhkigya+iM5NrNDLQ6gVhR6EO7kgRsCWxJ1KS21W3ysYz3ZufYXx1RvUyEBLy0aYSH+EyjCTag5btIXX4RPlA3wIrKWNTjdJ7xAYpLr+WVYg= 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 1565622910976692.0895968004493; Mon, 12 Aug 2019 08:15:10 -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 8886630EA19F; Mon, 12 Aug 2019 15:15:09 +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 59FD32A16F; Mon, 12 Aug 2019 15:15: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 E9FEB24F30; Mon, 12 Aug 2019 15:15:08 +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 x7CFF72k026079 for ; Mon, 12 Aug 2019 11:15:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4252E1009976; Mon, 12 Aug 2019 15:15:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B580100EBD4 for ; Mon, 12 Aug 2019 15:15:02 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.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 DA79FC075BD2 for ; Mon, 12 Aug 2019 15:15:00 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id v15so12529099wml.0 for ; Mon, 12 Aug 2019 08:15:00 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id 24sm10369223wmf.10.2019.08.12.08.14.58 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 12 Aug 2019 08:14:58 -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=uI2dq/XuxfikOKNb+XED3AwTVuv9FcD1vFzGqdJvLHU=; b=WiyXpS1sW8UNOGKV89U8cOuEl0lqiApkQgofOmWHlQkK4ySFikG0fPt9pBySORyvks DQxGDl3ClZ07T4/+TBUB9XMuTUJ/ntuCl1Hn6IXelVbr0JQt0GWNZ7kiu7uX2QueZrRc n/PNo8X0J8J9vHC17TVf7Hck/It07XF5fJrkTffB6ypNnoLCiaOrYScMl31CAKiB9e+8 1uyuyxWb4zTIebpXJOL8DCon8dHyRUSjfcHdoIlgYHsLQzIBGf+GWNYt0M+2gu8Hmh9H HdHFHVvSh8BMQFjUUp56DIW1gdqkWl0DVeYjySR8OzNPqQmkctSjdI3qDhiKj021H04U bEDw== 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=uI2dq/XuxfikOKNb+XED3AwTVuv9FcD1vFzGqdJvLHU=; b=cSJgvR7P9MN0aE4RrHrqtxJBHiv4Tvh22OZfKCqjcPfYGdZUff8yKkzXlyXaSvhafl 8t+amJyJK4zpI4Dfrbuniayd8T9/1g+V9hjyu7nTIdhhWIDvOCJtpXngJRvAmn8nX40C I9a+qYfc28TWcWzaRk7x5bFJkT9R4285UadByoJNP1fCKueki21f+aCn2aBr7092XtWM XEnWWiEj4KDW2zlZPIEfihB5MHQR5i6JLUOAYop0lCSkTQE87Bv7N+FH1E//iZw/xNoO 8JOp9dgqYAOh/Gs1P8VmnhYaIx0kmtd8rKXyv4PwXGiud4hvR4uLj8u3Q93YoHYLcrBp lh7A== X-Gm-Message-State: APjAAAUcjKOc5bBCMmcC7kY9E+C6tFqf/Mwhd8MHqiPjIwIrXZ/erCl1 7Q3a4T/0Cgdik7Eo0ZsFIIh3DpQXkAw= X-Google-Smtp-Source: APXvYqxeZ4uJdQMvnrVdlLHLjB9wUbHS88MJpDZOCXXPYbDN+WHCUFPUtl8eM5nIcbMpmTmbkgpNEw== X-Received: by 2002:a7b:c310:: with SMTP id k16mr27096433wmj.133.1565622899240; Mon, 12 Aug 2019 08:14:59 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Mon, 12 Aug 2019 18:13:13 +0300 Message-Id: <20190812151313.24329-5-stamatis.iliass@gmail.com> In-Reply-To: <20190812151313.24329-1-stamatis.iliass@gmail.com> References: <20190812151313.24329-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.31]); Mon, 12 Aug 2019 15:15:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 12 Aug 2019 15:15:01 +0000 (UTC) for IP:'209.85.128.65' DOMAIN:'mail-wm1-f65.google.com' HELO:'mail-wm1-f65.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.099 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.128.65 mail-wm1-f65.google.com 209.85.128.65 mail-wm1-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 4/5] test_driver: implement virDomainGetIOThreadInfo 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.40]); Mon, 12 Aug 2019 15:15:10 +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 | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 60d611245d..7eef54bb05 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3097,6 +3097,79 @@ testDomainPinIOThread(virDomainPtr dom, } +static int +testDomainGetIOThreadInfo(virDomainPtr dom, + virDomainIOThreadInfoPtr **info, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virBitmapPtr cpumask =3D NULL; + virBitmapPtr bitmap =3D NULL; + virDomainIOThreadInfoPtr *info_ret =3D NULL; + size_t i; + int hostcpus; + 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 (def->niothreadids =3D=3D 0) + goto cleanup; + + if ((hostcpus =3D virHostCPUGetCount()) < 0) + goto cleanup; + + if (VIR_ALLOC_N(info_ret, def->niothreadids) < 0) + goto cleanup; + + for (i =3D 0; i < def->niothreadids; i++) { + if (VIR_ALLOC(info_ret[i]) < 0) + goto cleanup; + + info_ret[i]->iothread_id =3D def->iothreadids[i]->iothread_id; + + cpumask =3D def->iothreadids[i]->cpumask; + if (!cpumask) { + if (def->cpumask) { + cpumask =3D def->cpumask; + } else { + if (!(bitmap =3D virBitmapNew(hostcpus))) + goto cleanup; + virBitmapSetAll(bitmap); + cpumask =3D bitmap; + } + } + + if (virBitmapToData(cpumask, &info_ret[i]->cpumap, + &info_ret[i]->cpumaplen) < 0) + goto cleanup; + + virBitmapFree(bitmap); + bitmap =3D NULL; + } + + VIR_STEAL_PTR(*info, info_ret); + ret =3D def->niothreadids; + + cleanup: + if (info_ret) { + for (i =3D 0; i < def->niothreadids; i++) + virDomainIOThreadInfoFree(info_ret[i]); + VIR_FREE(info_ret); + } + virBitmapFree(bitmap); + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainSetUserPassword(virDomainPtr dom, const char *user ATTRIBUTE_UNUSED, @@ -9554,6 +9627,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainAddIOThread =3D testDomainAddIOThread, /* 5.7.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 5.7.0 */ .domainPinIOThread =3D testDomainPinIOThread, /* 5.7.0 */ + .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 5.7.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainPinEmulator =3D testDomainPinEmulator, /* 5.6.0 */ .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list