From nobody Sun Feb 8 19:39:52 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=1563877149; cv=none; d=zoho.com; s=zohoarc; b=eZoUPLjqf/oRtXoTmCmoMcXouw3Y8q9vsrT35jBIyhg0LarOYNRpAV9HTbrxyUiMxgNoqwCatC2wen8OlEnFA3PrHMFWj4ZoiPKWkw83mJOMS7XOTnl1mGTHlqWVkQp8hMUeKN4HMB/C1dF4t967JrG2Z+WVwpHNkDR83yqj0OI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563877149; 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=iN/6bY59IwotZt1qVfDqxDBvpbtbVt4ibX8U6FVeYd0=; b=VR5iXCtD29AG+fUp3wgmzKtTRxuAOALMrgOGRlEk1Ak9zMnuOZNuw2pJwCE10sJMZs+bSyPQDhpZAtuocVY8nMnESb7yxQFzQEPzDNZaZos7cwGaYnFH3AAm2qfb6TDjHNTMsAf2o28/bEBpqYlpoC3+qpenuIzBFO7/YoQkihM= 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 15638771490839.626132387546477; Tue, 23 Jul 2019 03:19:09 -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 AB1408E22B; Tue, 23 Jul 2019 10:19:07 +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 82EA01018A31; Tue, 23 Jul 2019 10:19:07 +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 487011800206; Tue, 23 Jul 2019 10:19:07 +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 x6NAJ6cY018437 for ; Tue, 23 Jul 2019 06:19:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 80AAA6061E; Tue, 23 Jul 2019 10:19:06 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 786D460606 for ; Tue, 23 Jul 2019 10:19:01 +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 91D8A3C92D for ; Tue, 23 Jul 2019 10:19:00 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id f9so42507504wre.12 for ; Tue, 23 Jul 2019 03:19:00 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id y6sm36270081wrp.12.2019.07.23.03.18.58 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 03:18: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=f+PTmA1nRkP5Qy4V+IkbU1uwG6IILw40oVQhVpkz78A=; b=XMsuheQYe/gwCggK24sVebgUL2DuTSBljeDqaD8CeUqVp2tOnIzjJ8C4+1xS9Eewzd L1PHPjWyrNLy6hGNny0ATdYoAxakKbA+Nvk/LVoYvISqPbsmbMwXpjVrO/ktfeNcR+e2 6rgD8nhds2gXnoBnlyErklOCogWhcWBnCj3+RkAEjkf1Ezpre0SuedcGY3tvYwKcqTTa TuWouAAgzrkwXcefZHBHEqFLWJZf3GWKTkcecLflK4zL+1HL8KAPTBdUdl/jy/5Kkwqu rpfgLQv3Uh1ZjRwaTcImeesK9YIiL/Ttn6lWEZMtk0xV86JQWHAebTbmaq1dlQ2sOATG E9jQ== 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=f+PTmA1nRkP5Qy4V+IkbU1uwG6IILw40oVQhVpkz78A=; b=lpwNDt4VZbBWjVyYxzUbL7GuG+LSPtVTMZUbxI/alYCDCMsFre6rt2/9oonuh3oyWJ kNXuWJRAgoRpAHUvTVXoWGSC4CTRQacUkq+bweFTUF3wU3C+aBdzHQDdHBORSenwklo+ 9essK3RP8FE76EaroMilZg+4F36AwU/82eY024hL0QtRGD9+pEYqSuv+oUC48I3m310n JtOg6XjCXHKJ2VFpqei9e6r4lE2ANOZq5EOaE8W59OLmXq6zztPykmkwPgkXnhN0u3O4 NE9uz7VEEvVYRW739hJgV8d9ocibb8g6L/srIluPAmWZ7zqrI6acxidlvfjgrtp3Q+3C sLmA== X-Gm-Message-State: APjAAAXBSEidWZKltz53UltU15a16jvUwSfkRUMFJLqAuCjDBcO/jlPc g877C2l+Kx7JkXc48t09hs4Hj96IBz+sZg== X-Google-Smtp-Source: APXvYqxBWKNjiHCPaJ/PZYWSbuuBMgK0m7DxCWG9CCEp0xS3koYnFFE+N8DUzl9PYQ39fcCjE4sn9g== X-Received: by 2002:adf:e602:: with SMTP id p2mr43462148wrm.306.1563877138982; Tue, 23 Jul 2019 03:18:58 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Tue, 23 Jul 2019 12:17:57 +0200 Message-Id: <20190723101757.1927-5-stamatis.iliass@gmail.com> In-Reply-To: <20190723101757.1927-1-stamatis.iliass@gmail.com> References: <20190723101757.1927-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.39]); Tue, 23 Jul 2019 10:19:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 23 Jul 2019 10:19:00 +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: -0.1 (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.66 mail-wr1-f66.google.com 209.85.221.66 mail-wr1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 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 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 23 Jul 2019 10:19:08 +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 47e28a01ec..4c6f3db8de 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2774,6 +2774,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) + return 0; + + 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, @@ -7916,6 +7989,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainAddIOThread =3D testDomainAddIOThread, /* 5.6.0 */ .domainDelIOThread =3D testDomainDelIOThread, /* 5.6.0 */ .domainPinIOThread =3D testDomainPinIOThread, /* 5.6.0 */ + .domainGetIOThreadInfo =3D testDomainGetIOThreadInfo, /* 5.6.0 */ .domainSetUserPassword =3D testDomainSetUserPassword, /* 5.6.0 */ .domainSetVcpus =3D testDomainSetVcpus, /* 0.1.4 */ .domainSetVcpusFlags =3D testDomainSetVcpusFlags, /* 0.8.5 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list