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>
This commit is contained in:
Wanlong Gao
2012-02-25 10:02:20 +08:00
committed by Richard W.M. Jones
parent 9e5c0b39c6
commit b5cc1fa049

View File

@@ -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 {