[virt-tools-list] FreeBSD support for virt-what

Richard W.M. Jones rjones at redhat.com
Mon Jan 15 10:35:45 UTC 2018


On Tue, Oct 31, 2017 at 09:04:01AM -0600, Brad Davis wrote:
> Hello,
> 
> I have patched the virt-what script to work on FreeBSD a bit better.
> Please take a look.

I don't monitor this list often so I missed this patch.  However I
just checked upstream virt-what against your patch and I hope that
everything has been fixed upstream.  If there are still problems on
FreeBSD and/or without bash then let me know.

Rich.

> Regards,
> Brad Davis
> 
> root@:~/temp/virt-what-1.18 # diff -u virt-what.orig virt-what
> --- virt-what.orig      2017-10-31 07:57:22.752442000 +0000
> +++ virt-what   2017-10-31 08:03:40.894197000 +0000
> @@ -308,7 +308,7 @@
>          # option, since /proc/cpuinfo will not contain the QEMU
>          # string. QEMU 2.10 added a new CPUID leaf, so this
>          # problem only triggered for older QEMU
> -        if grep -q 'QEMU' "${root}/proc/cpuinfo"; then
> +        if have_cpuinfo && grep -q 'QEMU' "${root}/proc/cpuinfo"; then
>              echo qemu
>          fi
>      fi
> @@ -360,20 +360,20 @@
>  fi
>  
>  # Check for LDoms
> -if [[ "$arch" == sparc* && -e ${root}/dev/mdesc ]]; then
> +if [ "$arch" = sparc* -a -e ${root}/dev/mdesc ]; then
>      echo ldoms
> -    if [[ -d ${root}/sys/class/vlds/ctrl && \
> -             -d ${root}/sys/class/vlds/sp ]]; then
> +    if [ -d ${root}/sys/class/vlds/ctrl -a \
> +             -d ${root}/sys/class/vlds/sp ]; then
>          echo ldoms-control
>      else
>          echo ldoms-guest
>      fi
>      MDPROP="${root}/usr/lib/ldoms/mdprop.py"
> -    if [[ -x ${MDPROP} ]]; then
> -        if [[ -n $($MDPROP -v iodevice device-type=pciex) ]]; then
> +    if [ -x ${MDPROP} ]; then
> +        if [ -n $($MDPROP -v iodevice device-type=pciex) ]; then
>              echo ldoms-root
>              echo ldoms-io
> -        elif [[ -n $($MDPROP -v iov-device vf-id=0) ]]; then
> +        elif [ -n $($MDPROP -v iov-device vf-id=0) ]; then
>              echo ldoms-io
>          fi
>      fi
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the virt-tools-list mailing list