Wanlong Gao
2012-Feb-25 02:02 UTC
[Libguestfs] [PATCH] set-smp: limit the number of cpus below 255
From: Wanlong Gao <gaowanlong at cn.fujitsu.com> Limit the number of cpus below 255, since qemu can't support. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- src/guestfs.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 3607eaa..f5875e6 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 cpus: %d", v); + return -1; + } else if (v >= 1) { g->smp = v; return 0; } else { -- 1.7.9
Richard W.M. Jones
2012-Feb-25 15:00 UTC
[Libguestfs] [PATCH] set-smp: limit the number of cpus below 255
On Sat, Feb 25, 2012 at 10:02:20AM +0800, Wanlong Gao wrote:> > From: Wanlong Gao <gaowanlong at cn.fujitsu.com> > Limit the number of cpus below 255, since qemu can't support. > > Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> > --- > src/guestfs.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/src/guestfs.c b/src/guestfs.c > index 3607eaa..f5875e6 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 cpus: %d", v); > + return -1; > + } else if (v >= 1) { > g->smp = v; > return 0; > } else {ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
Maybe Matching Threads
- [PATCH] set-smp: only set smp value at config time
- [PATCH 1/3] ext2: tweak the error returned message of resize2fs-M(BZ755729)
- [PATCH v2 1/3] ext2: tweak the error returned message of resize2fs-M(BZ755729)
- [PATCH 1/3] virtio: change to_vp_device to an inlined definition
- [PATCH 1/3] virtio: change to_vp_device to an inlined definition