static
int domain_event(virConnectPtr conn,virDomainPtr dom,
int evt, int detail, void *opaque){
bool test = true; return 0;}
int
_tmain(int argc, _TCHAR* argv[]){
virConnectPtr conn = virConnectOpen(
"qemu+tcp://192.168.220.198/session"); // Set Callback int cbresult = virConnectDomainEventRegister(conn, domain_event, NULL, NULL); // Lookup DomainvirDomainPtr dom = virDomainLookupByName(conn,
"Test1"); if (virDomainIsActive(dom) == 1){
// Start Domain int startDom = virDomainCreate(dom); if (startDom != 0){
virErrorPtr e = virGetLastError();
bool test = true;}
}
else{
// Stop Domain int StopDom = virDomainDestroy(dom); if (StopDom != 0){
virErrorPtr e = virGetLastError();
bool test = true;}
}
return 0;}