@@ -1527,9 +1527,11 @@ int libxl_ctx_free(libxl_ctx *ctx /* 0 is OK */);
/* domain related functions */
+#define INVALID_DOMID ~0
+
/* If the result is ERROR_ABORTED, the domain may or may not exist
* (in a half-created state). *domid will be valid and will be the
- * domain id, or -1, as appropriate */
+ * domain id, or INVALID_DOMID, as appropriate */
int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config,
uint32_t *domid,
@@ -1773,7 +1773,7 @@ static void domcreate_complete(libxl__egc *egc,
libxl__domain_destroy(egc, &dcs->dds);
return;
}
- dcs->guest_domid = -1;
+ dcs->guest_domid = INVALID_DOMID;
}
dcs->callback(egc, dcs, rc, dcs->guest_domid);
}
@@ -121,7 +121,6 @@
#define STUBDOM_SPECIAL_CONSOLES 3
#define TAP_DEVICE_SUFFIX "-emu"
#define DOMID_XS_PATH "domid"
-#define INVALID_DOMID ~0
#define PVSHIM_BASENAME "xen-shim"
#define PVSHIM_CMDLINE "pv-shim console=xen,pv"
@@ -52,8 +52,6 @@
#define STR_SKIP_PREFIX( a, b ) \
( STR_HAS_PREFIX(a, b) ? ((a) += strlen(b), 1) : 0 )
-#define INVALID_DOMID ~0
-
#define LOG(_f, _a...) dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a)
/*