Re: [PATCH] qemuConnectGetDomainCapabilities: Report error on unknown arch

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

 



On Thu, Jul 24, 2014 at 04:45:20PM +0200, Michal Privoznik wrote:
> If user hasn't provided any @emulatorbin, the qemuCaps are
> searched by @arch provided (which in fact can be guessed from the
> host). However, there's no guarantee that the qemu binary for
> @arch will exist.  Therefore qemu capabilities may be nonexistent
> too. If that's the case, we should throw an error message prior
> jumping onto 'cleanup' label as the helper lookup function
> remains silent on no search result.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
> 
> Notes:
>     This would qualify to be pushed under trivial rule, but maybe
>     somebody has a better idea for the error message (or its code).
> 
>  src/qemu/qemu_driver.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 06d3f53..8e01965 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -16990,8 +16990,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
>          }
>      } else {
>          if (!(qemuCaps = virQEMUCapsCacheLookupByArch(driver->qemuCapsCache,
> -                                                      arch)))
> +                                                      arch))) {
> +            virReportError(VIR_ERR_INVALID_ARG,
> +                           _("unable to find any emulator to serve '%s' "
> +                             "architecture"), virArchToString(arch));
>              goto cleanup;
> +        }
>  
>          emulatorbin = virQEMUCapsGetBinary(qemuCaps);
>      }

ACK, seems good enough for me.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]