[libvirt] Building on Solaris 11 Express

Ruben Kerkhof ruben at rubenkerkhof.com
Fri Jun 3 15:30:29 UTC 2011


On Fri, Jun 3, 2011 at 16:16, Eric Blake <eblake at redhat.com> wrote:
> On 06/03/2011 01:11 AM, Matthias Bolte wrote:
>> That might be the problem. I don't have a Solaris at hand right now to
>> test it so here is a speculative patch for this.
>
> And while I have access to a Solaris machine, I don't have enough
> pre-requisites built on it in order to build libvirt, so I likewise am
> not in a position to test.  Ruben, it would be nice to have your ACK.
>
>> qemudSetupPrivs() drops privileges on Solaris making geteuid()
>> return non-zero later on when qemudInitialize() tries to detect
>> privileged mode.
>>
>> Detect privileged mode before calling qemudSetupPrivs() to fix
>> this.
>
> In principle, this sounds like the right solution.
>
>> @@ -3300,8 +3302,12 @@ int main(int argc, char **argv) {
>>       * getuid/geteuid() == 0, for privilege level checks.
>>       * It must all use the flag 'server->privileged'
>>       * which is also passed into all libvirt stateful
>> -     * drivers
>> +     * drivers.
>> +     * Detect geteuid() == 0 before calling qemudSetupPrivs()
>> +     * because that might drop privileges.
>>       */
>> +    privileged = geteuid() == 0 ? 1 : 0;
>
> Identical, and simpler, to just write:
>
> privileged = !geteuid();
>
> ACK by code inspection, but I'd prefer actual build test before
> committing this.  It qualifies for inclusion in 0.9.2 if we act fast
> enough, but I don't think it is a show-stopper if we miss out on Solaris
> builds for this release.
>
> --
> Eric Blake   eblake at redhat.com    +1-801-349-2682
> Libvirt virtualization library http://libvirt.org

It builds, and starts, but nothing more than that:

root at openindiana:~# virsh list
error: Failed to reconnect to the hypervisor
error: no valid connection
error: no connection driver available for No connection for URI (null)

But hey, it's a start :-)

Kind regards,

Ruben




More information about the libvir-list mailing list