Re: [libvirt] [PATCH 2/3]: Log argv passed to virExec and virRun

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

 



Daniel P. Berrange wrote:
> On Thu, Oct 30, 2008 at 02:06:20PM -0400, Cole Robinson wrote:
>   
>> The attached patch logs the the argv's passed to
>> the virExec and virRun functions. There's a bit of
>> trickery here: since virRun is just a wrapper for
>> virExec, we don't want the argv string to be logged
>> twice. 
>>
>> I addressed this by renaming virExec to __virExec,
>> and keeping the original function name to simply
>> debug the argv and then hand off control. This
>> means anytime virExec is explictly called, the
>> argv will be logged, but if functions wish to by
>> pass that they can just call __virExec (which is
>> what virRun does.)
>>     
>
> I'm a little confused about why we can't just put the logging
> calling directly in the existing virExec() function. Since the
> first thing virRun() does is to call virExec() this would 
> seem to be sufficient without need of a wrapper.
>
> Daniel
>   

Two small benefits of the way this patch does it:

- We can tell by the debug output whether the argv
  is coming from virRun or from virExec called
  explicitly.

- We want the argv string available in virRun for
  error reporting. The patch allows us to avoid
  converting the argv to string twice.

I can rework the patch if you'd like, the above
points aren't deal breakers.

Thanks,
Cole

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