qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: eric.auger.pro@gmail.com, eric.auger@redhat.com,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	peter.maydell@linaro.org
Cc: drjones@redhat.com, wei@redhat.com, marc.zyngier@arm.com,
	cdall@kernel.org, zhaoshenglong@huawei.com
Subject: [Qemu-devel] [RFC 3/8] kvm: Expose kvm_max_vcpus()
Date: Tue, 27 Mar 2018 16:15:17 +0200	[thread overview]
Message-ID: <1522160122-10744-4-git-send-email-eric.auger@redhat.com> (raw)
In-Reply-To: <1522160122-10744-1-git-send-email-eric.auger@redhat.com>

Make kvm_max_vcpus() public so that the machines can query this information
easily.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
---
 accel/kvm/kvm-all.c    | 2 +-
 accel/stubs/kvm-stub.c | 5 +++++
 include/sysemu/kvm.h   | 7 +++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index ffee68e..b04f4ef 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -1462,7 +1462,7 @@ static int kvm_recommended_vcpus(KVMState *s)
     return (ret) ? ret : 4;
 }
 
-static int kvm_max_vcpus(KVMState *s)
+int kvm_max_vcpus(KVMState *s)
 {
     int ret = kvm_check_extension(s, KVM_CAP_MAX_VCPUS);
     return (ret) ? ret : kvm_recommended_vcpus(s);
diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
index 02d5170..e816050 100644
--- a/accel/stubs/kvm-stub.c
+++ b/accel/stubs/kvm-stub.c
@@ -170,4 +170,9 @@ bool kvm_arm_supports_user_irq(void)
 {
     return false;
 }
+
+int kvm_max_vcpus(KVMState *s)
+{
+    return -ENOSYS;
+}
 #endif
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 23669c4..1e7c621 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -546,6 +546,13 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source);
  * Returns: 0 on success, or a negative errno on failure.
  */
 int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target);
+
+/**
+ * kvm_max_vcpus - return the number of supported vcpus
+ * @s: The KVMState pointer
+ */
+int kvm_max_vcpus(KVMState *s);
+
 struct ppc_radix_page_info *kvm_get_radix_page_info(void);
 int kvm_get_max_memslots(void);
 #endif
-- 
2.5.5

  parent reply	other threads:[~2018-03-27 14:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 14:15 [Qemu-devel] [RFC 0/8] KVM/ARM: Relax the max 123 vcpus limitation along with KVM GICv3 Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 1/8] linux-headers: Partial update for KVM/ARM multiple redistributor region registration Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 2/8] hw/intc/arm_gicv3: Use an array of redistributor regions Eric Auger
2018-04-13 13:27   ` Peter Maydell
2018-04-13 13:36     ` Auger Eric
2018-03-27 14:15 ` Eric Auger [this message]
2018-03-27 14:15 ` [Qemu-devel] [RFC 4/8] hw/intc/arm_gicv3: Implement register_redist_region API Eric Auger
2018-04-13 13:34   ` Peter Maydell
2018-04-13 13:44     ` Auger Eric
2018-04-13 13:46       ` Peter Maydell
2018-04-13 13:56         ` Auger Eric
2018-03-27 14:15 ` [Qemu-devel] [RFC 5/8] hw/intc/arm_gicv3_kvm: Allow multiple redistributor regions Eric Auger
2018-03-27 14:15 ` [Qemu-devel] [RFC 6/8] hw/arm/virt: Allow GICv3 DT node with " Eric Auger
2018-04-13 13:36   ` Peter Maydell
2018-04-13 13:45     ` Auger Eric
2018-03-27 14:15 ` [Qemu-devel] [RFC 7/8] hw/arm/virt-acpi-build: Handle multiple GICR structures Eric Auger
2018-04-13 13:47   ` Andrew Jones
2018-04-13 13:55     ` Auger Eric
2018-03-27 14:15 ` [Qemu-devel] [RFC 8/8] hw/arm/virt: Allow up to 512 vcpus along with KVM VGICv3 Eric Auger
2018-03-28  4:02   ` Shannon Zhao
2018-03-28  6:47     ` Auger Eric
2018-04-13 13:41   ` Peter Maydell
2018-04-13 14:01     ` Auger Eric
2018-04-13 14:06       ` Peter Maydell
2018-04-13 14:11         ` Auger Eric
2018-04-16  9:19           ` Andrew Jones
2018-04-16 10:58             ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1522160122-10744-4-git-send-email-eric.auger@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=cdall@kernel.org \
    --cc=drjones@redhat.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=marc.zyngier@arm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wei@redhat.com \
    --cc=zhaoshenglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).