qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] qmp: dump-guest-memory: don't spin if non-b


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 2/3] qmp: dump-guest-memory: don't spin if non-blocking fd would block
Date: Fri, 21 Sep 2012 12:30:49 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/21/2012 11:07 AM, Luiz Capitulino wrote:
> fd_write_vmcore() will indefinitely spin for a non-blocking
> file-descriptor that would block. However, if the fd is non-blocking,
> how does it make sense to spin?
> 
> Change this behavior to return an error instead.
> 
> Note that this can only happen with an fd provided by a management
> application. The fd opened internally by dump-guest-memory is blocking.
> 
> Signed-off-by: Luiz Capitulino <address@hidden>
> ---
>  dump.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/dump.c b/dump.c
> index 2bf8d8d..5eea015 100644
> --- a/dump.c
> +++ b/dump.c
> @@ -100,18 +100,11 @@ static void dump_error(DumpState *s, const char *reason)
>  static int fd_write_vmcore(void *buf, size_t size, void *opaque)
>  {
>      DumpState *s = opaque;
> -    int fd = s->fd;
>      size_t writen_size;

While you are here, s/writen/written/ in the local variable.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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