From nobody Fri Mar 29 09:12:19 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=1565287591; cv=none; d=zoho.com; s=zohoarc; b=lL6vG7NjFORMLePQk9Ru/O8u6M4NrPjoGWE9ED6uvl52S3gpQ3UYCszbb2d94QGI4j1hzjG/J8tKwpCRY8KInxh1kpI6TD2yXdS1SJDmzKdKbf1SdNwi9gVNwFFFOzhmCOfSrMQlApZX4MtgOdGkozOA62MZqKYuXypbyGp4C8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565287591; 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=JKcFbT0yfI5i+tb/L6b7x6wdkxBRDFC35o5taULp+as=; b=mBUn+hB7rOo16vM/RiUNfT3Vgz4K/zFrwPcg8KWVsqqCxWx7ycLRKuAvd/3KFNAgUFZY1/6tDQ04y6CLm84SlNsthzmnv6ybKiVfnpm8B/ySvUsysg4yElBgCZyDFgU+XzuXgFYMKSn1bH2TnY/Xanwzi9zb5yuPSrFLBodHE4s= 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 1565287591635856.3414809842563; Thu, 8 Aug 2019 11:06:31 -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 22C00308A958; Thu, 8 Aug 2019 18:06:30 +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 9CE0F19C69; Thu, 8 Aug 2019 18:06:29 +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 3509324F30; Thu, 8 Aug 2019 18:06:29 +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 x78I6SFu024939 for ; Thu, 8 Aug 2019 14:06:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1C86F1001284; Thu, 8 Aug 2019 18:06:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 174F21000337 for ; Thu, 8 Aug 2019 18:06:25 +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 09D2B315C00D for ; Thu, 8 Aug 2019 18:06:25 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id k2so9969213wrq.2 for ; Thu, 08 Aug 2019 11:06:24 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id p13sm23308915wrw.90.2019.08.08.11.06.22 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 11:06:22 -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=pa++X7J4P1Sh6DCaOAT/ZpMAn72M5H/gXybG7Cu8BsA=; b=Afxx6Zd3YQyvfpo1Zm2yk5XxKQ7vN9/JnZUhaYLA359/WXSDKXNkTf5xZF+LdRn5zX 3wC+Xk4PoEaWevMsbYZPYhqrdbTouHgkZJwd/AhMr3PnHJQXWt26SRivwbCScCHTReR3 dx1ZBQwTFxxji0C6v9zTUCFvZuOUJ1Zf3ytttEuzCBJZp+NTHLiiWP8LPjmIDfvzw5hE Ee2mczHPAqADgvXPEd7SX2F+L7/2j+HL6e7CK2SpEdvK/4n7zIIlveTEgAr+3Ry1/VcT g3YgUtsM8FrqMXvssajzRyn76dJZKWe2+UoCyULCINkL6UMr+p/2ebfR8zS2HddVTr3/ eBYw== 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=pa++X7J4P1Sh6DCaOAT/ZpMAn72M5H/gXybG7Cu8BsA=; b=gkN6feMUu8ugqpDvKrLhngLB9QsEUVS9lR0vscLm2+69IIWQyA/MHQEFcmMnGQy/wQ A+4eNWdDkLdBrB2cZyOohuodp/a+pmtleP4Xwl/wloTMzPdJsz5zEfc8FJDx82W8vwmV 1B5g4yPPFeotO5WeSQkTqdN7rzE11NHwgNvYnXoU9il8DtqI3flAgkypmSDCwx5cd2QY 5zbLnC2DjyWPZqwfQkkjhohM1T3Cj0lTd72fLNKlfOO9mdU/HJiMeKv3pMakV6y7Gj8T 9/ZmxvuuxbV+9Z1c0nyV94u5FQ1SMxpJQHKB3pOrd8e32Atv0VFx1Bs4EhW8KGwWSC5U PO0Q== X-Gm-Message-State: APjAAAWYXZqVTKNdRkVFS+ncWgG4YfZdhly3KkZQvzN9FBN0bky/qpcp wsb0StdMGOZwAfFVggbNo0YgjJHgsNQ= X-Google-Smtp-Source: APXvYqzq3/6EM55bhoJbiOwgijDbMolATwqDK652NhLMTpQB6N8/lQUFMow3OnemxxIlfViSIUEGZA== X-Received: by 2002:adf:a2cd:: with SMTP id t13mr328909wra.251.1565287583451; Thu, 08 Aug 2019 11:06:23 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 21:05:21 +0300 Message-Id: <20190808180524.17771-2-stamatis.iliass@gmail.com> In-Reply-To: <20190808180524.17771-1-stamatis.iliass@gmail.com> References: <20190808180524.17771-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.41]); Thu, 08 Aug 2019 18:06:25 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 08 Aug 2019 18:06:25 +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.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.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] test_driver: make testDomainGetVcpus report all vcpus 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.41]); Thu, 08 Aug 2019 18:06:30 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The current implementation of testDomainGetVcpus is erroneous. When offline vcpus are encountered in the vm definition, the corresponding fields in the output array are left empty. Additionally some vcpus are not reported at all due to the wrong invariant checking done in the loop. Make testDomainGetVcpus report all vcpus instead of reporting the online ones only. Set the state field in the virVcpuInfo structure appropriately in order to mark offline vcpus. --- src/test/test_driver.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6f18baa265..a6f239b9f1 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2968,8 +2968,8 @@ static int testDomainGetVcpus(virDomainPtr domain, virBitmapSetAll(allcpumap); /* Clamp to actual number of vcpus */ - if (maxinfo > virDomainDefGetVcpus(privdom->def)) - maxinfo =3D virDomainDefGetVcpus(privdom->def); + if (maxinfo > virDomainDefGetVcpusMax(def)) + maxinfo =3D virDomainDefGetVcpusMax(def); memset(info, 0, sizeof(*info) * maxinfo); memset(cpumaps, 0, maxinfo * maplen); @@ -2978,9 +2978,6 @@ static int testDomainGetVcpus(virDomainPtr domain, virDomainVcpuDefPtr vcpu =3D virDomainDefGetVcpu(def, i); virBitmapPtr bitmap =3D NULL; - if (!vcpu->online) - continue; - if (vcpu->cpumask) bitmap =3D vcpu->cpumask; else if (def->cpumask) @@ -2992,7 +2989,7 @@ static int testDomainGetVcpus(virDomainPtr domain, virBitmapToDataBuf(bitmap, VIR_GET_CPUMAP(cpumaps, maplen, i),= maplen); info[i].number =3D i; - info[i].state =3D VIR_VCPU_RUNNING; + info[i].state =3D vcpu->online; info[i].cpu =3D virBitmapLastSetBit(bitmap); /* Fake an increasing cpu time value */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 09:12:19 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=1565287603; cv=none; d=zoho.com; s=zohoarc; b=IQE30Y8oNMRyBDLUpPoudfCmEoQ6MLamHLBRI+4I0Msb9NvVmPnYbVDLn1iqbqyc17lYZU2CBD+kyJD+3t0LqtrnPAPeM4IG3OKCK8DIcxIsP6t7bc1EPqkTHVOhf1Gbqx1VLCzBaYfoHbkAo1UYhbVUwhZHpd/4Zdme/+tFa8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565287603; 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=Nh6Y4+efhf4ID1Z1lKYBIpfzFkzPTV1M7OAF5OcxcVY=; b=oKDWbcwuh5chQGrsCuS8C3SIpOkAt99PXwGhuH0C9SuFQ927yMZtNi3466k0YF++NPw+ZmwqN3kXRYbHKqyFghCVEGOrKzOMCsfpv2BLN1x3dWgy9G0l+k9cOTjjEioQL5mZw/1eheda/HbRcjfKcRjo66BW3/l0RiWZyj7p3w8= 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 1565287603158701.8375836998371; Thu, 8 Aug 2019 11:06:43 -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 6FB613061211; Thu, 8 Aug 2019 18:06:41 +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 411B05D70D; Thu, 8 Aug 2019 18:06:41 +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 F15BC24F33; Thu, 8 Aug 2019 18:06:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x78I6e5P024964 for ; Thu, 8 Aug 2019 14:06:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E40760C47; Thu, 8 Aug 2019 18:06:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx18.extmail.prod.ext.phx2.redhat.com [10.5.110.47]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13BF860BF4 for ; Thu, 8 Aug 2019 18:06:36 +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 D8CC030A76BE for ; Thu, 8 Aug 2019 18:06:35 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id t16so5696683wra.6 for ; Thu, 08 Aug 2019 11:06:35 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id p13sm23308915wrw.90.2019.08.08.11.06.33 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 11:06:33 -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=YcTDLTTiKs/RWEhEbli3xeD1NvPttDeJn+2CCCIybzk=; b=azCiaKgbgYTfWjHon6mvN4efWD5EYUejxrZ1EvTlk8XdYBN3MtSKU1xjGUpOSD55XA Qw3Y4XgP06NnJsOdFB2ctFJpd43mgHYET60U45I20OEc9fZFUFAaPTOIbHuUjtRz0Br8 KY5AyubvH8KYtWmt7eWqW4W+mKsOvh3HbpOVsroWS4jGLIA+uc2M11OGtSRoQrJQ07SC fVdG9BFOw6rt8thPT8b6sbtGacw+eYfhXf17N0lXUlDaeQMEZflb9Qy34OETjhW5ATLz toi4wc5sVYuvPK8MzmloKE9XfQ4zCLJrb5Fbq/zIxguHFZ326g1v9BDo9XhpaCC3GEZ9 zcow== 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=YcTDLTTiKs/RWEhEbli3xeD1NvPttDeJn+2CCCIybzk=; b=ekZkRCI+LR8dCr1SVlznekNOEWmnSXFMxfRTQH0PFBTzd+o4MGDyKlJprB0O5l2qCS ee1cxNdoUlMPvHy5Z3LgjJCaMRcZFGcy61Lgc326awLFmDG4Q8AIv7PrK/eJAGg4zjSw igoSUpxTEv/LVJNFh59wZbA3a8+aUtmoBS/2VzLBFGYVhbKw0FQd4Zl1ozJAB4gMs1+C QGZ2ZFopqSfLvnCDnz1pMlzJ8GDA/dR1gAHdBEiknQr1kRjKl1epFQHn4Avh/Wob8s+R tjgO1K3rkJdYOB+y9IOTTx+/4DfN5joGWacRP3gAhkRLt4L2gt165v9golG4ohNOWS2O C8TQ== X-Gm-Message-State: APjAAAVFfRhBeW2x1y+e1AslJ/I5e2i+KMLSzQmdlQUUFKQRsQwWiffg pKi6O5gbaM4HrjFa+8DyMzRKi6VxtfU= X-Google-Smtp-Source: APXvYqxt8sK+Srt3Y3l7tP23cniNF1BJj4VyIb+IoI6FnF1GvXBbL1+x0zkIOdX+PHH+/qW+PjpgaQ== X-Received: by 2002:a5d:4a42:: with SMTP id v2mr9082001wrs.186.1565287594195; Thu, 08 Aug 2019 11:06:34 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 21:05:22 +0300 Message-Id: <20190808180524.17771-3-stamatis.iliass@gmail.com> In-Reply-To: <20190808180524.17771-1-stamatis.iliass@gmail.com> References: <20190808180524.17771-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.47]); Thu, 08 Aug 2019 18:06:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 08 Aug 2019 18:06:36 +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.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.67 mail-wr1-f67.google.com 209.85.221.67 mail-wr1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.47 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] test_driver: implement virDomainGetGuestVcpus 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.48]); Thu, 08 Aug 2019 18:06:42 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a6f239b9f1..99cba7db42 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2820,6 +2820,75 @@ testDomainGetVcpusFlags(virDomainPtr domain, unsigne= d int flags) return ret; } + +static int +testDomainGetGuestVcpus(virDomainPtr dom, + virTypedParameterPtr *params, + unsigned int *nparams, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virBitmapPtr vcpus =3D NULL; + virBitmapPtr online =3D NULL; + virTypedParameterPtr par =3D NULL; + char *tmp =3D NULL; + size_t i; + int npar =3D 0; + int maxpar =3D 0; + int ret =3D -1; + + virCheckFlags(0, ret); + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjCheckActive(vm) < 0) + goto cleanup; + + if (!(vcpus =3D virBitmapNew(vm->def->maxvcpus))) + goto cleanup; + + if (!(online =3D virBitmapNew(vm->def->maxvcpus))) + goto cleanup; + + for (i =3D 0; i < vm->def->maxvcpus; i++) { + if (virBitmapSetBit(vcpus, i) < 0) + goto cleanup; + + if (vm->def->vcpus[i]->online && virBitmapSetBit(online, i) < 0) + goto cleanup; + } + +#define ADD_BITMAP(map, name) \ + if (!(tmp =3D virBitmapFormat(map))) \ + goto cleanup; \ + if (virTypedParamsAddString(&par, &npar, &maxpar, name, tmp) < 0) \ + goto cleanup; \ + VIR_FREE(tmp) + + ADD_BITMAP(vcpus, "vcpus"); + ADD_BITMAP(online, "online"); + + if (virBitmapClearBit(online, 0) < 0) + goto cleanup; + ADD_BITMAP(online, "offlinable"); +#undef ADD_BITMAP + + *params =3D par; + *nparams =3D npar; + par =3D NULL; + + ret =3D 0; + cleanup: + VIR_FREE(tmp); + virBitmapFree(vcpus); + virBitmapFree(online); + virDomainObjEndAPI(&vm); + virTypedParamsFree(par, npar); + return ret; +} + + static int testDomainGetMaxVcpus(virDomainPtr domain) { @@ -8964,6 +9033,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainSetVcpus =3D testDomainSetVcpus, /* 0.1.4 */ .domainSetVcpusFlags =3D testDomainSetVcpusFlags, /* 0.8.5 */ .domainGetVcpusFlags =3D testDomainGetVcpusFlags, /* 0.8.5 */ + .domainGetGuestVcpus =3D testDomainGetGuestVcpus, /* 5.7.0 */ .domainPinVcpu =3D testDomainPinVcpu, /* 0.7.3 */ .domainPinVcpuFlags =3D testDomainPinVcpuFlags, /* 5.6.0 */ .domainGetVcpus =3D testDomainGetVcpus, /* 0.7.3 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 09:12:19 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=1565287611; cv=none; d=zoho.com; s=zohoarc; b=FvFt2K9aCqsKKmXTzwxnzTzVPXRfw970Ho5PkVR152P/I6KKHNShr1QBTrgNg43xTmDUBTwTgTBlmQ34M+vLyreWjkiX10hgwaMZV3cWF/iiEb0Tlqh1lgDs9fxoZe+r3M+Oj1dGXXZCyw4DmE7AtmqgaOMkjrhbgv13hEasQfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565287611; 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=H1e0FHYHFmgT5UwmG5WcubR9s9loZatuuqiXyedpx4w=; b=GiWqk5ThdYU/DfCziJcMRuMjwUrPkKMp1Enyv2CUNvKygxt1GYn5uIXWb5wF3KzUuI1sA6aV3yybgo/rjCew7mFpY7a2wZXoHYVFe1gykCSVxS8CLpLD8Kmq2rLM/Zj+wXxM06J+L+gw/hslKQvxEnwgTGaomQngrirUf4X8cOw= 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 15652876116881.0791439061378014; Thu, 8 Aug 2019 11:06:51 -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 63BC830CADED; Thu, 8 Aug 2019 18:06:50 +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 2FDDC1001955; Thu, 8 Aug 2019 18:06:50 +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 D0E66206CE; Thu, 8 Aug 2019 18:06:49 +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 x78I6n9M024979 for ; Thu, 8 Aug 2019 14:06:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C59F1001955; Thu, 8 Aug 2019 18:06:49 +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 268F51001948 for ; Thu, 8 Aug 2019 18:06:46 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.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 D6373307D974 for ; Thu, 8 Aug 2019 18:06:45 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id p74so3259693wme.4 for ; Thu, 08 Aug 2019 11:06:45 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id p13sm23308915wrw.90.2019.08.08.11.06.43 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 11:06:43 -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=RhebKJn53Hw35RteQUYq6mgwRWGIsnnQrlXvPAunzHU=; b=meG/e949+nnicP3qBvkdyBulX4RFFom1QXaypopUso78ggZjRzTuXLiOcPzV2hIIJZ 3CRGvGx7sX+HMT0r/XOS59meSoh/l7crkDKnxiaRvunpR48nWzRQLMdXhScRBNvH7Jzp 9nOvB51TYkMW4BIoHk481qnFKdcoXeBYjuZ+nJs3S4FbCGpoqHGIwYADaOwcQHkPYluH o50oJCiEXSR+J88sNSD1RZH13iEYC0Agh5rKn3VdnfahDwEDEzqPyXvyMXwAIcUwyVMt wPKSubyOKYmokxuxN37XRhu5lxRWIfWkGyhgjL4sy/k9koaB+zOIHgGT6MFiUvC8PhXS ukzQ== 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=RhebKJn53Hw35RteQUYq6mgwRWGIsnnQrlXvPAunzHU=; b=RT7QfhCeqHubqQuLx0bjYL6OzegdjSpm06J07Pb0rhbliTfhT1//hevr14IUIZf94I 093uTYDNQll+P2CpHg6COqFslxeOsfbfwKKOlzIW3oAUBE62Vk9krpHw/Ssp8CkhmheC ZGN7KR7YEKH3W09UG7h0Yse3mXtan2Icj1VhCaTuV+zfhPI2jtsLd3Etb6NeRL5mX5j6 mna7xvFmyoAm6CxOnlw/AIc2EU3q5EubEW03AL0aRH1v+ulZzgu/qpEsof2tOAEcq7z8 ku9zF1ImCqKM756Rl8hs+oQ7bOx+Uf1JBUHJO3kiB994a+v2ZYPhD3J2XpQ6QUwEA5Hg GIHA== X-Gm-Message-State: APjAAAVxwtbL9Lgv/hhY0Qj9oKkH+1CC2F++Vb37Zkf/nw6X0cBHSG4K 9p78/9950f1hPXYAOWbI9otfuhaeoC4= X-Google-Smtp-Source: APXvYqwZkqRG/d+B+yaMDEDtxwcd+HbdbVZIxYNN6U1FMTqQ9YUTwts1Jl2C5eDfUY0+zgkAxrxXWA== X-Received: by 2002:a1c:3b02:: with SMTP id i2mr5546051wma.23.1565287604113; Thu, 08 Aug 2019 11:06:44 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 21:05:23 +0300 Message-Id: <20190808180524.17771-4-stamatis.iliass@gmail.com> In-Reply-To: <20190808180524.17771-1-stamatis.iliass@gmail.com> References: <20190808180524.17771-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]); Thu, 08 Aug 2019 18:06:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 08 Aug 2019 18:06:46 +0000 (UTC) for IP:'209.85.128.66' DOMAIN:'mail-wm1-f66.google.com' HELO:'mail-wm1-f66.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.66 mail-wm1-f66.google.com 209.85.128.66 mail-wm1-f66.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] test_driver: implement virDomainSetVcpu 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.46]); Thu, 08 Aug 2019 18:06:51 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 99cba7db42..d6f1adf6e9 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2995,6 +2995,81 @@ testDomainSetVcpus(virDomainPtr domain, unsigned int= nrCpus) return testDomainSetVcpusFlags(domain, nrCpus, VIR_DOMAIN_AFFECT_LIVE); } + +static int +testDomainSetVcpu(virDomainPtr dom, + const char *cpumap, + int state, + unsigned int flags) +{ + virDomainObjPtr vm =3D NULL; + virDomainDefPtr def =3D NULL; + virDomainDefPtr persistentDef =3D NULL; + virBitmapPtr map =3D NULL; + ssize_t lastvcpu; + size_t i; + int ret =3D -1; + + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | + VIR_DOMAIN_AFFECT_CONFIG, -1); + + if (state !=3D 0 && state !=3D 1) { + virReportInvalidArg(state, "%s", _("unsupported state value")); + return -1; + } + + if (virBitmapParse(cpumap, &map, 32) < 0) + goto cleanup; + + if ((lastvcpu =3D virBitmapLastSetBit(map)) < 0) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("no vcpus selected for modification")); + goto cleanup; + } + + if (!(vm =3D testDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0) + goto cleanup; + + if (persistentDef) { + if (lastvcpu >=3D virDomainDefGetVcpusMax(persistentDef)) { + virReportError(VIR_ERR_INVALID_ARG, + _("vcpu %zd is not present in persistent config= "), + lastvcpu); + goto cleanup; + } + } + + if (def) { + if (lastvcpu >=3D virDomainDefGetVcpusMax(def)) { + virReportError(VIR_ERR_INVALID_ARG, + _("vcpu %zd is not present in live config"), + lastvcpu); + goto cleanup; + } + } + + if (virBitmapIsBitSet(map, 0)) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("vCPU '0' can't be modified")); + goto cleanup; + } + + for (i =3D 1; i < vm->def->maxvcpus - 1; i++) { + if (virBitmapIsBitSet(map, i)) + vm->def->vcpus[i]->online =3D state; + } + + ret =3D 0; + cleanup: + virBitmapFree(map); + virDomainObjEndAPI(&vm); + return ret; +} + + static int testDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo, @@ -9032,6 +9107,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainGetEmulatorPinInfo =3D testDomainGetEmulatorPinInfo, /* 5.6.0 */ .domainSetVcpus =3D testDomainSetVcpus, /* 0.1.4 */ .domainSetVcpusFlags =3D testDomainSetVcpusFlags, /* 0.8.5 */ + .domainSetVcpu =3D testDomainSetVcpu, /* 5.7.0 */ .domainGetVcpusFlags =3D testDomainGetVcpusFlags, /* 0.8.5 */ .domainGetGuestVcpus =3D testDomainGetGuestVcpus, /* 5.7.0 */ .domainPinVcpu =3D testDomainPinVcpu, /* 0.7.3 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 09:12:19 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=1565287623; cv=none; d=zoho.com; s=zohoarc; b=RPSzf4EnFbpniZNiNeLikoq/l9lMDoh9Lp9DLemvh1ooTiQl93vgE9OV6vCoMJDhM9jIBI9FhO3KU7OOSftGGPqfHfVlKWIzBBj3JOw1R3SthQIdlA+LkLc/lC5RgyvBqpIw/Ol0GUaYARo2apGdGzKvF/AYXlflnfvR80GCX68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565287623; 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=5/oNOz2pLlBRueS66Hq0ZLHV9/GV9VOQnhidUHnHdhA=; b=BbWdIqH8MHioWs4nkOJMhHpaAHdo8/5eIqdHFughOQ1e5cRMQTq+1kbBkB1zmb/8FPmjTKXDeLLP2iRNfX3U4ZJ0/iw3BnmRTF76rVWn+pnEHU9QFfJIjhs4RT6HTpzJatKqCrglgxYco00rMR0yyB2RuFB6ngXfPS82gQhvdP0= 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 156528762310115.381111610564062; Thu, 8 Aug 2019 11:07:03 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82A783CA1D; Thu, 8 Aug 2019 18:07:01 +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 5525A61B61; Thu, 8 Aug 2019 18:07:01 +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 181791806B00; Thu, 8 Aug 2019 18:07:01 +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 x78I6xEO025308 for ; Thu, 8 Aug 2019 14:06:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id ADD1C67601; Thu, 8 Aug 2019 18:06:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A815C61B61 for ; Thu, 8 Aug 2019 18:06:56 +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 46DD53172D9D for ; Thu, 8 Aug 2019 18:06:56 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id g67so3297406wme.1 for ; Thu, 08 Aug 2019 11:06:56 -0700 (PDT) Received: from archlap.localdomain ([185.32.231.210]) by smtp.gmail.com with ESMTPSA id p13sm23308915wrw.90.2019.08.08.11.06.53 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 08 Aug 2019 11:06:54 -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=i5Qn9Ep6NekNOPjL06zW7TN3cwOZmGrnDMbDNQ8QXFw=; b=mmSaaTNWs9x2OAqEaPWHTHd80Cb/90jxxB1MwHB6pyr5e/xme0nItt+vtOYpvQw8Gb AucdYt1qQaF+T74ocFtvTpwZm8s+llbIDkKdil8jHF9PPC8xB4R1uGnkw8Xc/xEOg1Ca r8d04lflE/a+hgJ7SGMO5uLVlJSiYKf4L2v2E/61fPFNnl34jcXngxCGG8g9KmanExr6 TImS8GeaelHK6DyIRhAa/uCgbUaltUx+BWFtEw81TZ1G3erzqkSCoNaTlYEB+L5tFLAe I9PyoY4gS/a2HI30bCJmnQpf72Tw/L5OPm9rhOyFaClngEeIavtq56+If2fMhJpZMEea iLeA== 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=i5Qn9Ep6NekNOPjL06zW7TN3cwOZmGrnDMbDNQ8QXFw=; b=dZg+Sx6WhBYQmc9vR5+ybChPS3MBubHHLthTrX/BGZXZqamk8sIlzMTlYo5B7V5CrD TZca5cxCmW1L+hQH17lcWDm+PpAjFIoUX2s2A4VIxuURbYOBXVafTKInYplljEAhE8NZ u/1wSxk75GU4e6e4twQCWVfWx9c83yqVA/FUX+87w5SqMlI1CW9YN8LURJxRZkMnICWb 8YXfmj7/twfRbGaV0F282JOPjjPOIJefqtrM6Dj46xTa+7GK6NzpHPG5oDd34zFKBo+L pAgH/NGKl02REAX0W7oysKdzeqBVRsRtIWJIjBvp7Q7i6R/dgrfHuFUDtrt6iWZQpMjL 45Mg== X-Gm-Message-State: APjAAAULEegBqt/DOFTwEzH2T9gz2K0QVfQSClK4QHcixzQZPO98Ik0e jXEAsJd0Q1M1hmhiq3Ch+S36HFnmZHs= X-Google-Smtp-Source: APXvYqzYykE4DKQfYwuG7LEWFg8vZvD/oKjeQtz9AVCvHzZ1BqYqNCFg4aX+zITrAck05DbJ+fmuNw== X-Received: by 2002:a1c:3b02:: with SMTP id i2mr5546895wma.23.1565287614614; Thu, 08 Aug 2019 11:06:54 -0700 (PDT) From: Ilias Stamatis To: libvir-list@redhat.com Date: Thu, 8 Aug 2019 21:05:24 +0300 Message-Id: <20190808180524.17771-5-stamatis.iliass@gmail.com> In-Reply-To: <20190808180524.17771-1-stamatis.iliass@gmail.com> References: <20190808180524.17771-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.41]); Thu, 08 Aug 2019 18:06:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 08 Aug 2019 18:06:56 +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: -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.67 mail-wm1-f67.google.com 209.85.128.67 mail-wm1-f67.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] test_driver: implement virDomainSetGuestVcpus 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 08 Aug 2019 18:07:02 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Ilias Stamatis --- src/test/test_driver.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index d6f1adf6e9..6698fb7cf6 100755 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3070,6 +3070,17 @@ testDomainSetVcpu(virDomainPtr dom, } +static int +testDomainSetGuestVcpus(virDomainPtr dom, + const char *cpumap, + int state, + unsigned int flags) +{ + virCheckFlags(0, -1); + return testDomainSetVcpu(dom, cpumap, state, VIR_DOMAIN_AFFECT_LIVE); +} + + static int testDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo, @@ -9108,6 +9119,7 @@ static virHypervisorDriver testHypervisorDriver =3D { .domainSetVcpus =3D testDomainSetVcpus, /* 0.1.4 */ .domainSetVcpusFlags =3D testDomainSetVcpusFlags, /* 0.8.5 */ .domainSetVcpu =3D testDomainSetVcpu, /* 5.7.0 */ + .domainSetGuestVcpus =3D testDomainSetGuestVcpus, /* 5.7.0 */ .domainGetVcpusFlags =3D testDomainGetVcpusFlags, /* 0.8.5 */ .domainGetGuestVcpus =3D testDomainGetGuestVcpus, /* 5.7.0 */ .domainPinVcpu =3D testDomainPinVcpu, /* 0.7.3 */ -- 2.22.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list