[libvirt-users] caps->nguests == 0?

Zhihua Che zhihua.che at gmail.com
Wed Jun 20 03:03:10 UTC 2012


2012/6/20 Eric Blake <eblake at redhat.com>:
> On 06/19/2012 03:20 AM, Zhihua Che wrote:
>
>> First, I'm sorry I forgot to mention that I installed my
>> qemu-system-x86_64 in a non-default path, that is, NOT in /usr/bin,
>> /usr/local/bin etc.
>> In this case, if I started up libvirtd with sudo, qemuCapsInitGuest
>> failed to add hvm guest os type to driver->capabilities because it
>> can't find qemu-system-x86_64 by searching environmental variable
>> PATH!.
>>
>> But, the most confusing thing happened here. I've added the
>> qemu-system-x86_64 in PATH by editing the /etc/bash.bashrc. Why can't
>> it still find the qemu?. I found in
>> qemuCapsInitGuest->virFindFileInPath(info->binary) that the call to
>> getenv("PATH") didn't return the path I added myself!
>
> Remember, 'sudo' sanitizes PATH.  Just because you added the directory
> to _your_ PATH, under your uid, does not mean that the sanitized PATH
> used by sudo and user root is the same, unless you take explicit actions
> to set PATH as part of your sudo environment setup.
>
> --

Yes, I found this issue. Thanks




More information about the libvirt-users mailing list