16 static int stdin_callback(
int fd,
char *buf,
int len) {
27 static int cleaning = 0;
53 static void sigh(
int signo) {
59 fprintf(stderr,
"Shutdown target and monitor connection; exiting (sig %d).\n",
65 int main(
int argc,
char **argv) {
66 char *svc_name =
"target";
80 verror(
"could not parse a target specification from arguments!\n");
104 verror(
"could not attach to monitor (in pid %d)\n",getpid());
114 verror(
"could not instantiate target, detaching from monitor!\n");
124 vwarn(
"monitored objid %d is not target id %d\n",
134 verror(
"bad internal error in monitor for %s %d; destroying!\n",
135 svc_name,monitor->
objid);
142 "monitoring on %s %d is done; finalizing!\n",
143 svc_name,monitor->
objid);
148 vwarn(
"%s %d monitor_run finished unexpectedly; finalizing!\n",
149 svc_name,monitor->
objid);
void target_rpc_fini(void)
void vmi_add_log_area_flags(log_areas_t areas, log_flags_t flags)
int monitor_add_primary_obj(struct monitor *monitor, int objid, int objtype, void *obj, void *objstate)
int monitor_is_done(struct monitor *monitor)
int target_pause(struct target *target)
int target_close(struct target *target)
#define verror(format,...)
void target_rpc_init(void)
void vmi_set_log_level(int level)
#define vwarn(format,...)
struct monitor * monitor_attach(monitor_type_t type, monitor_flags_t flags, int objtype, void *obj, void *objstate, evloop_handler_t custom_child_recv_evh, monitor_stdio_callback_t stdin_callback, void *callback_state)
void target_free_spec(struct target_spec *spec)
#define vdebug(devel, areas, flags, format,...)
#define REF_DEBUG_REPORT_FINISH()
int target_finalize(struct target *target)
int main(int argc, char **argv)
struct target_spec * tspec
struct target_spec * target_argp_driver_parse_one(struct argp *driver_parser, void *driver_state, int argc, char **argv, target_type_t target_types, int filter_quoted)
struct target * target_instantiate(struct target_spec *spec, struct evloop *evloop)
int monitor_destroy(struct monitor *monitor)
int monitor_run(struct monitor *monitor)
#define MONITOR_OBJTYPE_TARGET