linux-um archives
 help / color / mirror / Atom feed
From: Frank Laub <frank.laub@gmail.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] ]PATCH 3.03 1/1] um: VDE backend needs to handle EINTR/EAGAIN
Date: Sat, 19 Nov 2011 17:29:33 -0800	[thread overview]
Message-ID: <4EC857FD.6090709@gmail.com> (raw)
In-Reply-To: <4EC83B50.8090906@sigma-star.at>

Handle EINTR and EAGAIN during vde_send() and vde_recv() in case the VDE library doesn't. Use the same approach that net_user.c takes.

Signed-off-by: Frank Laub<flaub@anomali.es>

--- a/arch/um/drivers/vde_user.c
+++ b/arch/um/drivers/vde_user.c
@@ -11,6 +11,7 @@
  #include "um_malloc.h"
  #include "user.h"
  #include "vde.h"
+#include "os.h"

  static int vde_user_init(void *data, void *dev)
  {
@@ -103,7 +104,7 @@ int vde_user_read(void *conn, void *buf,
      if (vconn == NULL)
          return 0;

-    rv = vde_recv(vconn, buf, len, 0);
+    CATCH_EINTR(rv = vde_recv(vconn, buf, len, 0));
      if (rv < 0) {
          if (errno == EAGAIN)
              return 0;
@@ -118,10 +119,17 @@ int vde_user_read(void *conn, void *buf,
  int vde_user_write(void *conn, void *buf, int len)
  {
      VDECONN *vconn = conn;
+    int rv;

      if (vconn == NULL)
          return 0;

-    return vde_send(vconn, buf, len, 0);
+    CATCH_EINTR(rv = vde_send(vconn, buf, len, 0));
+    if (rv < 0) {
+        if (errno == EAGAIN)
+            return 0;
+        return -errno;
+    }
+    return rv;
  }


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


      reply	other threads:[~2011-11-20  1:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19 23:16 [uml-devel] VDE backend does not handle EINTR properly Frank Laub
2011-11-19 23:27 ` Richard Weinberger
2011-11-20  1:29   ` Frank Laub [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EC857FD.6090709@gmail.com \
    --to=frank.laub@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox