Revision d7234f4d hw/xen_domainbuild.c

b/hw/xen_domainbuild.c
211 211
}
212 212

  
213 213
/* normal cleanup */
214
static void xen_domain_cleanup(void)
214
static void xen_domain_cleanup(Notifier *notifier)
215 215
{
216 216
    char *dom;
217 217

  
......
232 232
    unsigned int xenstore_port = 0, console_port = 0;
233 233
    unsigned long xenstore_mfn = 0, console_mfn = 0;
234 234
    int rc;
235
    static Notifier exit_notifier = { .notify = xen_domain_cleanup };
235 236

  
236 237
    memcpy(uuid, qemu_uuid, sizeof(uuid));
237 238
    rc = xc_domain_create(xen_xc, ssidref, uuid, flags, &xen_domid);
......
240 241
        goto err;
241 242
    }
242 243
    qemu_log("xen: created domain %d\n", xen_domid);
243
    atexit(xen_domain_cleanup);
244
    exit_notifier_add(&exit_notifier);
244 245
    if (xen_domain_watcher() == -1) {
245 246
        goto err;
246 247
    }

Also available in: Unified diff