b_info->shadow_memkb = 4 * (256 * libxl_bitmap_count_set(&b_info->avail_vcpus) +
2 * (b_info->max_memkb / 1024));
} else {
- if (VIR_STRDUP(b_info->u.pv.bootloader, def->os.bootloader) < 0)
- goto error;
+ /*
+ * For compatibility with the legacy xen toolstack, default to pygrub
+ * if bootloader is not specified AND direct kernel boot is not specified.
+ */
+ if (def->os.bootloader) {
+ if (VIR_STRDUP(b_info->u.pv.bootloader, def->os.bootloader) < 0)
+ goto error;
+ } else if (def->os.kernel == NULL) {
+ if (VIR_STRDUP(b_info->u.pv.bootloader, LIBXL_BOOTLOADER_PATH) < 0)
+ goto error;
+ }
if (def->os.bootloaderArgs) {
if (!(b_info->u.pv.bootloader_args =
virStringSplit(def->os.bootloaderArgs, " \t\n", 0)))
# define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl"
# define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
+# define LIBXL_BOOTLOADER_PATH BINDIR "/pygrub"
typedef struct _libxlDriverPrivate libxlDriverPrivate;