ia64/xen-unstable

changeset 6516:455dff354413

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>
author adsharma@los-vmm.sc.intel.com
date Tue Aug 09 11:12:44 2005 -0800 (2005-08-09)
parents ac8cae1f2c47
children bbb21d688c7f
files tools/ioemu/monitor.c tools/ioemu/target-i386-dm/helper2.c
line diff
     1.1 --- a/tools/ioemu/monitor.c	Tue Aug 09 11:06:45 2005 -0800
     1.2 +++ b/tools/ioemu/monitor.c	Tue Aug 09 11:12:44 2005 -0800
     1.3 @@ -225,14 +225,10 @@ static void do_info_history (void)
     1.4      }
     1.5  }
     1.6  
     1.7 +extern void destroy_vmx_domain(void);
     1.8  static void do_quit(void)
     1.9  {
    1.10 -    extern int domid;
    1.11 -    extern FILE* logfile;
    1.12 -    char destroy_cmd[20];
    1.13 -    sprintf(destroy_cmd, "xm destroy %d", domid);
    1.14 -    if (system(destroy_cmd) == -1)
    1.15 -        fprintf(logfile, "%s failed.!\n", destroy_cmd);
    1.16 +    destroy_vmx_domain();
    1.17      exit(0);
    1.18  }
    1.19  
     2.1 --- a/tools/ioemu/target-i386-dm/helper2.c	Tue Aug 09 11:06:45 2005 -0800
     2.2 +++ b/tools/ioemu/target-i386-dm/helper2.c	Tue Aug 09 11:12:44 2005 -0800
     2.3 @@ -328,7 +328,16 @@ do_interrupt(CPUState *env, int vector)
     2.4  	env->send_event = 1;
     2.5  }
     2.6  
     2.7 -//static unsigned long tsc_per_tick = 1; /* XXX: calibrate */
     2.8 +void
     2.9 +destroy_vmx_domain(void)
    2.10 +{
    2.11 +    extern int domid;
    2.12 +    extern FILE* logfile;
    2.13 +    char destroy_cmd[20];
    2.14 +    sprintf(destroy_cmd, "xm destroy %d", domid);
    2.15 +    if (system(destroy_cmd) == -1)
    2.16 +        fprintf(logfile, "%s failed.!\n", destroy_cmd);
    2.17 +}
    2.18  
    2.19  int main_loop(void)
    2.20  {
    2.21 @@ -396,6 +405,7 @@ int main_loop(void)
    2.22  			}
    2.23  		}
    2.24  	}
    2.25 +        destroy_vmx_domain();
    2.26  	return 0;
    2.27  }
    2.28