Skip to contentSkip to conversation

qemu-freebsd: fixes for running Xen guests

PATCH In review Roger Pau Monne 5 participants 25 messages May 23, 2014 – Jul 23, 2014 2 messages not in the archive Networking

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/3 xen: fix usage of ENODATA

In reply to Roger Pau Monne

ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT.

Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>

---
Changes since v1:
- Define ENODATA to ENOENT for platforms that don't have ENODATA.

---
 xen-hvm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
xen-hvm.c +5 -2
index a64486c..a414105 100644
@@ -499,11 +499,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
                                  start_addr >> TARGET_PAGE_BITS, npages,
                                  bitmap);
     if (rc < 0) {
-        if (rc != -ENODATA) {
+#ifndef ENODATA
+#define ENODATA  ENOENT
+#endif
+        if (errno == ENODATA) {
             memory_region_set_dirty(framebuffer, 0, size);
             DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
                     ", 0x" TARGET_FMT_plx "): %s\n",
-                    start_addr, start_addr + size, strerror(-rc));
+                    start_addr, start_addr + size, strerror(errno));
         }
         return;
     }
Signature · 7 lines
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#8 lore raw

PATCH v2 2/3 tap-bsd: implement a FreeBSD only version of tap_open

In reply to Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
net/tap-bsd.c +69 -1
index 90f8a02..bf91bd0 100644
@@ -27,12 +27,13 @@
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
 
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <net/if_tap.h>
 #endif
 
+#ifndef __FreeBSD__
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
              int vnet_hdr_required, int mq_required)
 {
@@ -108,6 +109,73 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
     return fd;
 }
 
+#else /* __FreeBSD__ */
+
+#define PATH_NET_TAP "/dev/tap"
+
+int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
+             int vnet_hdr_required, int mq_required)
+{
+    int fd, s, ret;
+    struct ifreq ifr;
+
+    TFR(fd = open(PATH_NET_TAP, O_RDWR));
+    if (fd < 0) {
+        error_report("could not open %s: %s", PATH_NET_TAP, strerror(errno));
+        return -1;
+    }
+
+    memset(&ifr, 0, sizeof(ifr));
+
+    ret = ioctl(fd, TAPGIFNAME, (void *)&ifr);
+    if (ret < 0) {
+        error_report("could not get tap interface name");
+        goto error;
+    }
+
+    if (ifname[0] != '\0') {
+        /* User requested the interface to have a specific name */
+        s = socket(AF_LOCAL, SOCK_DGRAM, 0);
+        if (s < 0) {
+            error_report("could not open socket to set interface name");
+            goto error;
+        }
+        ifr.ifr_data = ifname;
+        ret = ioctl(s, SIOCSIFNAME, (void *)&ifr);
+        close(s);
+        if (ret < 0) {
+            error_report("could not set tap interface name");
+            goto error;
+        }
+    } else {
+        pstrcpy(ifname, ifname_size, ifr.ifr_name);
+    }
+
+    if (*vnet_hdr) {
+        /* BSD doesn't have IFF_VNET_HDR */
+        *vnet_hdr = 0;
+
+        if (vnet_hdr_required && !*vnet_hdr) {
+            error_report("vnet_hdr=1 requested, but no kernel "
+                         "support for IFF_VNET_HDR available");
+            goto error;
+        }
+    }
+    if (mq_required) {
+        error_report("mq_required requested, but not kernel support"
+                     "for IFF_MULTI_QUEUE available");
+        goto error;
+    }
+
+    fcntl(fd, F_SETFL, O_NONBLOCK);
+    return fd;
+
+error:
+    close(fd);
+    return -1;
+}
+#endif /* __FreeBSD__ */
+
 int tap_set_sndbuf(int fd, const NetdevTapOptions *tap)
 {
     return 0;
Signature · 7 lines
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#19 lore raw

PATCH v2 3/3 serial: poll the serial console with G_IO_HUP

In reply to Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +1 -1
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }
Signature · 7 lines
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#2 lore raw

PATCH v2 1/3 xen: fix usage of ENODATA

In reply to Roger Pau Monne

ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT.

Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>

---
Changes since v1:
- Define ENODATA to ENOENT for platforms that don't have ENODATA.

---
 xen-hvm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
xen-hvm.c +5 -2
index a64486c..a414105 100644
@@ -499,11 +499,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
                                  start_addr >> TARGET_PAGE_BITS, npages,
                                  bitmap);
     if (rc < 0) {
-        if (rc != -ENODATA) {
+#ifndef ENODATA
+#define ENODATA  ENOENT
+#endif
+        if (errno == ENODATA) {
             memory_region_set_dirty(framebuffer, 0, size);
             DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
                     ", 0x" TARGET_FMT_plx "): %s\n",
-                    start_addr, start_addr + size, strerror(-rc));
+                    start_addr, start_addr + size, strerror(errno));
         }
         return;
     }
