summaryrefslogtreecommitdiff
path: root/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-09-16 12:25:55 +0300
committerMarcelo Tosatti <mtosatti@redhat.com>2009-09-16 16:00:48 -0300
commit4d4805e12367f3e0e709976194997320bc4f4c8b (patch)
treebecd7eb7d70d6ed847345be4a5c410aee96149e8 /kvm
parenttest: add support for the firmware configuration interface (diff)
downloadqemu-kvm-4d4805e12367f3e0e709976194997320bc4f4c8b.tar.gz
qemu-kvm-4d4805e12367f3e0e709976194997320bc4f4c8b.tar.bz2
qemu-kvm-4d4805e12367f3e0e709976194997320bc4f4c8b.zip
test: Add fwcfg interface for getting the cpu count
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm')
-rw-r--r--kvm/user/test/lib/x86/fwcfg.c5
-rw-r--r--kvm/user/test/lib/x86/fwcfg.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/kvm/user/test/lib/x86/fwcfg.c b/kvm/user/test/lib/x86/fwcfg.c
index a9a2ce2d9..2cf7cecdd 100644
--- a/kvm/user/test/lib/x86/fwcfg.c
+++ b/kvm/user/test/lib/x86/fwcfg.c
@@ -33,3 +33,8 @@ uint64_t fwcfg_get_u64(unsigned index)
{
return fwcfg_get_u(index, 8);
}
+
+unsigned fwcfg_get_nb_cpus(void)
+{
+ return fwcfg_get_u16(FW_CFG_NB_CPUS);
+}
diff --git a/kvm/user/test/lib/x86/fwcfg.h b/kvm/user/test/lib/x86/fwcfg.h
index c7245e29c..e0836ca4d 100644
--- a/kvm/user/test/lib/x86/fwcfg.h
+++ b/kvm/user/test/lib/x86/fwcfg.h
@@ -38,5 +38,7 @@ uint16_t fwcfg_get_u16(unsigned index);
uint32_t fwcfg_get_u32(unsigned index);
uint64_t fwcfg_get_u64(unsigned index);
+unsigned fwcfg_get_nb_cpus(void);
+
#endif