qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends


From: malc
Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends
Date: Sun, 6 Dec 2009 21:41:20 +0300 (MSK)

On Sun, 6 Dec 2009, Avi Kivity wrote:

> On 12/06/2009 08:12 PM, malc wrote:
> > 
> > > Init is pretty easy to handle.  I'm worried about runtime where you can't
> > > report an error to the guest.  Real hardware doesn't oom.
> > >      
> > Here, i do agree, but mostly because most of the users of allocation
> > functions just themselves returned NULL or -1 or whatever and never
> > really bothered to report anything, so the addition of OOM check that
> > you've added made the code less cluttered.
> >    
> 
> My point is that it would take a major rework, and would probably involve
> removing the allocations instead of handling any errors.  For example, a scsi
> device would tell the block device the upper bound of aiocbs it could possibly
> issue, and the maximum number of sg elements in a request, and qcow2 (or any
> other backing format driver) would preallocate enough resources to satisfy the
> worst case.  And we still can't handle a syscall returning ENOMEM.
> 

Sure. My point is that sometimes failure to allocate is due to bugs,
invalid input etc, and conversion to OOM aborts en masse, might have
not been the best possible route to take, but most likely it was better
than doing nothing.

-- 
mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]