Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-14 Thread Paul Brook
> > The only way to handle this rebustly is to pre-allocate all the memory > > we're ever going to need[1]. I don't see that happening. > > FWIW, users can already opt-in to pre-allocation if running KVM enabled > QEMU > >-mem-path /dev/shm -mem-prealloc (or /dev/hugepages more usefully)

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-14 Thread Anthony Liguori
On 02/13/2012 08:04 AM, Markus Armbruster wrote: Stefan Weil writes: Am 10.02.2012 16:13, schrieb Zhi Yong Wu: On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange wrote: On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- oslib

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-14 Thread Daniel P. Berrange
On Tue, Feb 14, 2012 at 12:42:58PM +, Paul Brook wrote: > > > abort can create core dumps or start a debugger which is > > > useful for me and maybe other developers, too. > > > > I consider abort() on OOM somewhat eccentric. abort() is for > > programming errors. Resource shortage is an env

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-14 Thread Anthony Liguori
On 02/13/2012 05:16 AM, Stefan Hajnoczi wrote: On Mon, Feb 13, 2012 at 6:29 AM, Stefan Weil wrote: Allocating RAM for the emulated machine is perhaps the only scenario where a core dump is indeed not reasonable. In most other cases, out-of-memory is an indication of a QEMU internal problem, so

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-14 Thread Anthony Liguori
On 02/13/2012 12:29 AM, Stefan Weil wrote: Am 13.02.2012 03:37, schrieb Zhi Yong Wu: On Fri, Feb 10, 2012 at 11:53 PM, Stefan Weil wrote: Am 10.02.2012 16:13, schrieb Zhi Yong Wu: On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange wrote: On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yon

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-14 Thread Paul Brook
> > abort can create core dumps or start a debugger which is > > useful for me and maybe other developers, too. > > I consider abort() on OOM somewhat eccentric. abort() is for > programming errors. Resource shortage is an environmental error that is > sometimes (but not always) caused by a prog

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-13 Thread Peter Maydell
On 13 February 2012 14:04, Markus Armbruster wrote: > I consider abort() on OOM somewhat eccentric.  abort() is for > programming errors.  Resource shortage is an environmental error that is > sometimes (but not always) caused by a programming error. > > I'd rather inconvenience programmers (by ma

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-13 Thread Markus Armbruster
Stefan Weil writes: > Am 10.02.2012 16:13, schrieb Zhi Yong Wu: >> On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange >> wrote: >>> On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- oslib-posix.c |4 ++-

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-13 Thread Stefan Hajnoczi
On Mon, Feb 13, 2012 at 6:29 AM, Stefan Weil wrote: > Am 13.02.2012 03:37, schrieb Zhi Yong Wu: > >> On Fri, Feb 10, 2012 at 11:53 PM, Stefan Weil wrote: >>> >>> Am 10.02.2012 16:13, schrieb Zhi Yong Wu: >>> On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange wrote: > > >

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-13 Thread Daniel P. Berrange
On Fri, Feb 10, 2012 at 11:35:11AM -0700, Eric Blake wrote: > On 02/10/2012 07:41 AM, Daniel P. Berrange wrote: > > >> @@ -80,7 +80,7 @@ void *qemu_oom_check(void *ptr) > >> { > >> if (ptr == NULL) { > >> fprintf(stderr, "Failed to allocate memory: %s\n", > >> strerror(errno)); > >

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-12 Thread Stefan Weil
Am 13.02.2012 03:37, schrieb Zhi Yong Wu: On Fri, Feb 10, 2012 at 11:53 PM, Stefan Weil wrote: Am 10.02.2012 16:13, schrieb Zhi Yong Wu: On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange wrote: On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: From: Zhi Yong Wu Signed-off

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-12 Thread Zhi Yong Wu
On Sat, Feb 11, 2012 at 2:35 AM, Eric Blake wrote: > On 02/10/2012 07:41 AM, Daniel P. Berrange wrote: > >>> @@ -80,7 +80,7 @@ void *qemu_oom_check(void *ptr) >>>  { >>>      if (ptr == NULL) { >>>          fprintf(stderr, "Failed to allocate memory: %s\n", >>> strerror(errno)); >>> -        abor

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-12 Thread Zhi Yong Wu
On Fri, Feb 10, 2012 at 11:53 PM, Stefan Weil wrote: > Am 10.02.2012 16:13, schrieb Zhi Yong Wu: > >> On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange >> wrote: >>> >>> On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: From: Zhi Yong Wu Signed-off-by: Zhi Yong

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-10 Thread Eric Blake
On 02/10/2012 07:41 AM, Daniel P. Berrange wrote: >> @@ -80,7 +80,7 @@ void *qemu_oom_check(void *ptr) >> { >> if (ptr == NULL) { >> fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); >> -abort(); >> +exit(EXIT_FAILURE); > > exit() will call any at

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-10 Thread Stefan Weil
Am 10.02.2012 16:13, schrieb Zhi Yong Wu: On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange wrote: On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- oslib-posix.c |4 ++-- oslib-win32.c |4 ++-- 2 files changed, 4 inser

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-10 Thread Zhi Yong Wu
On Fri, Feb 10, 2012 at 10:41 PM, Daniel P. Berrange wrote: > On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: >> From: Zhi Yong Wu >> >> Signed-off-by: Zhi Yong Wu >> --- >>  oslib-posix.c |    4 ++-- >>  oslib-win32.c |    4 ++-- >>  2 files changed, 4 insertions(+), 4 deletions(-)

Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-10 Thread Daniel P. Berrange
On Fri, Feb 10, 2012 at 10:34:13PM +0800, Zhi Yong Wu wrote: > From: Zhi Yong Wu > > Signed-off-by: Zhi Yong Wu > --- > oslib-posix.c |4 ++-- > oslib-win32.c |4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/oslib-posix.c b/oslib-posix.c > index b6a3c7f..f97

[Qemu-devel] [PATCH] oslib: make error handling more reasonable

2012-02-10 Thread Zhi Yong Wu
From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- oslib-posix.c |4 ++-- oslib-win32.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/oslib-posix.c b/oslib-posix.c index b6a3c7f..f978d56 100644 --- a/oslib-posix.c +++ b/oslib-posix.c @@ -80,7 +80,7 @@ void *qemu_