qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()


From: Juan Quintela
Subject: [Qemu-devel] Re: [PATCH 01/14] Introduce qemu_write_full()
Date: Wed, 20 Jan 2010 01:04:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Anthony Liguori <address@hidden> wrote:
> On 01/19/2010 06:17 AM, Kirill A. Shutemov wrote:
>> On Tue, Jan 19, 2010 at 2:11 PM, Juan Quintela<address@hidden>  wrote:
>>    
>>> "Kirill A. Shutemov"<address@hidden>  wrote:
>>>      
>>>> A variant of write(2) which handles partial write.
>>>>
>>>> Signed-off-by: Kirill A. Shutemov<address@hidden>
>>>>        
>>> Hi
>>>
>>> Have you updated this series?  Is there any reason that you know when
>>> they haven't been picked?
>>>      
>> I don't  know any reason, but I'm going to review it once again.
>>
>> I also have plan to get rid of -fno-strict-aliasing where it's possible.
>>    
>
> I haven't reviewed the series in detail, but generally speaking I
> don't feel that good about these sort of series.
>
> You're essentially adding dummy error handling to quiet the compiler.
> That's worse than just disabling -Werror because at least you aren't
> losing the information in the code.
>
> If you're going to update error handling, it should be part of an
> effort to make code paths resilient to error.  IOW, actually audit the
> full error path of the function and make it deal with errors
> gracefully.

I reviewed his series, and I reviewed callers.  Please take a look at my
improved series.  Appart for the comments added there, I don't know what
to do here:

@@ -501,8 +501,11 @@ static void aio_signal_handler(int signum)
 {
     if (posix_aio_state) {
         char byte = 0;
+        ssize_t ret;

-        write(posix_aio_state->wfd, &byte, sizeof(byte));
+        ret = write(posix_aio_state->wfd, &byte, sizeof(byte));
+        if (ret < 0 && errno != EAGAIN)
+            die("write()");
     }

if write() fails in a pipe in the signal handler, I am at a lost about
what to do here.

For the rest, I think that I did the proper error path handling.

Thanks, Juan.




reply via email to

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