From nobody Mon Apr 29 13:11:28 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=1562276026; cv=none; d=zoho.com; s=zohoarc; b=gtb4TH1Aq+x1n0rXSjDSXR82tEPM7twh1J2ed3MvUm+jX3GMjG+QDxCRPydgof9v0EMAHbvfxxeV+8CsAXkQU+4YixjIVqXuBJAlgNMcQ13S2TIJU3ITNxAwbxClrghvsyk1DPEaD3HZin+i9yOi+1anGE9tWXwBEfuWFWI+X54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562276026; 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=q8HABew9aPEYL0NiUdcoIV9BZziehKaAg10VxI24xMU=; b=QDAEpBZeEJ/S5AY2j1f2KUFzoDQNdo1JUe4VIeIqmxPm7Ge3fQIc1CAufRmkY0QvF8UJpJykdvKVXJXavc35yFmnHgoMfQsv25bZB2v38xp7/7bi+r5Hi5oFVtuRjHN/pPtz7M0WuW9e5+qK/y2uwFajwM0on7oQ4sGnSqc0q+Q= 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 1562276026894763.5383250766093; Thu, 4 Jul 2019 14:33:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 425C530821FA; Thu, 4 Jul 2019 21:33:44 +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 2319A17C5D; Thu, 4 Jul 2019 21:33:44 +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 CC63218184B6; Thu, 4 Jul 2019 21:33:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x64LWsXs008112 for ; Thu, 4 Jul 2019 17:32:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3D8DE989D8; Thu, 4 Jul 2019 21:32:54 +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 38D57989D7 for ; Thu, 4 Jul 2019 21:32:52 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.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 D5A9981F12 for ; Thu, 4 Jul 2019 21:32:42 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id c2so7847957wrm.8 for ; Thu, 04 Jul 2019 14:32:42 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id o12sm6760972wrx.63.2019.07.04.14.32.40 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 04 Jul 2019 14:32:40 -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=uy4AvdGFjQersDguJMUOFN5Y7+W2HkuFJ9Oz3dlWlVE=; b=tuwb16UydX+rTI0vJWrEi/mglTF01aXV4+p1Nult8RMtRlEaqnK4TJPd0UsTTadiNR U7l/NaqYYh+/jcorQjnQYY+98Pf7T1jbDwUvOzvApUiH7Xy9z/dWiz8vmbrwJtt+WljT oiuT7D+ZlUPgZc9W20ftXXCfkx13Lv4/fxjcZG32vtrRQFTUkXoA1ii8VyY0HHY2OW7a 05U2Ar7JjVYhbOeJBtj7AdQyhskKMsZ1VIjtC9Yrk3ioHA8El3Py5GZv9fSIvWMQ3+R1 8TRkL9ipPPy/ujy/jc7i1eY/DYvu57wky5wfBkRzrdlzKw+FkfFBsK72+MR/TS1EEM2P idzA== 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=uy4AvdGFjQersDguJMUOFN5Y7+W2HkuFJ9Oz3dlWlVE=; b=eEbNsYgU8Qy+8+pbIXB9JFr8/JYF9BHAOadwIIEoJ1CqdxRYznIHZlEvIQUz1eWXwU d8whoHxaZMWH74JsyjFZ+LJ2rYD07NFr8RLD86s1JeR7sS/HJFQGl7Kupl7H3zvxabN5 zjog4eJi0eGH70fa7PgoVqcxJtFAQZH+pqcVEpyaN5OvcaKfZh6o/ozjpYjWnQy5kEjd Gstlev/uTLL5X16jqzBSmSG6Ohc3mDnIfwNXpbRe0r6sbypLFyfTiWfBWvDheP/GiYKX 3XKu8YFYgcWn8Wc3qll+2mLFBvW00vbXiPNs+z7ShdXyJ9y0jQtLKJ1DKCOmrtvZeeoG 11hg== X-Gm-Message-State: APjAAAXqL3uUUGsRbxscHbTbkwLFIDWXhqpYTrsknINhcXfCPFyPxGeZ RXCb+KWafmDnlLu5AwoozQ20Q8knew4= X-Google-Smtp-Source: APXvYqxSvlDGHIQol80/xdfc/4hZZd+Lk6ajaLgMByBS+5miqf/7S6PRp/Mo+ucYLi+YgyhHtRA9Sg== X-Received: by 2002:adf:e4cc:: with SMTP id v12mr380689wrm.22.1562275961289; Thu, 04 Jul 2019 14:32:41 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 4 Jul 2019 23:32:06 +0200 Message-Id: <20190704213207.7612-2-stamatis.iliass@gmail.com> In-Reply-To: <20190704213207.7612-1-stamatis.iliass@gmail.com> References: <20190704213207.7612-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, 04 Jul 2019 21:32:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 04 Jul 2019 21:32:43 +0000 (UTC) for IP:'209.85.221.67' DOMAIN:'mail-wr1-f67.google.com' HELO:'mail-wr1-f67.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.212 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, T_PDS_NO_HELO_DNS) 209.85.221.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.google.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] test_driver: implement virConnectSupportsFeature 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 04 Jul 2019 21:33:44 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Make the test driver only support the VIR_TYPED_PARAM_STRING flag for now. Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) mode change 100644 =3D> 100755 src/test/test_driver.c diff --git a/src/test/test_driver.c b/src/test/test_driver.c old mode 100644 new mode 100755 index c14603e3af..74de8f13ad --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1557,6 +1557,34 @@ testConnectGetType(virConnectPtr conn ATTRIBUTE_UNUS= ED) return "TEST"; } + +static int +testConnectSupportsFeature(virConnectPtr conn ATTRIBUTE_UNUSED, + int feature) +{ + switch ((virDrvFeature) feature) { + case VIR_DRV_FEATURE_TYPED_PARAM_STRING: + return 1; + case VIR_DRV_FEATURE_MIGRATION_V2: + case VIR_DRV_FEATURE_MIGRATION_V3: + case VIR_DRV_FEATURE_MIGRATION_P2P: + case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION: + case VIR_DRV_FEATURE_FD_PASSING: + case VIR_DRV_FEATURE_XML_MIGRATABLE: + case VIR_DRV_FEATURE_MIGRATION_OFFLINE: + case VIR_DRV_FEATURE_MIGRATION_PARAMS: + case VIR_DRV_FEATURE_MIGRATION_DIRECT: + case VIR_DRV_FEATURE_MIGRATION_V1: + case VIR_DRV_FEATURE_PROGRAM_KEEPALIVE: + case VIR_DRV_FEATURE_REMOTE: + case VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK: + case VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK: + default: + return 0; + } +} + + static int testConnectNumOfDomains(virConnectPtr conn) { testDriverPtr privconn =3D conn->privateData; @@ -7576,6 +7604,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .connectGetCapabilities =3D testConnectGetCapabilities, /* 0.2.1 */ .connectGetSysinfo =3D testConnectGetSysinfo, /* 2.3.0 */ .connectGetType =3D testConnectGetType, /* 2.3.0 */ + .connectSupportsFeature =3D testConnectSupportsFeature, /* 5.6.0 */ .connectListDomains =3D testConnectListDomains, /* 0.1.1 */ .connectNumOfDomains =3D testConnectNumOfDomains, /* 0.1.1 */ .connectListAllDomains =3D testConnectListAllDomains, /* 0.9.13 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 13:11:28 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=1562276055; cv=none; d=zoho.com; s=zohoarc; b=QxL0YVWjAp92OrqZwN+w8wNwSpnolAymwlYM3kmZBZKitgt/R3XS9RUcB3giTDrYBEHtcn1V+XnuRWqAClrKGgItHMcZh1PKmfq5jB3SrJZcjyuh/u/fzX+X9VIYh8pI5CgEnDkUfLfB9dAQ3sTxYZ4omEouUlMdJZMlPWPsQyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562276055; 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=iblPq1bjYWkI5jlRMPJMOhgjFzficRFNSni86p6cPhg=; b=JPxTT7LGRCeKFV8QYmkzJ1ed7qiqGQb4ygQsciDgHcsc4/hHardWozKnOG2TbK28ZL0Zrp4NEZU0BDM3ysy4hzoOgqkj+6rvett5hww5IeGBxT+56+sZD6e36Vj6ZD/HqedT4K+PcBtED3cDCfrdjhGHj3igRbSuVUk10gC7lBE= 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 1562276055324112.54343022821013; Thu, 4 Jul 2019 14:34:15 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A63386676; Thu, 4 Jul 2019 21:34:08 +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 508D584326; Thu, 4 Jul 2019 21:34: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 DFC6141F53; Thu, 4 Jul 2019 21:34:04 +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 x64LXPYX008130 for ; Thu, 4 Jul 2019 17:33:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB84552C7; Thu, 4 Jul 2019 21:33:25 +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 A507119C79 for ; Thu, 4 Jul 2019 21:33:23 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.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 B2C9EC049589 for ; Thu, 4 Jul 2019 21:33:08 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id w9so6101850wmd.1 for ; Thu, 04 Jul 2019 14:33:08 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id o12sm6760972wrx.63.2019.07.04.14.33.06 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 04 Jul 2019 14:33:06 -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=7ak09fp+8EJuospo+lHuuPK+YcIpVksM8HFmSjeDW3o=; b=Urq/PNggQ07O+t5bHxs96mlSdh0joU6K3Gx7sZkkueBkRDuByP6Bwxb2pWXT2y8w0k 5pJ9l+ExZ81924mYAVNCrKNbocVZWIzoy8yhrcn9NBbkpTwI5vFPnacpXiZlOrwlSM82 XOwiPmee9+2Y+i0EwkWt1ctfZik1woyHJdy+EERs9wpTWE7wyH/AzXYq6YhmnELdHC3A 0asuXc/sRyUGL3kNHlG4HcUw70dCgk315JMosAZE6YS5obVd2Z/bSRJ4VipLKXr086VD /BDUfdBbvSxXBCKUheXtH0LWrfHLQ1GJOn5irA9HVFqFx6bnODOveU7rWleKRTu6xxPx gbHg== 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=7ak09fp+8EJuospo+lHuuPK+YcIpVksM8HFmSjeDW3o=; b=cyRacBbhML22oSH8XLQ9o2iaBPDzxJzmXSACjZ8h0TYBsz946HyOLd32HvHJdKf68g 2M4obhLQCNE+v1ied5vTr791vfZSooPm1F6NV0p+dz3t42AJtFpvRlzx5mL/LgeUisdE VZJ65HI+0EBAJ+5RvK5vnMPklcg3vlJRk0nqHU6jXc4y24tkYJRgp/xgf5IPyGtP0I1A N4LHpPcpt80RKmCoi1yw1B+JsEt2ZzsvEsmFB4IDGXeIqDcscX0sjOoE0NTgp79ntTiU pFeWVUl3qtrfHxYCzlLcMBjOskVTSNIs5AOkqZt2GAnujGrxAXgvuICtkuT+WDyHAbRf zGJQ== X-Gm-Message-State: APjAAAXAPuUV6z2NV/+y663pPK/8CziPrr/wkpzJdoHH6xD9ulOHmXGO WN/uG3TIInAUHhV7BWEfRNd7PFNI8Uk= X-Google-Smtp-Source: APXvYqwuFgiyis4fwGKfmx4po0aY5dF0gg4xAOJCkjJoIasFIaA/xnSHr8pX4DwvQDwDCC8EDu6u9Q== X-Received: by 2002:a1c:6a11:: with SMTP id f17mr87619wmc.110.1562275987098; Thu, 04 Jul 2019 14:33:07 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 4 Jul 2019 23:32:07 +0200 Message-Id: <20190704213207.7612-3-stamatis.iliass@gmail.com> In-Reply-To: <20190704213207.7612-1-stamatis.iliass@gmail.com> References: <20190704213207.7612-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]); Thu, 04 Jul 2019 21:33:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 04 Jul 2019 21:33:09 +0000 (UTC) for IP:'209.85.128.67' DOMAIN:'mail-wm1-f67.google.com' HELO:'mail-wm1-f67.google.com' FROM:'stamatis.iliass@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.287 * (DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, T_PDS_NO_HELO_DNS) 209.85.128.67 mail-wm1-f67.google.com 209.85.128.67 mail-wm1-f67.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] test_driver: implement virDomainSetNumaParameters 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 04 Jul 2019 21:34:14 +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 | 82 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 74de8f13ad..fa690e2bd6 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2928,6 +2928,87 @@ testDomainGetMemoryParameters(virDomainPtr dom, } +static int +testDomainSetNumaParameters(virDomainPtr dom, + virTypedParameterPtr params, + int nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virBitmapPtr nodeset =3D NULL; + size_t i; + virDomainNumatuneMemMode config_mode; + int mode =3D -1; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (virTypedParamsValidate(params, nparams, + VIR_DOMAIN_NUMA_MODE, + VIR_TYPED_PARAM_INT, + VIR_DOMAIN_NUMA_NODESET, + VIR_TYPED_PARAM_STRING, + NULL) < 0) + return -1; + + if (!(vm =3D testDomObjFromDomain(dom))) + return -1; + + if (!(def =3D virDomainObjGetOneDef(vm, flags))) + goto cleanup; + + for (i =3D 0; i < nparams; i++) { + virTypedParameterPtr param =3D ¶ms[i]; + + if (STREQ(param->field, VIR_DOMAIN_NUMA_MODE)) { + mode =3D param->value.i; + + if (mode < 0 || mode >=3D VIR_DOMAIN_NUMATUNE_MEM_LAST) { + virReportError(VIR_ERR_INVALID_ARG, + _("unsupported numatune mode: '%d'"), mode); + goto cleanup; + } + + } else if (STREQ(param->field, VIR_DOMAIN_NUMA_NODESET)) { + if (virBitmapParse(param->value.s, &nodeset, + VIR_DOMAIN_CPUMASK_LEN) < 0) + goto cleanup; + + if (virBitmapIsAllClear(nodeset)) { + virReportError(VIR_ERR_OPERATION_INVALID, + _("Invalid nodeset of 'numatune': %s"), + param->value.s); + goto cleanup; + } + } + } + + if (virDomainObjIsActive(vm) && + (flags & VIR_DOMAIN_AFFECT_LIVE) && + mode !=3D -1 && + virDomainNumatuneGetMode(def->numa, -1, &config_mode) =3D=3D 0 && + config_mode !=3D mode) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("can't change numatune mode for running domain")); + goto cleanup; + } + + if (virDomainNumatuneSet(def->numa, + def->placement_mode =3D=3D + VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC, + -1, mode, nodeset) < 0) + goto cleanup; + + ret =3D 0; + cleanup: + virBitmapFree(nodeset); + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetNumaParameters(virDomainPtr dom, virTypedParameterPtr params, @@ -7645,6 +7726,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetMaxVcpus =3D testDomainGetMaxVcpus, /* 0.7.3 */ .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .domainGetMemoryParameters =3D testDomainGetMemoryParameters, /* 5.6.0= */ + .domainSetNumaParameters =3D testDomainSetNumaParameters, /* 5.6.0 */ .domainGetNumaParameters =3D testDomainGetNumaParameters, /* 5.6.0 */ .domainGetInterfaceParameters =3D testDomainGetInterfaceParameters, /*= 5.6.0 */ .connectListDefinedDomains =3D testConnectListDefinedDomains, /* 0.1.1= 1 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list