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: Ian Molton
Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends
Date: Mon, 07 Dec 2009 09:39:27 +0000
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Jamie Lokier wrote:

> If the system as a whole runs out of memory so that no-overcommit
> malloc() fails on a small alloc, there's a good chance that you won't
> be able to send a message to the host

Send what message to the host? If the malloc in the socet reconnect code
fails, its the code on the host thats going to flag up that malloc failed.

> and if it does manage to receive the message, you can be almost
> certain that it won't be able to run any GUI operations, send mail,
> etc. to inform the admin.

OTOH, If all it does it log it to a file, theres a fair chance it might
succeed.

> There's no point writing the code for the first steps, if it's
> intractable to make the later steps do something useful.

OTOH, a simple printed warning, and closing the socket are fairly likely
to work.

> Btw, as an admin I would really rather the socket reconnection code
> keeps trying in that circumstance, if qemu does not simply fall over
> due to alloc failing for something else soon after.

Surely better to keep running by dropping nonessential services so that
the guest might get a chance to shut down or the host might recover.

> I'd rather it behaves like a broken HWRNG if it can't get host
> entropy: Don't provide data, and let the guest decide what to do, just
> like it does for a broken HWRNG.

It does.

>  Except virtio-rng can report unavailability rather than simply being broken 
> :-)

It could, in theory.

-Ian




reply via email to

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