]> xenbits.xensource.com Git - xen.git/commitdiff
xen-livepatch: Print the header _after_ the first livepatch hypercall
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 21 Sep 2016 12:53:38 +0000 (08:53 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 23 Sep 2016 16:39:46 +0000 (12:39 -0400)
That way we can print out the header if we are sure the
hypervisor has been compiled with Xen Livepatching.

Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
tools/misc/xen-livepatch.c

index 7512a98d2301d164d527802d8561d588ffb2f88e..2de04c0a16bc3c78f98c53015d83ede7be0bdb4b 100644 (file)
@@ -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;