From nobody Fri May 3 01:57:36 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=1563978726; cv=none; d=zoho.com; s=zohoarc; b=GpQNr/0X6RIZLpvPf+Lusb/Hju0oBQ/uKbbIQMBHEWehegf6zVbU5tgzD02X3ki7pSN3blr1EQWqmMk0fvxuUpOaSxDm5ny9e0H8V5QhTX+a+ksm4bctR8gaA/lPRvbzVIeCozCgmYYj/JcUJ7TT3HA9z/g6Beyvg5+T+CjqrT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563978726; 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=SesqG7yuJj3+ceWV6/FJCCobP84aJAUDlc91F/MQueg=; b=NKGCGtJrWNKalMGmeXB7fGNWaf8mpclIjykrJnR5HGLih9vqNbKrXp9HhT+dFQ/WZUxZJS5lDT1Ufs2Xet0hexHlLWvmxK7eUWcej49mpHEdipSZSj75b1sTtDGnfcPYLwWqV6mCF9EpAwgBL5YZ5sKM8bVvoMbMT4rhKw/prqo= 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 1563978726196728.7518945694102; Wed, 24 Jul 2019 07:32:06 -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 BD094859FF; Wed, 24 Jul 2019 14:32:04 +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 8B9C65D71C; Wed, 24 Jul 2019 14:32:04 +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 209A71972F; Wed, 24 Jul 2019 14:32:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x6OEW3US003107 for ; Wed, 24 Jul 2019 10:32:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A3655C231; Wed, 24 Jul 2019 14:32:03 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 345095C22D for ; Wed, 24 Jul 2019 14:32:00 +0000 (UTC) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.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 1FCF13082E61 for ; Wed, 24 Jul 2019 14:31:59 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id p17so47220806wrf.11 for ; Wed, 24 Jul 2019 07:31:59 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g12sm65051445wrv.9.2019.07.24.07.31.56 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 07:31:56 -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=cAQaXeOayYaWwzQe5orzcG+/PpcZGHkRhWfGLwsall8=; b=nDImSHRD4OgMLfo5n2GJC++jHuIo3XqjIr9s4VPg0OcSCCDuD9MnakJrgHVIoEHtU7 KIUq9PXVS0JoLelipctFUpNRDJMGeaL2xFHOp0sNaHc1lgBxaMdCYGwFqj6cA0nQJMC9 9Qaopacmj0Qr3zzZQa3pTnPeOWBHdcr4D3WQ4yhiGYRfBMoJq/ucxdp7/gP6EgiGqA91 ohhUOAdZbOpMj1Z3MRgGU2d+cKvtx4BvteX3oAYoOWoGVRT7RsUcuaNj4KgT044bIJt+ 9I5YmYj2s0TSS4VIMEZyPD+yoM32aIiwv5TmmAuVoX2xwxI4UEgScu7SOI/+Y0cT2B0R O3vg== 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=cAQaXeOayYaWwzQe5orzcG+/PpcZGHkRhWfGLwsall8=; b=FpSGvv+xM64gklQ4bLQlV7q3xwifOMsR7p4e1v7vrBKT/CRSs+hyGMEdTVGa4aZVjC XBU4Xl0OpH2EBLmWPE5yjOL7m5FI6qh40rvexKW0NvnhBHJVMijcTlTzPJodwpV+dJ/F tTBoqTuBbclaUhresVjNiwdng+UnLNHaGPfOSA3zUuFq65o7h/8tv7zgW69ZnN+x2fBG nghfyusXYTH9vBpN/ht7yv04mBeg9CPflh7lEWSL9GrWPn+hnAzRk61e1Ju9WrU3vRF0 nZjaM6DnshEDfAA12ESW5o3jqT8212fBLD2Fe9R8tWSkp2jemZSiaP1Q2HNAoPqNiqAZ jIxQ== X-Gm-Message-State: APjAAAXnwwG4CnX4LclRe9wLl1utxiYY5NsL8TBGOHJeNjp4r63lriTC mV66oW7FhOSE+iEBX1dxksTFj02WZO3WGg== X-Google-Smtp-Source: APXvYqwlNJ2YaTIzkm5uJ5DBMH4f6j8I+OczeS1YQgjiIMqnZSmOi5+bhS7MOIaIj9Am/aF0g86neg== X-Received: by 2002:a5d:4642:: with SMTP id j2mr83792284wrs.211.1563978717393; Wed, 24 Jul 2019 07:31:57 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Wed, 24 Jul 2019 16:31:33 +0200 Message-Id: <20190724143134.24798-2-stamatis.iliass@gmail.com> In-Reply-To: <20190724143134.24798-1-stamatis.iliass@gmail.com> References: <20190724143134.24798-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.46]); Wed, 24 Jul 2019 14:31:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 24 Jul 2019 14:31:59 +0000 (UTC) for IP:'209.85.221.65' DOMAIN:'mail-wr1-f65.google.com' HELO:'mail-wr1-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.221.65 mail-wr1-f65.google.com 209.85.221.65 mail-wr1-f65.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 24 Jul 2019 14:32:05 +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 Reviewed-by: Erik Skultety --- 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 7cf92e78a7..6221f5b9ae --- 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; @@ -7767,6 +7795,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 Fri May 3 01:57:36 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=1563978739; cv=none; d=zoho.com; s=zohoarc; b=eUzeTZymxiX1Bno+v1bEldPXXC6VnKCCFjRKz2mZDLGBAlwBCRNF763b8+LlsCECWTKgkO1376cteBTfscx79m6gLBQ19PiUivw9IFZ/6kRb5v6G08a9jae/jTP+CVNtuqwKVfpQ4XW7TdBpRvxityyWewEmRnF9MVB4gyqaUxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563978739; 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=4oFLPBR6U1j+GLTkFmvMmbPpjvLBB+onGb+dQIZFt/U=; b=WjJj6iunXwcr6lJCsg1MUOnN5Ahea7pFSX6GZkVlveESVH81+90mMKUY8cli7YjJHbp1PpwVCY5ymulZigDeqnm9qjnulLfVDkEoabpDDivPSlASe9ujFhHdMHa84SXx6Y+7AL+ohfVE944TNL9gaEcj48NjB7wYmlwAQlXaSIw= 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 1563978739525561.4540421931342; Wed, 24 Jul 2019 07:32:19 -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 0E68FA3B6E; Wed, 24 Jul 2019 14:32:18 +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 D46A560605; Wed, 24 Jul 2019 14:32:17 +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 927351800207; Wed, 24 Jul 2019 14:32:17 +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 x6OEWF61003136 for ; Wed, 24 Jul 2019 10:32:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C6EE5D968; Wed, 24 Jul 2019 14:32:15 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96D525D9DE for ; Wed, 24 Jul 2019 14:32:13 +0000 (UTC) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) (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 4B2AF300B916 for ; Wed, 24 Jul 2019 14:32:12 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id u25so31481040wmc.4 for ; Wed, 24 Jul 2019 07:32:12 -0700 (PDT) Received: from archpc.localdomain (x8d1ee222.agdsn.tu-dresden.de. [141.30.226.34]) by smtp.gmail.com with ESMTPSA id g12sm65051445wrv.9.2019.07.24.07.32.09 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 07:32:09 -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=d9Zl6MZrgE1KuEn3bDNXQ9wR7M0PZg1xd7nsS8Ztsmk=; b=eVtRfJlVN/oe2MStFPLO6hMriViTIFghptoIdwdU3ZkTZMMrwXAlA1e8HAlkDV4Tzf hsO4MmN8DcVXsd2ZTkALDa7nGsg92MoJYTIqgIAND20wpbA2rW9LKPt4JxB5Un+P+dOi tHUXxSO3Cq6bdzWapCGykz7w4kcvrYUbdHroCdhdIgctf5EvNG25Z6ultt7V7swnbzMz dZRrW8aNNDF8C7xh7Ig4dHsDku6NrwONR3A/iSsfPFVkRylsA3ik8IS7SFfuAo1NM1Xb VTmLXsPYgnHqfuShd2+H4EW3wFb7a90fC+PHtgIuS4Y/manD5M/nWhNEA4GzwKzMer4u 8uvA== 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=d9Zl6MZrgE1KuEn3bDNXQ9wR7M0PZg1xd7nsS8Ztsmk=; b=J+NUyyWWfz8CWwhNcOQp7G/SPrLcFvcvT91d2uuQcFAp/Ik3D74voVNWqLijW836iK dKtFmO0O9dd2EDGn+yQWpv0lzQhj3VpDnMCrTou3/xt+MtIjEnh03Q1fs0FnsG3UxlDa /vz6lPOAO1xhKArxkILi8weQrHozD0H8pgbXlTr8s/9Z1Xd3z5IlafEU0EpAspkkFv+3 B8aji/JfTGUbNaRipN89nupSRBnzXoL8xGcjB1iI8H18Uwz/JQ5/pjIMaLWFmMm/SfyZ dv+e6nTnuiG2A06JOYW5kVH0kxPtiqOj0CEwSrOMJCShpEgY8SRLsihU9KutLAesEkio UO4Q== X-Gm-Message-State: APjAAAXDGeq2fQd/bD0/D/OkpSnxlkkG1BgjJSXCWGV3AvROCfGP61ea 3LTAlz1ThyqVbiOtHhSiYv940Y9qe1ABwQ== X-Google-Smtp-Source: APXvYqxuRvtKETs5/IxEb6AA+zhoLX1Luqoh+42GlwU/SAzt3r1Zfk+2mbjjkgTsPkVNayBEOvCAxQ== X-Received: by 2002:a05:600c:34a:: with SMTP id u10mr35601503wmd.43.1563978730490; Wed, 24 Jul 2019 07:32:10 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Wed, 24 Jul 2019 16:31:34 +0200 Message-Id: <20190724143134.24798-3-stamatis.iliass@gmail.com> In-Reply-To: <20190724143134.24798-1-stamatis.iliass@gmail.com> References: <20190724143134.24798-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.49]); Wed, 24 Jul 2019 14:32:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 24 Jul 2019 14:32:12 +0000 (UTC) for IP:'209.85.128.68' DOMAIN:'mail-wm1-f68.google.com' HELO:'mail-wm1-f68.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.128.68 mail-wm1-f68.google.com 209.85.128.68 mail-wm1-f68.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 24 Jul 2019 14:32:18 +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 6221f5b9ae..127403bc0c 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3091,6 +3091,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; + virDomainNumatuneMemMode config_mode; + bool live; + size_t i; + 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 virDomainObjGetOneDefState(vm, flags, &live))) + 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 (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, @@ -7841,6 +7922,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetXMLDesc =3D testDomainGetXMLDesc, /* 0.1.4 */ .domainSetMemoryParameters =3D testDomainSetMemoryParameters, /* 5.6.0= */ .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