summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanlong Gao <gaowanlong@cn.fujitsu.com>2012-02-25 10:02:20 +0800
committerRichard W.M. Jones <rjones@redhat.com>2012-02-25 15:01:50 +0000
commitb5cc1fa04996b6bde06d78fade52bedefceed782 (patch)
treeb11749bccb49c0cd18bc4fb5734934767d970b1a
parent9e5c0b39c6b598a733a790d73d27eae491910a22 (diff)
downloadlibguestfs-b5cc1fa04996b6bde06d78fade52bedefceed782.tar.gz
libguestfs-b5cc1fa04996b6bde06d78fade52bedefceed782.tar.xz
libguestfs-b5cc1fa04996b6bde06d78fade52bedefceed782.zip
set-smp: limit the number of cpus below 255
Limit the number of cpus below 255, since qemu can't support. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
-rw-r--r--src/guestfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index 3607eaad..3493d793 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -794,7 +794,10 @@ guestfs__get_pgroup (guestfs_h *g)
int
guestfs__set_smp (guestfs_h *g, int v)
{
- if (v >= 1) {
+ if (v > 255) {
+ error (g, "unsupported number of smp vcpus: %d", v);
+ return -1;
+ } else if (v >= 1) {
g->smp = v;
return 0;
} else {