On Mon, 2015-03-30 at 09:28 +0800, Chen, Tiejun wrote: > Sounds it should be a legacy fix to qemu-xen-tranditional :) So lets do > it now, > > @@ -326,6 +326,10 @@ static char ** > libxl__build_device_model_args_old(libxl__gc *gc, > } > if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { > flexarray_append(dm_args, "-gfx_passthru"); > + if (b_info->u.hvm.gfx_passthru_kind > > + LIBXL_GFX_PASSTHRU_KIND_IGD) > + LOG(ERROR, "unsupported device type for > \"gfx_passthru\".\n"); > + return NULL;
I'd rather not encode any ordering constraints if we don't have to. I think this is preferable: if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { switch (b_info->u.hvm.gfx_passthru_kind) { case LIBXL_GFX_PASSTHRU_KIND_DEFAULT: case LIBXL_GFX_PASSTHRU_KIND_IGD: flexarray_append(dm_args, "-gfx_passthru"); break; default: LOG(ERROR, "unsupported gfx_passthru_kind.\n"); return NULL; } } (notice that the error message above doesn't refer to the xl specific option naming). Ian.