Revision 376253ec migration.c
b/migration.c | ||
---|---|---|
13 | 13 |
|
14 | 14 |
#include "qemu-common.h" |
15 | 15 |
#include "migration.h" |
16 |
#include "console.h"
|
|
16 |
#include "monitor.h"
|
|
17 | 17 |
#include "buffered_file.h" |
18 | 18 |
#include "sysemu.h" |
19 | 19 |
#include "block.h" |
... | ... | |
48 | 48 |
fprintf(stderr, "unknown migration protocol: %s\n", uri); |
49 | 49 |
} |
50 | 50 |
|
51 |
void do_migrate(int detach, const char *uri) |
|
51 |
void do_migrate(Monitor *mon, int detach, const char *uri)
|
|
52 | 52 |
{ |
53 | 53 |
MigrationState *s = NULL; |
54 | 54 |
const char *p; |
... | ... | |
60 | 60 |
s = exec_start_outgoing_migration(p, max_throttle, detach); |
61 | 61 |
#endif |
62 | 62 |
else |
63 |
term_printf("unknown migration protocol: %s\n", uri);
|
|
63 |
monitor_printf(mon, "unknown migration protocol: %s\n", uri);
|
|
64 | 64 |
|
65 | 65 |
if (s == NULL) |
66 |
term_printf("migration failed\n");
|
|
66 |
monitor_printf(mon, "migration failed\n");
|
|
67 | 67 |
else { |
68 | 68 |
if (current_migration) |
69 | 69 |
current_migration->release(current_migration); |
... | ... | |
72 | 72 |
} |
73 | 73 |
} |
74 | 74 |
|
75 |
void do_migrate_cancel(void)
|
|
75 |
void do_migrate_cancel(Monitor *mon)
|
|
76 | 76 |
{ |
77 | 77 |
MigrationState *s = current_migration; |
78 | 78 |
|
... | ... | |
80 | 80 |
s->cancel(s); |
81 | 81 |
} |
82 | 82 |
|
83 |
void do_migrate_set_speed(const char *value) |
|
83 |
void do_migrate_set_speed(Monitor *mon, const char *value)
|
|
84 | 84 |
{ |
85 | 85 |
double d; |
86 | 86 |
char *ptr; |
... | ... | |
100 | 100 |
max_throttle = (uint32_t)d; |
101 | 101 |
} |
102 | 102 |
|
103 |
void do_info_migrate(void)
|
|
103 |
void do_info_migrate(Monitor *mon)
|
|
104 | 104 |
{ |
105 | 105 |
MigrationState *s = current_migration; |
106 |
|
|
106 |
|
|
107 | 107 |
if (s) { |
108 |
term_printf("Migration status: ");
|
|
108 |
monitor_printf(mon, "Migration status: ");
|
|
109 | 109 |
switch (s->get_status(s)) { |
110 | 110 |
case MIG_STATE_ACTIVE: |
111 |
term_printf("active\n");
|
|
111 |
monitor_printf(mon, "active\n");
|
|
112 | 112 |
break; |
113 | 113 |
case MIG_STATE_COMPLETED: |
114 |
term_printf("completed\n");
|
|
114 |
monitor_printf(mon, "completed\n");
|
|
115 | 115 |
break; |
116 | 116 |
case MIG_STATE_ERROR: |
117 |
term_printf("failed\n");
|
|
117 |
monitor_printf(mon, "failed\n");
|
|
118 | 118 |
break; |
119 | 119 |
case MIG_STATE_CANCELLED: |
120 |
term_printf("cancelled\n");
|
|
120 |
monitor_printf(mon, "cancelled\n");
|
|
121 | 121 |
break; |
122 | 122 |
} |
123 | 123 |
} |
... | ... | |
146 | 146 |
|
147 | 147 |
/* Don't resume monitor until we've flushed all of the buffers */ |
148 | 148 |
if (s->detach == 2) { |
149 |
monitor_resume(); |
|
149 |
monitor_resume(cur_mon);
|
|
150 | 150 |
s->detach = 0; |
151 | 151 |
} |
152 | 152 |
|
Also available in: Unified diff