Message ID | 1474485630-24113-3-git-send-email-konrad.wilk@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 09/21/2016 08:20 PM, Konrad Rzeszutek Wilk wrote: > That way we can print out the header if we are sure the > hypervisor has been compiled with Xen Livepatching. > > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 7512a98..2de04c0 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -91,8 +91,6 @@ static int list_func(int argc, char *argv[]) return rc; } - fprintf(stdout," ID | status\n" - "----------------------------------------+------------\n"); do { done = 0; /* The memset is done to catch errors. */ @@ -106,6 +104,10 @@ static int list_func(int argc, char *argv[]) idx, left, errno, strerror(errno)); break; } + if ( !idx ) + fprintf(stdout," ID | status\n" + "----------------------------------------+------------\n"); + for ( i = 0; i < done; i++ ) { unsigned int j;
That way we can print out the header if we are sure the hypervisor has been compiled with Xen Livepatching. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- tools/misc/xen-livepatch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)