Signature · 1 line
1.7.7.5 (Apple Git-26)
#20 lore raw

PATCH v2 3/3 serial: poll the serial console with G_IO_HUP

In reply to Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +1 -1
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }
Signature · 1 line
1.7.7.5 (Apple Git-26)
#0 lore raw

v2 cover qemu-freebsd: fixes for running Xen guests

This three patches allow FreeBSD Xen Dom0 to use Qemu (i.e., launch HVM guests).

First patch fixes the usage of ENODATA, which doesn't exist on FreeBSD and is replaced with ENOENT instead.

The second patch is more controversial probably, since it introduces a FreeBSD specific version of tap_open which behaves like it's Linux counterpart, allowing Qemu to create tap interfaces and rename them. I've decided to just fork the function instead of adding a bunch more of preprocessor code in the original function.

Last patch adds G_IO_HUP to calls to qemu_chr_fe_add_watch so they behave the same way on both FreeBSD and Linux (see the commit message for the rationale).

Thanks for the review, Roger.

Reviewed-by on v2 2/3
#9 lore raw

Re: [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Roger Pau Monne
Quoted 9 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Quoted 8 lines
Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
#3 lore raw

Re: [PATCH v2 1/3] xen: fix usage of ENODATA

In reply to Roger Pau Monne
Quoted 23 lines · Roger Pau Monne

ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT.

Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>

---
Changes since v1:
- Define ENODATA to ENOENT for platforms that don't have ENODATA.

---
 xen-hvm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
xen-hvm.c +0 -0
index a64486c..a414105 100644

xen-hvm.c static void xen_sync_dirty_bitmap(XenIOState *state, · line 504

Quoted 7 lines
xen-hvm.c +3 -1
@@ -499,11 +499,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
                                  start_addr >> TARGET_PAGE_BITS, npages,
                                  bitmap);
     if (rc < 0) {
-        if (rc != -ENODATA) {
+#ifndef ENODATA
+#define ENODATA  ENOENT
+#endif

I wonder if it makes sense to have this in a more generic header, lile include/qemu/osdep.h?

Quoted 12 lines
xen-hvm.c +2 -1
+        if (errno == ENODATA) {
             memory_region_set_dirty(framebuffer, 0, size);
             DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx
                     ", 0x" TARGET_FMT_plx "): %s\n",
-                    start_addr, start_addr + size, strerror(-rc));
+                    start_addr, start_addr + size, strerror(errno));
         }
         return;
     }
Signature · 1 line
1.7.7.5 (Apple Git-26)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw

Re: [PATCH v2 1/3] xen: fix usage of ENODATA

In reply to a message not in the archive
Quoted 19 lines · Stefano Stabellini
Quoted 18 lines · Roger Pau Monne

ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT.

Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>

---
Changes since v1:
- Define ENODATA to ENOENT for platforms that don't have ENODATA.

---
 xen-hvm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Quoted 15 lines

