Re: [PATCH v1 11/12] bhyve: command: enable booting from hostdevs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 24, 2020 at 01:46:23AM -0500, Ryan Moeller wrote:
> It is possible to boot from virtio-scsi with UEFI-devel, for example.
> 
> Signed-off-by: Ryan Moeller <ryan@xxxxxxxxxxxxx>
> ---
>  src/bhyve/bhyve_command.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
> index 9f4030f6a3..048c26733a 100644
> --- a/src/bhyve/bhyve_command.c
> +++ b/src/bhyve/bhyve_command.c
> @@ -993,11 +993,8 @@ virBhyveGetBootDisk(virDomainDefPtr def)
>      virDomainDiskDefPtr match = NULL;
>      int boot_dev = -1;
>  
> -    if (def->ndisks < 1) {
> -        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> -                       _("Domain should have at least one disk defined"));
> +    if (def->ndisks == 0)
>          return NULL;
> -    }

This doesn't look like correct logic to me. Most code paths
which return NULL will report an error, so having one code
path which doesn't is pretty unusual practice.

Also the caller of this method  still assumes a NULL return
value indicates an error AFAICS.

>  
>      if (def->os.nBootDevs > 1) {
>          virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> -- 
> 2.24.1
> 
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux