Skip to contentSkip to conversation

xen-hptool small cleanups

PATCH In review Jason Andryuk 3 participants 7 messages Apr 23, 2025 – Apr 24, 2025

lore
Share & tools
lore
#0 lore raw

cover xen-hptool small cleanups

Two small cleanups for xen-hptool.

Jason Andryuk (2):
tools/xen-hptool: Add missing newlines
tools/xen-hptool: Replace hard tabs

 tools/misc/xen-hptool.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/2 tools/xen-hptool: Add missing newlines

Add some missing newlines to error messages.

Fixes 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
---
 tools/misc/xen-hptool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/misc/xen-hptool.c +2 -2
index 6d6aec8bad..d850404e31 100644
@@ -51,7 +51,7 @@ static int hp_mem_online_func(int argc, char *argv[])
     ret = xc_mark_page_online(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Onlining page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Onlining page mfn %lx failed, error %x\n", mfn, errno);
     else if (status & (PG_ONLINE_FAILED |PG_ONLINE_BROKEN)) {
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
@@ -82,7 +82,7 @@ static int hp_mem_query_func(int argc, char *argv[])
     ret = xc_query_page_offline_status(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Querying page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
 		printf("Memory Status %x: [", status);
Signature · 1 line
2.49.0
Reviewed-by Denis Mukhin on v1 1/2
#2 lore raw

Re: [PATCH 1/2] tools/xen-hptool: Add missing newlines

Quoted 4 lines · Jason Andryuk

Add some missing newlines to error messages.

Fixes 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
Quoted 30 lines
---
 tools/misc/xen-hptool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/misc/xen-hptool.c +2 -3
index 6d6aec8bad..d850404e31 100644
@@ -51,7 +51,7 @@ static int hp_mem_online_func(int argc, char *argv[])
     ret = xc_mark_page_online(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Onlining page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Onlining page mfn %lx failed, error %x\n", mfn, errno);
     else if (status & (PG_ONLINE_FAILED |PG_ONLINE_BROKEN)) {
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
@@ -82,7 +82,7 @@ static int hp_mem_query_func(int argc, char *argv[])
     ret = xc_query_page_offline_status(xch, mfn, mfn, &status);
 
     if (ret < 0)
-        fprintf(stderr, "Querying page mfn %lx failed, error %x", mfn, errno);
+        fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
 		printf("Memory Status %x: [", status);
--

2.49.0

#4 lore raw

PATCH 2/2 tools/xen-hptool: Replace hard tabs

In reply to Jason Andryuk

With a tab stop of 8, the alignment is off. Replace the hard tabs with spaces to match the file.

Fixes 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
---
 tools/misc/xen-hptool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/misc/xen-hptool.c +3 -3
index d850404e31..590810b6eb 100644
@@ -56,7 +56,7 @@ static int hp_mem_online_func(int argc, char *argv[])
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
         ret = -1;
-	}
+    }
     else if (status & PG_ONLINE_ONLINED)
         printf("Memory mfn %lx onlined successfully\n", mfn);
     else
@@ -85,14 +85,14 @@ static int hp_mem_query_func(int argc, char *argv[])
         fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
-		printf("Memory Status %x: [", status);
+        printf("Memory Status %x: [", status);
         if ( status & PG_OFFLINE_STATUS_OFFLINE_PENDING)
             printf(" PAGE_OFFLINE_PENDING ");
         if ( status & PG_OFFLINE_STATUS_BROKEN )
             printf(" PAGE_BROKEND  ");
         if ( status & PG_OFFLINE_STATUS_OFFLINED )
             printf(" PAGE_OFFLINED ");
-		else
+        else
             printf(" PAGE_ONLINED ");
         printf("]\n");
     }
Signature · 1 line
2.49.0
Reviewed-by Denis Mukhin on v1 2/2
#5 lore raw

Re: [PATCH 2/2] tools/xen-hptool: Replace hard tabs

Quoted 5 lines · Jason Andryuk

With a tab stop of 8, the alignment is off. Replace the hard tabs with spaces to match the file.

Fixes 284d5633be37 ("Tools: add online/offline hotplug user interfaces")
Quoted 38 lines
---
 tools/misc/xen-hptool.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/misc/xen-hptool.c +3 -4
index d850404e31..590810b6eb 100644
@@ -56,7 +56,7 @@ static int hp_mem_online_func(int argc, char *argv[])
         fprintf(stderr, "Onlining page mfn %lx is broken, "
                         "Memory online failed\n", mfn);
         ret = -1;
-	}
+    }
     else if (status & PG_ONLINE_ONLINED)
         printf("Memory mfn %lx onlined successfully\n", mfn);
     else
@@ -85,14 +85,14 @@ static int hp_mem_query_func(int argc, char *argv[])
         fprintf(stderr, "Querying page mfn %lx failed, error %x\n", mfn, errno);
     else
     {
-		printf("Memory Status %x: [", status);
+        printf("Memory Status %x: [", status);
         if ( status & PG_OFFLINE_STATUS_OFFLINE_PENDING)
             printf(" PAGE_OFFLINE_PENDING ");
         if ( status & PG_OFFLINE_STATUS_BROKEN )
             printf(" PAGE_BROKEND  ");
         if ( status & PG_OFFLINE_STATUS_OFFLINED )
             printf(" PAGE_OFFLINED ");
-		else
+        else
             printf(" PAGE_ONLINED ");
         printf("]\n");
     }
--

2.49.0