Patchwork [trivial,one-liner] be more specific in -mem-path error messages

login
register
mail settings
Submitter Michael Tokarev
Date March 16, 2010, 8:01 a.m.
Message ID <4B9F3AEA.8010408@msgid.tls.msk.ru>
Download mbox | patch
Permalink /patch/47812/
State New
Headers show

Comments

Michael Tokarev - March 16, 2010, 8:01 a.m.
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
Aurelien Jarno - March 27, 2010, 12:33 p.m.
On Tue, Mar 16, 2010 at 11:01:46AM +0300, Michael Tokarev wrote:
> 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.

> /mjt
> 
> diff --git a/exec.c b/exec.c
> index 891e0ee..985bdde 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -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;
> 
> 
>

Patch

diff --git a/exec.c b/exec.c
index 891e0ee..985bdde 100644
--- a/exec.c
+++ b/exec.c
@@ -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;