On 02/12/2013 01:15 PM, Laine Stump wrote:
Setting the uid/gid of the child process was the only thing done by
the hook function in this case, and that can now be done more simply
with virCommandSetUID/GID.
---
Change from V1: rebased.
static virCommandPtr
virQEMUCapsProbeCommand(const char *qemu,
virQEMUCapsPtr qemuCaps,
- virQEMUCapsHookDataPtr hookData)
+ uid_t runUid, gid_t runGid)
{
virCommandPtr cmd = virCommandNew(qemu);
@@ -322,7 +295,8 @@ virQEMUCapsProbeCommand(const char *qemu,
virCommandAddEnvPassCommon(cmd);
virCommandClearCaps(cmd);
- virCommandSetPreExecHook(cmd, virQEMUCapsHook, hookData);
+ virCommandSetGID(cmd, runGid);
+ virCommandSetUID(cmd, runUid);
Back to my argument in 4/15 - it looks funny to see
virQEMUCapsProbeCommand taking two arguments, just to call into two
virCommandSet* calls with one argument, just to be combined back into
virSetUIDGID with two arguments. But again, I'm not going to insist on
a respin for a cosmetic difference.
ACK still stands.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org