Initialise domid to -2.
Assert that it is nonzero when we are going to destroy.
We might still try to destroy -2 or -1, but that's harmless.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
printf("\n****** Will cancel after %d events ******\n", count);
+ domid = -2;
do_domain_create(tc, &dc, &domid);
if (wait_until_n(tc, EV_LIBXL_CALLBACK, count, &ev)) {
printf("libxl_ao_cancel returned %d\n", rc);
assert(rc == ERROR_NOTFOUND);
+ assert(domid);
libxl_domain_destroy(tc->ctx, domid, 0);
break;
}