Skip to contentSkip to conversation

libxl: Do not try to destroy domain -1 on failed create

PATCH In review Ian Jackson 3 participants 3 messages Jul 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: Do not try to destroy domain -1 on failed create

Perhaps since f0c4c53f "libxl: domain create: Do not destroy on ao abort", we have destroyed guest_domid==-1 if domain creation fails without actually creating a domid.

---
 tools/libxl/libxl_create.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_create.c +1 -1
index f366a09..f799081 100644
@@ -1543,7 +1543,7 @@ static void domcreate_complete(libxl__egc *egc,
     libxl_domain_config_dispose(d_config_saved);
 
     if (!retain_domain) {
-        if (dcs->guest_domid) {
+        if (dcs->guest_domid > 0) {
             dcs->dds.ao = ao;
             dcs->dds.domid = dcs->guest_domid;
             dcs->dds.callback = domcreate_destruction_cb;
Signature · 1 line
1.7.10.4
Tested-by on v1 1/1
#2 lore raw
In reply to Ian Jackson

Hi Ian,

Quoted 7 lines · Ian Jackson

Perhaps since f0c4c53f "libxl: domain create: Do not destroy on ao abort", we have destroyed guest_domid==-1 if domain creation fails without actually creating a domid.

Thank you, it removes the 3 following lines from xl output:

libxl: error: libxl.c:1586:libxl__destroy_domid: non-existant domain -1
libxl: error: libxl.c:1544:domain_destroy_callback: unable to destroy guest with domid 4294967295
libxl: error: libxl_create.c:1567:domcreate_destruction_cb: unable to destroy domain 4294967295 following failed creation

Regards,

Signature · 1 line
Julien Grall