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

Re: [libvirt] [PATCH 3/3]: Read cmd stdout + stderr in virRun

Cole Robinson <crobinso redhat com> wrote:
> The attached patch is my second cut at reading
> stdout and stderr of the command virRun kicks
> off. There is no hard limit to the amount of
> data we read now, and we use a poll loop to
> avoid any possible full buffer issues.
> If stdout or stderr had any content, we DEBUG
> it, and if the command appears to fail we
> return stderr in the error message. So now,
> trying to stop a logical pool with active
> volumes will return:
> $ sudo virsh pool-destroy vgdata
> libvir: error : internal error '/sbin/vgchange -an vgdata' exited with non-zero status 5 and signal 0:   Can't deactivate volume group "vgdata" with 2 open logical volume(s)
> error: Failed to destroy pool vgdata
> Thanks,
> Cole
> commit af7d94392bc89fd0645514cd13a2186ca5224dfc
> Author: Cole Robinson <crobinso redhat com>
> Date:   Thu Oct 30 13:46:06 2008 -0400
>     Capture command stdout and stderr in virRun
> diff --git a/src/util.c b/src/util.c
> index e59e25c..8d624b2 100644
> --- a/src/util.c
> +++ b/src/util.c
> @@ -33,6 +33,9 @@
>  #include <errno.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>
> +#include <sys/poll.h>
> +#endif

Hi Cole,
This looks fine to me.
One minor suggestion:

You can replace the above 3 lines with just

#include <poll.h>

<poll.h> is POSIX-specified, and guaranteed to be usable,
since we're now using gnulib's "poll" module.

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