When the guest shuts down a VM, make sure that the domain gets destroyed.

Device model needs to do xm destroy before it exits on
guest shutdown/poweroff/halt -p.

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
This commit is contained in:
adsharma@los-vmm.sc.intel.com committed 2005-08-09 11:12:44 -08:00
1 parent 882b16c2e0
commit dbd81fc2a5
2 files changed
+13 -7

No files matched your search

+2 -6
View File
@@ -225,14 +225,10 @@ static void do_info_history (void)
}
}
extern void destroy_vmx_domain(void);
static void do_quit(void)
{
extern int domid;
extern FILE* logfile;
char destroy_cmd[20];
sprintf(destroy_cmd, "xm destroy %d", domid);
if (system(destroy_cmd) == -1)
fprintf(logfile, "%s failed.!\n", destroy_cmd);
destroy_vmx_domain();
exit(0);
}
+11 -1
View File
@@ -328,7 +328,16 @@ do_interrupt(CPUState *env, int vector)
env->send_event = 1;
}
//static unsigned long tsc_per_tick = 1; /* XXX: calibrate */
void
destroy_vmx_domain(void)
{
extern int domid;
extern FILE* logfile;
char destroy_cmd[20];
sprintf(destroy_cmd, "xm destroy %d", domid);
if (system(destroy_cmd) == -1)
fprintf(logfile, "%s failed.!\n", destroy_cmd);
}
int main_loop(void)
{
@@ -396,6 +405,7 @@ int main_loop(void)
}
}
}
destroy_vmx_domain();
return 0;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.