From b5cc1fa04996b6bde06d78fade52bedefceed782 Mon Sep 17 00:00:00 2001 From: Wanlong Gao Date: Sat, 25 Feb 2012 10:02:20 +0800 Subject: 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 --- src/guestfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 { -- cgit