[libvirt] [PATCHv5 5/6] bhyve: Add console support for grub-bhyve bootloader

Roman Bogorodskiy bogorodskiy at gmail.com
Tue Oct 28 11:53:11 UTC 2014


  Conrad Meyer wrote:

> This enables booting interactive GRUB menus (e.g. install CDs) with
> libvirt-bhyve.
> 
> Caveat: A terminal other than the '--console' option to 'virsh start'
> (e.g. 'cu -l /dev/nmdm0B -s 115200') must be used to connect to
> grub-bhyve because the bhyve loader path is synchronous and must occur
> before the VM actually starts.

Could you please elaborate on that? It's not the obvious what's the
limitation... Without being able to connect using virsh console, it's
not very convenient for user to connect to the console (esp. if he runs
virsh over a remote libvirt).

> Changing the bhyveProcessStart logic around to accommodate '--console'
> for interactive loader use seems like a significant project and probably
> not worth it, if UEFI/BIOS support for bhyve is "coming soon."
> 
> Sponsored by:  EMC / Isilon storage division
> 
> Signed-off-by: Conrad Meyer <conrad.meyer at isilon.com>
> ---
>  src/bhyve/bhyve_command.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
> index 01f1795..07d209e 100644
> --- a/src/bhyve/bhyve_command.c
> +++ b/src/bhyve/bhyve_command.c
> @@ -468,6 +468,21 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
>      virCommandAddArgFormat(cmd, "%llu",
>                             VIR_DIV_UP(def->mem.max_balloon, 1024));
>  
> +    if (def->nserials > 0) {
> +        virDomainChrDefPtr chr;
> +
> +        chr = def->serials[0];
> +
> +        if (chr->source.type != VIR_DOMAIN_CHR_TYPE_NMDM) {
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                           _("only nmdm console types are supported"));
> +            return NULL;
> +        }
> +
> +        virCommandAddArg(cmd, "--cons-dev");

IMHO, one more thing worth to do is probe if the supplied grub-bhyve has
this '--cons-dev' argument (e.g. check if it's there in its --help
output). Otherwise, for users running an older grub-bhyve will get a
weird error that they will not know how to fix.

Other option is to check required version of grub-bhyve using autotools,
but I guess it's not good because users will have to rebuild libvirt if
they want to update bhyve-grub.

> +        virCommandAddArg(cmd, chr->source.data.file.path);
> +    }
> +
>      /* VM name */
>      virCommandAddArg(cmd, def->name);
>  
> -- 
> 1.9.3
> 

Roman Bogorodskiy




More information about the libvir-list mailing list