Skip to contentSkip to conversation

be more specific in -mem-path error messages

Qemu-devel Michael Tokarev 2 participants 3 messages Mar 16, 2010 – Mar 27, 2010

lore
Share & tools
lore
#0 lore raw

The error message qemu gives when hugetlbfs is not accessible is cryptic at best:

mkstemp: Permission denied

Make it a bit more specific instead:

unable to create backing store for hugepages: Permission denied

Thanks!

/mjt

exec.c +1 -1
index 891e0ee..985bdde 100644
@@ -2569,5 +2569,5 @@ static void *file_ram_alloc(ram_addr_t memory, const char *path)
     fd = mkstemp(filename);
     if (fd < 0) {
-	perror("mkstemp");
+	perror("unable to create backing store for hugepages");
 	free(filename);
 	return NULL;
#1 lore raw
Quoted 10 lines · Michael Tokarev

The error message qemu gives when hugetlbfs is not accessible is cryptic at best:

mkstemp: Permission denied

Make it a bit more specific instead:

unable to create backing store for hugepages: Permission denied

Thanks!

It looks good, but needs a Signed-off-by: line.

Quoted 16 lines

/mjt

exec.c +1 -1
index 891e0ee..985bdde 100644
@@ -2569,5 +2569,5 @@ static void *file_ram_alloc(ram_addr_t memory, const char *path)
     fd = mkstemp(filename);
     if (fd < 0) {
-	perror("mkstemp");
+	perror("unable to create backing store for hugepages");
 	free(filename);
 	return NULL;
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#2 lore raw
Quoted 6 lines · Aurelien Jarno
Quoted 5 lines · Michael Tokarev

The error message qemu gives when hugetlbfs is not accessible is cryptic at best:

mkstemp: Permission denied

Quoted 7 lines
Quoted 5 lines

Make it a bit more specific instead:

unable to create backing store for hugepages: Permission denied

Thanks!

It looks good, but needs a Signed-off-by: line.

Are we now requiring such S-o-b lines even for such trivial stuff? Oh well..... Ok, here we go, with another perror() case converted to be a bit less cryptic. Thanks!

exec.c +2 -2
index fcffb0f..90032a5 100644
@@ -2438,7 +2438,7 @@ static long gethugepagesize(const char *path)
     } while (ret != 0 && errno == EINTR);
 
     if (ret != 0) {
-	    perror("statfs");
+	    perror(path);
 	    return 0;
     }
 
@@ -2483,7 +2483,7 @@ static void *file_ram_alloc(ram_addr_t memory, const char *path)
 
     fd = mkstemp(filename);
     if (fd < 0) {
-	perror("mkstemp");
+	perror("unable to create backing store for hugepages");
 	free(filename);
 	return NULL;
     }