}
case LIBXL_DOMAIN_TYPE_PV:
{
- int need_qemu = 0;
libxl__device_console console;
libxl__device device;
init_console_info(gc, &console, 0);
- need_qemu = libxl__need_xenpv_qemu(gc, 1, &console,
+ ret = libxl__need_xenpv_qemu(gc, 1, &console,
d_config->num_vfbs, d_config->vfbs,
d_config->num_disks, &d_config->disks[0],
d_config->num_channels, &d_config->channels[0]);
+ if (ret < 0)
+ goto error_out;
console.backend_domid = state->console_domid;
libxl__device_console_add(gc, domid, &console, state, &device);
libxl__device_console_dispose(&console);
- if (need_qemu) {
+ if (ret) {
dcs->dmss.dm.guest_domid = domid;
libxl__spawn_local_dm(egc, &dcs->dmss.dm);
return;
GCSPRINTF("/local/domain/%d/image/device-model-pid", domid));
}
+/* Return 0 if no dm needed, 1 if needed and <0 if error. */
int libxl__need_xenpv_qemu(libxl__gc *gc,
int nr_consoles, libxl__device_console *consoles,
int nr_vfbs, libxl_device_vfb *vfbs,