X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fguestfs.c;h=f7ad96745945523eb2a952bc75a002b1296867bf;hp=002418a446def731761205c423053fdf98ba2474;hb=04fbcc63ebf5718608f199eb6b09061cd32283c3;hpb=8403f5a9d8f1451e2c2b029b51bac18724b18ebf diff --git a/src/guestfs.c b/src/guestfs.c index 002418a..f7ad967 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -144,6 +144,9 @@ guestfs_create (void) */ g->msg_next_serial = 0x00123400; + /* Default is uniprocessor appliance. */ + g->smp = 1; + /* Link the handles onto a global list. */ gl_lock_lock (handles_lock); g->next = handles; @@ -814,6 +817,24 @@ guestfs__get_pgroup (guestfs_h *g) return g->pgroup; } +int +guestfs__set_smp (guestfs_h *g, int v) +{ + if (v >= 1) { + g->smp = v; + return 0; + } else { + error (g, "invalid smp parameter: %d", v); + return -1; + } +} + +int +guestfs__get_smp (guestfs_h *g) +{ + return g->smp; +} + /* Note the private data area is allocated lazily, since the vast * majority of callers will never use it. This means g->pda is * likely to be NULL.