Skip to contentSkip to conversation

spice-qemu-char.c Assert

Qemu-devel Quwj 2 participants 3 messages Sep 1, 2015

lore
Share & tools
lore

Quwj

author
#0 lore raw

Public bug reported:

spice-qemu-char.c:173: spice_chr_add_watch: Assertion `cond == G_IO_OUT' failed. I trace the code virtio-console.c:

ret = qemu_chr_fe_write(vcon->chr, buf, len);
    trace_virtio_console_flush_buf(port->id, len, ret);

    if (ret < len) {
        VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port);

        /*
         * Ideally we'd get a better error code than just -1, but
         * that's what the chardev interface gives us right now.  If
         * we had a finer-grained message, like -EPIPE, we could close
         * this connection.
         */
        if (ret < 0)
            ret = 0;
        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|G_IO_HUP,
                                                    chr_write_unblocked, vcon);
            }
        }
    }

and spice-qemu-char.c in function:spice_chr_add_watch assert(cond == G_IO_OUT);
so run in this code,will trigger this assert.

My qemu version is 2.3.0 and spice-server version is 0.12.5

** Affects: qemu
Importance: Undecided
Status: New

Signature · 44 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1490886

Title:
  spice-qemu-char.c Assert

Status in QEMU:
  New

Bug description:
  spice-qemu-char.c:173: spice_chr_add_watch: Assertion `cond == G_IO_OUT' failed.
  I trace the code virtio-console.c:
  ret = qemu_chr_fe_write(vcon->chr, buf, len);
      trace_virtio_console_flush_buf(port->id, len, ret);

      if (ret < len) {
          VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port);

          /*
           * Ideally we'd get a better error code than just -1, but
           * that's what the chardev interface gives us right now.  If
           * we had a finer-grained message, like -EPIPE, we could close
           * this connection.
           */
          if (ret < 0)
              ret = 0;
          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|G_IO_HUP,
                                                      chr_write_unblocked, vcon);
              }
          }
      }
  and spice-qemu-char.c in function:spice_chr_add_watch
  assert(cond == G_IO_OUT);
  so run in this code,will trigger this assert.

  My qemu version is 2.3.0 and spice-server version is 0.12.5

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1490886/+subscriptions
author
#1 lore raw

called param is G_IO_OUT|G_IO_HUP,but assert (cond == G_IO_OUT)

Signature · 44 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1490886

Title:
  spice-qemu-char.c Assert

Status in QEMU:
  New

Bug description:
  spice-qemu-char.c:173: spice_chr_add_watch: Assertion `cond == G_IO_OUT' failed.
  I trace the code virtio-console.c:
  ret = qemu_chr_fe_write(vcon->chr, buf, len);
      trace_virtio_console_flush_buf(port->id, len, ret);

      if (ret < len) {
          VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port);

          /*
           * Ideally we'd get a better error code than just -1, but
           * that's what the chardev interface gives us right now.  If
           * we had a finer-grained message, like -EPIPE, we could close
           * this connection.
           */
          if (ret < 0)
              ret = 0;
          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|G_IO_HUP,
                                                      chr_write_unblocked, vcon);
              }
          }
      }
  and spice-qemu-char.c in function:spice_chr_add_watch
  assert(cond == G_IO_OUT);
  so run in this code,will trigger this assert.

  My qemu version is 2.3.0 and spice-server version is 0.12.5

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1490886/+subscriptions
#2 lore raw
In reply to Quwj

I think this is fixed by:

commit f7a8beb5e6a13dc924895244777d9ef08b23b367

Author: Marc-André Lureau <[email protected]>
Date:   Thu May 28 15:04:58 2015 +0200

spice: fix spice_chr_add_watch() pre-condition

Since e02bc6de30c44fd668dc0d6e1cd1804f2eed3ed3, add_watch() is called with G_IO_HUP. Even if spice-qemu-char ignores this flag, the precondition must be changed.

https://bugzilla.redhat.com/show_bug.cgi?id=1128992

Which is in 2.4.0

** Changed in: qemu
Status: New => Fix Released

** Bug watch added: Red Hat Bugzilla #1128992
https://bugzilla.redhat.com/show_bug.cgi?id=1128992

Signature · 44 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1490886

Title:
  spice-qemu-char.c Assert

Status in QEMU:
  Fix Released

Bug description:
  spice-qemu-char.c:173: spice_chr_add_watch: Assertion `cond == G_IO_OUT' failed.
  I trace the code virtio-console.c:
  ret = qemu_chr_fe_write(vcon->chr, buf, len);
      trace_virtio_console_flush_buf(port->id, len, ret);

      if (ret < len) {
          VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(port);

          /*
           * Ideally we'd get a better error code than just -1, but
           * that's what the chardev interface gives us right now.  If
           * we had a finer-grained message, like -EPIPE, we could close
           * this connection.
           */
          if (ret < 0)
              ret = 0;
          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|G_IO_HUP,
                                                      chr_write_unblocked, vcon);
              }
          }
      }
  and spice-qemu-char.c in function:spice_chr_add_watch
  assert(cond == G_IO_OUT);
  so run in this code,will trigger this assert.

  My qemu version is 2.3.0 and spice-server version is 0.12.5

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1490886/+subscriptions