1 #ifndef NM_VM_CONTROL_H_ 2 #define NM_VM_CONTROL_H_ 3 4 #include <nm_string.h> 5 #include <nm_vector.h> 6 7 static const uint32_t NM_STARTING_VNC_PORT = 5900; 8 9 enum vmctl_flags { 10 NM_VMCTL_TEMP = (1 << 1), 11 NM_VMCTL_INFO = (1 << 2), 12 NM_VMCTL_CONT = (1 << 3) 13 }; 14 15 typedef struct { 16 nm_vect_t main; 17 nm_vect_t ifs; 18 nm_vect_t drives; 19 nm_vect_t usb; 20 } nm_vmctl_data_t; 21 22 #define NM_VMCTL_INIT_DATA (nm_vmctl_data_t) { \ 23 NM_INIT_VECT, NM_INIT_VECT, \ 24 NM_INIT_VECT, NM_INIT_VECT } 25 26 void nm_vmctl_start(const nm_str_t *name, int flags); 27 void nm_vmctl_delete(const nm_str_t *name); 28 void nm_vmctl_kill(const nm_str_t *name); 29 void nm_vmctl_get_data(const nm_str_t *name, nm_vmctl_data_t *vm); 30 void nm_vmctl_free_data(nm_vmctl_data_t *vm); 31 void nm_vmctl_clear_tap(const nm_str_t *name); 32 void nm_vmctl_clear_all_tap(void); 33 void nm_vmctl_gen_cmd(nm_vect_t *argv, const nm_vmctl_data_t *vm, 34 const nm_str_t *name, int *flags, nm_vect_t *tfds, nm_str_t *snap); 35 nm_str_t nm_vmctl_info(const nm_str_t *name); 36 void nm_vmctl_log_last(const nm_str_t *msg); 37 #if defined(NM_WITH_VNC_CLIENT) || defined(NM_WITH_SPICE) 38 void nm_vmctl_connect(const nm_str_t *name); 39 #endif 40 41 #endif /*NM_VM_CONTROL_H_ */ 42 /* vim:set ts=4 sw=4: */ 43