2 * Copyright (C) 2009 Red Hat Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 /* For API documentation, please read the manual page guestfs(3). */
24 typedef struct guestfs_h guestfs_h;
26 /* Create and destroy the guest handle. */
27 extern guestfs_h *guestfs_create (void);
28 extern void guestfs_free (guestfs_h *g);
30 /* Guest configuration. */
31 extern int guestfs_config (guestfs_h *g,
32 const char *qemu_param, const char *qemu_value);
33 extern int guestfs_add_drive (guestfs_h *g, const char *filename);
34 extern int guestfs_add_cdrom (guestfs_h *g, const char *filename);
36 /* Steps to start up the guest. */
37 extern int guestfs_launch (guestfs_h *g);
38 extern int guestfs_wait_ready (guestfs_h *g);
40 /* Kill the guest subprocess. */
41 extern void guestfs_kill_subprocess (guestfs_h *g);
44 typedef void (*guestfs_abort_fn) (void);
45 extern void guestfs_set_out_of_memory_handler (guestfs_h *g, guestfs_abort_fn);
46 extern guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);
48 extern void guestfs_set_exit_on_error (guestfs_h *g, int exit_on_error);
49 extern int guestfs_get_exit_on_error (guestfs_h *g);
51 extern void guestfs_set_verbose (guestfs_h *g, int verbose);
52 extern int guestfs_get_verbose (guestfs_h *g);
54 #endif /* GUESTFS_H_ */