2 * Copyright (C) 2007 Martin Willi
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 #include <utils/iterator.h>
24 typedef struct guest_t guest_t
;
27 * @brief A guest is a UML instance running on the host.
32 * @brief Get the name of this guest.
34 * @return name of the guest
36 char* (*get_name
) (guest_t
*this);
39 * @brief Start the guest.
41 * @return TRUE if guest successfully started
43 bool (*start
) (guest_t
*this);
46 * @brief Kill the guest.
48 * @return TRUE if guest was running and killed
50 bool (*stop
) (guest_t
*this);
53 * @brief Create a new interface for that host.
55 * @param name name of the interface in the guest
56 * @return created interface, or NULL if failed
58 iface_t
* (*create_iface
)(guest_t
*this, char *name
);
61 * @brief Create an iterator over all guest interfaces.
63 * @return iterator over iface_t's
65 iterator_t
* (*create_iface_iterator
)(guest_t
*this);
68 * @brief Close and destroy a guest with all interfaces
70 void (*destroy
) (guest_t
*this);
74 * @brief Create a new, unstarted guest.
76 * @param name name of the guest
77 * @param kernel kernel to boot for this guest
78 * @param master read-only master filesystem for guest
79 * @param mem amount of memory to give the guest
81 guest_t
*guest_create(char *name
, char *kernel
, char *master
, int mem
);