Re: [PATCH 2/2] tests: Add tests for CPU selection in qemu driver

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

 



On 12/01/2010 07:56 AM, Jiri Denemark wrote:
> ---
> diff --git a/tests/qemuxml2argvdata/qemu.sh b/tests/qemuxml2argvdata/qemu.sh
> new file mode 100755
> index 0000000..6d5d354
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemu.sh
> @@ -0,0 +1,64 @@
> +#! /bin/sh

> +real_qemu()
> +{
> +    if test x$qemu != x; then
> +        exec $qemu "$@"
> +    else
> +        return 1
> +    fi
> +}
> +
> +faked_machine()
> +{
> +    echo "pc"
> +}

> +case $* in
> +"-M ?")
> +    faked_machine
> +    ;;
> +"-cpu ?")
> +    faked_cpu
> +    ;;
> +*)
> +    real_qemu "$@"
> +    ;;
> +esac

Nice - you can control the output of possible machines and cpus, even if
a qemu upgrade gains support for more names later.

> @@ -223,6 +226,10 @@ mymain(int argc, char **argv)
>      if (!abs_srcdir)
>          abs_srcdir = getcwd(cwd, sizeof(cwd));
>  
> +    abs_top_srcdir = getenv("abs_top_srcdir");
> +    if (!abs_top_srcdir)
> +        abs_top_srcdir = "..";

Not really absolute, is it?  But it matches other tests, and does the
job, so no need to change it.

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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