]> xenbits.xensource.com Git - people/iwj/ring3-xl-test.git/commitdiff
test_domain_create_new: Avoid calling destroy on dom0
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Jun 2015 17:42:59 +0000 (18:42 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 23 Jun 2015 17:42:59 +0000 (18:42 +0100)
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>
test_domain_create_new.c

index 3481c6ed2b36e253af5261a58367354ad4c961e6..f6f12f86c8850cccb6ce8243dbde931cf9c7069a 100644 (file)
@@ -43,6 +43,7 @@ void *testcase(struct test *tc)
 
         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)) {
@@ -58,6 +59,7 @@ void *testcase(struct test *tc)
             printf("libxl_ao_cancel returned %d\n", rc);
             assert(rc == ERROR_NOTFOUND);
 
+            assert(domid);
             libxl_domain_destroy(tc->ctx, domid, 0);
             break;
         }