git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virt-sysprep: Switch to using guestmount, add more features.
[libguestfs.git]
/
src
/
guestfs.c
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
1fa3c0a
..
f7ad967
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-144,6
+144,9
@@
guestfs_create (void)
*/
g->msg_next_serial = 0x00123400;
*/
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;
/* Link the handles onto a global list. */
gl_lock_lock (handles_lock);
g->next = handles;
@@
-433,14
+436,8
@@
guestfs_perrorf (guestfs_h *g, const char *fs, ...)
if (err < 0) return;
if (err < 0) return;
-#if !defined(_GNU_SOURCE) || defined(__APPLE__)
char buf[256];
strerror_r (errnum, buf, sizeof buf);
char buf[256];
strerror_r (errnum, buf, sizeof buf);
-#else
- char _buf[256];
- char *buf;
- buf = strerror_r (errnum, _buf, sizeof _buf);
-#endif
msg = safe_realloc (g, msg, strlen (msg) + 2 + strlen (buf) + 1);
strcat (msg, ": ");
msg = safe_realloc (g, msg, strlen (msg) + 2 + strlen (buf) + 1);
strcat (msg, ": ");
@@
-820,6
+817,24
@@
guestfs__get_pgroup (guestfs_h *g)
return g->pgroup;
}
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.
/* 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.