xen-hvm.c static void xen_sync_dirty_bitmap(XenIOState *state, · line 504

Quoted 12 lines
xen-hvm.c +3 -1
index a64486c..a414105 100644
@@ -499,11 +499,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
                                  start_addr >> TARGET_PAGE_BITS, npages,
                                  bitmap);
     if (rc < 0) {
-        if (rc != -ENODATA) {
+#ifndef ENODATA
+#define ENODATA  ENOENT
+#endif

I wonder if it makes sense to have this in a more generic header, lile include/qemu/osdep.h?

Well, I think this is something really specific to Xen, because FreeBSD is mapping the error returned by Xen (ENODATA), to a error code available on FreeBSD (ENOENT), see:

http://xenbits.xen.org/gitweb/?p=people/royger/freebsd.git;a=patch;h=f09eeed01bc884b37e978f6ec6e3e7a86778ef4b

But I don't think this is useful outside of this context, since there's no syscall that would return ENODATA on FreeBSD that instead returns ENOENT. All the paths in Qemu that check for ENODATA are Linux specific AFAICT.

Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw

Re: [Qemu-devel] [PATCH v2 1/3] xen: fix usage of ENODATA

In reply to a message not in the archive
Quoted 40 lines · Roger Pau Monné
Quoted 19 lines · Stefano Stabellini
Quoted 18 lines · Roger Pau Monne

ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT.

Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Perard <[email protected]>

---
Changes since v1:
- Define ENODATA to ENOENT for platforms that don't have ENODATA.

---
 xen-hvm.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Quoted 15 lines

xen-hvm.c static void xen_sync_dirty_bitmap(XenIOState *state, · line 504

Quoted 12 lines
xen-hvm.c +3 -1
index a64486c..a414105 100644
@@ -499,11 +499,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state,
                                  start_addr >> TARGET_PAGE_BITS, npages,
                                  bitmap);
     if (rc < 0) {
-        if (rc != -ENODATA) {
+#ifndef ENODATA
+#define ENODATA  ENOENT
+#endif

I wonder if it makes sense to have this in a more generic header, lile include/qemu/osdep.h?

Well, I think this is something really specific to Xen, because FreeBSD is mapping the error returned by Xen (ENODATA), to a error code available on FreeBSD (ENOENT), see:

Quoted 6 lines

http://xenbits.xen.org/gitweb/?p=people/royger/freebsd.git;a=patch;h=f09eeed01bc884b37e978f6ec6e3e7a86778ef4b

But I don't think this is useful outside of this context, since there's no syscall that would return ENODATA on FreeBSD that instead returns ENOENT. All the paths in Qemu that check for ENODATA are Linux specific AFAICT.

Fair enough. In that case the patch is fine as it is.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#21 lore raw

Re: [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

In reply to Roger Pau Monne

Ping?

Quoted 81 lines · Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +0 -0
index 593679a..ae1c539 100644

monitor.c void monitor_flush(Monitor *mon) · line 310

Quoted 8 lines
monitor.c +1 -1
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#22 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

In reply to Roger Pau Monne

Ping?

Quoted 89 lines · Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +1 -1
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }
#23 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

Do I need to resend this? it's been more than a month without review.

Roger.

Quoted 84 lines · Roger Pau Monné

Ping?

Quoted 81 lines · Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +0 -0
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
Quoted 10 lines

monitor.c void monitor_flush(Monitor *mon) · line 310

Quoted 8 lines
monitor.c +1 -1
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#24 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

In reply to Roger Pau Monné

Do I need to resend this? it's been more than a month without review.

Roger.

Quoted 94 lines · Roger Pau Monné

Ping?

Quoted 89 lines · Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +1 -1
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }
#25 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

Il 30/06/2014 13:00, Roger Pau Monné ha scritto:

Quoted 1 line

Do I need to resend this? it's been more than a month without review.

I'll send a pull request for it.

Sorry for the delay.

Paolo

Quoted 87 lines · Roger Pau Monné
Quoted 86 lines

Ping?

Quoted 83 lines · Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +0 -0
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
Quoted 9 lines
Quoted 8 lines

monitor.c void monitor_flush(Monitor *mon) · line 310

Quoted 6 lines
monitor.c +1 -1
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#26 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] serial: poll the serial console with G_IO_HUP

In reply to Roger Pau Monné

Il 30/06/2014 13:00, Roger Pau Monné ha scritto:

Quoted 1 line

Do I need to resend this? it's been more than a month without review.

I'll send a pull request for it.

Sorry for the delay.

Paolo

Quoted 96 lines · Roger Pau Monné
Quoted 94 lines

Ping?

Quoted 89 lines · Roger Pau Monne

On FreeBSD polling a master pty while the other end is not connected with G_IO_OUT only results in an endless wait. This is different from the Linux behaviour, that returns immediately. In order to demonstrate this, I have the following example code:

http://xenbits.xen.org/people/royger/test_poll.c

When executed on Linux:

$ ./test_poll
In callback

On FreeBSD instead, the callback never gets called:

$ ./test_poll

So, in order to workaround this, poll the source with G_IO_HUP (which makes the code behave the same way on both Linux and FreeBSD).

Cc Peter Crosthwaite <[email protected]>
Cc Michael Tokarev <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Paolo Bonzini <[email protected]>

---
Changes since v1:
- Fix other users of qemu_chr_fe_add_watch to use G_IO_HUP.

---
 hw/char/serial.c         |    2 +-
 hw/char/virtio-console.c |    3 ++-
 hw/usb/redirect.c        |    2 +-
 monitor.c                |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
hw/char/serial.c +1 -1
index f4d167f..2a2c9e5 100644
@@ -246,7 +246,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
         serial_receive1(s, &s->tsr, 1);
     } else if (qemu_chr_fe_write(s->chr, &s->tsr, 1) != 1) {
         if (s->tsr_retry >= 0 && s->tsr_retry < MAX_XMIT_RETRY &&
-            qemu_chr_fe_add_watch(s->chr, G_IO_OUT, serial_xmit, s) > 0) {
+            qemu_chr_fe_add_watch(s->chr, G_IO_OUT|G_IO_HUP, serial_xmit, s) > 0) {
             s->tsr_retry++;
             return FALSE;
         }
hw/char/virtio-console.c +2 -1
index 6c8be0f..38e290a 100644
@@ -69,7 +69,8 @@ static ssize_t flush_buf(VirtIOSerialPort *port,
         if (!k->is_console) {
             virtio_serial_throttle_port(port, true);
             if (!vcon->watch) {
-                vcon->watch = qemu_chr_fe_add_watch(vcon->chr, G_IO_OUT,
+                vcon->watch = qemu_chr_fe_add_watch(vcon->chr,
+                                                    G_IO_OUT|G_IO_HUP,
                                                     chr_write_unblocked, vcon);
             }
         }
hw/usb/redirect.c +1 -1
index 287a505..06e757d 100644
@@ -284,7 +284,7 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
     r = qemu_chr_fe_write(dev->cs, data, count);
     if (r < count) {
         if (!dev->watch) {
-            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT,
+            dev->watch = qemu_chr_fe_add_watch(dev->cs, G_IO_OUT|G_IO_HUP,
                                                usbredir_write_unblocked, dev);
         }
         if (r < 0) {
monitor.c +1 -1
index 593679a..ae1c539 100644
@@ -304,7 +304,7 @@ void monitor_flush(Monitor *mon)
             mon->outbuf = tmp;
         }
         if (mon->watch == 0) {
-            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT,
+            mon->watch = qemu_chr_fe_add_watch(mon->chr, G_IO_OUT|G_IO_HUP,
                                                monitor_unblocked, mon);
         }
     }
#10 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Stefan Hajnoczi
Quoted 19 lines · Stefan Hajnoczi
Quoted 9 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Quoted 8 lines
Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

Thanks, Roger.

#11 lore raw

Re: [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#12 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Roger Pau Monné
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

#13 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

I'm fine with that. I only reviewed this patch since it affects the net subsystem and left the series as a whole for someone to merge.

Stefan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#14 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Stefano Stabellini
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

I'm fine with that. I only reviewed this patch since it affects the net subsystem and left the series as a whole for someone to merge.

Stefan

#15 lore raw

Re: [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Stefano Stabellini
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

Would you do the backport of those three patches (one is already committed as e02bc6) to the qemu-xen repo at the same time, or would you like me to remind you about this in a month or so?

I would really like to have all this patches in Xen 4.5 if possible.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#16 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Stefano Stabellini
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

Would you do the backport of those three patches (one is already committed as e02bc6) to the qemu-xen repo at the same time, or would you like me to remind you about this in a month or so?

I would really like to have all this patches in Xen 4.5 if possible.

Thanks, Roger.

#17 lore raw

Re: [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

Quoted 30 lines · Roger Pau Monné
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

Quoted 5 lines

Would you do the backport of those three patches (one is already committed as e02bc6) to the qemu-xen repo at the same time, or would you like me to remind you about this in a month or so?

I would really like to have all this patches in Xen 4.5 if possible.

I should remember when I'll send a pull request (when 2.1 will be out). But please remind me if I'll forget.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#18 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] tap-bsd: implement a FreeBSD only version of tap_open

In reply to Roger Pau Monné
Quoted 30 lines · Roger Pau Monné
Quoted 21 lines · Stefano Stabellini
Quoted 20 lines · Roger Pau Monné
Quoted 19 lines · Stefan Hajnoczi
Quoted 17 lines · Roger Pau Monne

The current behaviour of tap_open for BSD systems differ greatly from it's Linux counterpart. Since FreeBSD supports interface renaming and tap device cloning by opening /dev/tap, implement a FreeBSD specific version of tap_open that behaves like it's Linux counterpart.

This is specially important for toolstacks that use Qemu (like Xen libxl), in order to have a unified behaviour across suported platforms.

Cc Stefano Stabellini <[email protected]>
Cc Anthony Liguori <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 net/tap-bsd.c |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I still don't see this committed to the repository, should I ping someone?

I was assuming that this patch would go via some other tree. But if Stefan is OK I could pick it up and submit a pull request for both patch 1 and 2 of this series.

Quoted 5 lines

Would you do the backport of those three patches (one is already committed as e02bc6) to the qemu-xen repo at the same time, or would you like me to remind you about this in a month or so?

I would really like to have all this patches in Xen 4.5 if possible.

I should remember when I'll send a pull request (when 2.1 will be out). But please remind me if I'll forget.