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]
/
fish
/
reopen.c
diff --git
a/fish/reopen.c
b/fish/reopen.c
index
f2d35c7
..
c455a91
100644
(file)
--- a/
fish/reopen.c
+++ b/
fish/reopen.c
@@
-26,11
+26,13
@@
#include "fish.h"
int
#include "fish.h"
int
-
do_reopen (const char *cmd, in
t argc, char *argv[])
+
run_reopen (const char *cmd, size_
t argc, char *argv[])
{
guestfs_h *g2;
int r;
const char *p;
{
guestfs_h *g2;
int r;
const char *p;
+ guestfs_error_handler_cb cb;
+ void *cb_data;
if (argc > 0) {
fprintf (stderr, _("'reopen' command takes no parameters\n"));
if (argc > 0) {
fprintf (stderr, _("'reopen' command takes no parameters\n"));
@@
-50,10
+52,17
@@
do_reopen (const char *cmd, int argc, char *argv[])
/* Now copy some of the settings from the old handle. The settings
* we copy are those which are set by guestfish itself.
*/
/* Now copy some of the settings from the old handle. The settings
* we copy are those which are set by guestfish itself.
*/
+ cb = guestfs_get_error_handler (g, &cb_data);
+ guestfs_set_error_handler (g2, cb, cb_data);
+
r = guestfs_get_verbose (g);
if (r >= 0)
guestfs_set_verbose (g2, r);
r = guestfs_get_verbose (g);
if (r >= 0)
guestfs_set_verbose (g2, r);
+ r = guestfs_get_trace (g);
+ if (r >= 0)
+ guestfs_set_trace (g2, r);
+
r = guestfs_get_autosync (g);
if (r >= 0)
guestfs_set_autosync (g2, r);
r = guestfs_get_autosync (g);
if (r >= 0)
guestfs_set_autosync (g2, r);
@@
-62,6
+71,14
@@
do_reopen (const char *cmd, int argc, char *argv[])
if (p)
guestfs_set_path (g2, p);
if (p)
guestfs_set_path (g2, p);
+ r = guestfs_get_pgroup (g);
+ if (r >= 0)
+ guestfs_set_pgroup (g2, r);
+
+ if (progress_bars)
+ guestfs_set_event_callback (g2, progress_callback,
+ GUESTFS_EVENT_PROGRESS, 0, NULL);
+
/* Close the original handle. */
guestfs_close (g);
g = g2;
/* Close the original handle. */
guestfs_close (g);
g = g2;