Change to use libxl__zalloc, where allocation failure is fatal.
Also remove a spurious semicolon from the helper macro.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
*evg_upd = evg_next;
libxl_event *ev = NEW_EVENT(egc, DOMAIN_DEATH, evg->domid);
- if (!ev) return;
libxl__event_occurred(egc, ev);
if (!evg->shutdown_reported &&
(got->flags & XEN_DOMINF_shutdown)) {
libxl_event *ev = NEW_EVENT(egc, DOMAIN_SHUTDOWN, got->domain);
- if (!ev) goto out;
LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, " shutdown reporting");
{
libxl_event *ev;
- ev = malloc(sizeof(*ev));
- if (!ev) {
- LIBXL__EVENT_DISASTER(egc, "allocate new event", errno, type);
- return NULL;
- }
-
- memset(ev, 0, sizeof(*ev));
+ ev = libxl__zalloc(0,sizeof(*ev));
ev->type = type;
ev->domid = domid;
uint32_t domid);
/* Convenience function.
* Allocates a new libxl_event, fills in domid and type.
- * If allocation fails, calls _disaster, and returns NULL. */
+ * Cannot fail. */
#define NEW_EVENT(egc, type, domid) \
- libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid));
+ libxl__event_new((egc), LIBXL_EVENT_TYPE_##type, (domid))
/* Convenience macro. */
/*