Re: [libvirt] [PATCH 1/2] tests: Fake host capabilities properly

2011-02-15 Thread Serge E. Hallyn
Quoting Jiri Denemark (jdene...@redhat.com):
> Since we fake host CPU we should also fake host arch instead of taking
> the real architecture tests are running on.
> ---
>  tests/testutilsqemu.c |8 +---
>  1 files changed, 5 insertions(+), 3 deletions(-)

Tested-by: Serge Hallyn 

Thanks, Jiri!

> 
> diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
> index bfac307..fbbb6c1 100644
> --- a/tests/testutilsqemu.c
> +++ b/tests/testutilsqemu.c
> @@ -95,7 +95,7 @@ virCapsPtr testQemuCapsInit(void) {
>  };
>  
>  uname (&utsname);
> -if ((caps = virCapabilitiesNew(utsname.machine,
> +if ((caps = virCapabilitiesNew(host_cpu.arch,
> 0, 0)) == NULL)
>  return NULL;
>  
> @@ -107,7 +107,8 @@ virCapsPtr testQemuCapsInit(void) {
>  
>  if ((guest = virCapabilitiesAddGuest(caps, "hvm", "i686", 32,
>   "/usr/bin/qemu", NULL,
> - nmachines, machines)) == NULL)
> + nmachines, machines)) == NULL ||
> +!virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
>  goto cleanup;
>  machines = NULL;
>  
> @@ -124,7 +125,8 @@ virCapsPtr testQemuCapsInit(void) {
>  
>  if ((guest = virCapabilitiesAddGuest(caps, "hvm", "x86_64", 64,
>   "/usr/bin/qemu-system-x86_64", NULL,
> - nmachines, machines)) == NULL)
> + nmachines, machines)) == NULL ||
> +!virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
>  goto cleanup;
>  machines = NULL;
>  
> -- 
> 1.7.4.1
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

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


Re: [libvirt] [PATCH 1/2] tests: Fake host capabilities properly

2011-02-15 Thread Eric Blake
On 02/15/2011 07:53 AM, Jiri Denemark wrote:
> Since we fake host CPU we should also fake host arch instead of taking
> the real architecture tests are running on.
> ---
>  tests/testutilsqemu.c |8 +---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
> index bfac307..fbbb6c1 100644
> --- a/tests/testutilsqemu.c
> +++ b/tests/testutilsqemu.c
> @@ -95,7 +95,7 @@ virCapsPtr testQemuCapsInit(void) {
>  };
>  
>  uname (&utsname);
> -if ((caps = virCapabilitiesNew(utsname.machine,
> +if ((caps = virCapabilitiesNew(host_cpu.arch,

Since this was the last use of utsname in the test file (a good thing!),
the uname() call, the struct utsname declaration, and the #include
 in this file are all now dead code.

ACK with that additional cleanup.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list