Stefano Stabellini wrote: > On Sat, 8 May 2010, Gihan Munasinghe wrote: > >> Guys >> >> I patched xl to have "reboot" and "shutdown" commands. >> I tested this with hvm domains with and and without pv drivers seems to >> work, of course the os level reboot and shutdown will only happen if >> there are pv drivers with the dom U. >> >> Also the libxl_domain_shutdown was not working for hvm guests without pv >> drivers, I did a small patch to that as well. (same way xend shutdown >> works used || instead of a && ). I would appreciate if someone can test >> this more with hvm and pv domains. >> >> Let me know what you think >> >> > > Thanks for the patch! > It is mostly correct, however libxenlight changed quite a bit since xen > 4.0 so could you please port your changes to xen-unstable? > > > The Patch is ported to xen-unstable see attached >> >> +start: >> + domid = 0; >> + >> ret = libxl_domain_make(&ctx, &info1, &domid); >> if (ret) { >> fprintf(stderr, "cannot make domain: %d\n", ret); >> > > this is probably not needed anymore > > Yes this fix is not needed anymore > >> LOG("Done. Rebooting now"); >> + sleep(2);/*Fix Me: The sleep is put here to slowdown the recreation of the domain >> + If this sleep it not there, hvm_domain creation failes sometimes*/ >> goto start; >> } >> LOG("Done. Exiting now"); >> > > since we don't free the ctx anymore here, it might be unnecessary. > The other changes look OK but we have a command table now, so they need > to be adapted. > > The sleep is still needed, if not libxl_* calls fails sometimes. I'll do more debugging with in the calls it self and see, but for now the sleep() seems to do the trick. Thanks Gihan