summaryrefslogtreecommitdiffstats
path: root/src/launch.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-20 14:24:10 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-20 15:10:46 +0100
commitec8e3b6cad170d08ac18b580792dfb137eb171dc (patch)
tree785058598dc6975e63332c7302220e9b38ba5be6 /src/launch.c
parent08cad543492c9624be0659dfb18b7a8b21de8fba (diff)
downloadlibguestfs-ec8e3b6cad170d08ac18b580792dfb137eb171dc.tar.gz
libguestfs-ec8e3b6cad170d08ac18b580792dfb137eb171dc.tar.xz
libguestfs-ec8e3b6cad170d08ac18b580792dfb137eb171dc.zip
launch: Abstract attach method operations.
g->attach_ops points to a structure which contains the operations supported by each attach method backend (ie. appliance, unix, etc.).
Diffstat (limited to 'src/launch.c')
-rw-r--r--src/launch.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/launch.c b/src/launch.c
index 167115f0..93029e4e 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -319,17 +319,21 @@ guestfs__launch (guestfs_h *g)
if (chmod (g->tmpdir, 0755) == -1)
warning (g, "chmod: %s: %m (ignored)", g->tmpdir);
- /* Launch the appliance or attach to an existing daemon. */
+ /* Launch the appliance. */
switch (g->attach_method) {
case ATTACH_METHOD_APPLIANCE:
- return guestfs___launch_appliance (g);
+ g->attach_ops = &attach_ops_appliance;
+ break;
case ATTACH_METHOD_UNIX:
- return guestfs___launch_unix (g, g->attach_method_arg);
+ g->attach_ops = &attach_ops_unix;
+ break;
default:
abort ();
}
+
+ return g->attach_ops->launch (g, g->attach_method_arg);
}
/* launch (of the appliance) generates approximate progress