was not consistently functional to begin with.
Reported-by: Nicholas Thomas n...@bytemark.co.uk
Suggested-by: Peter Maydell peter.mayd...@linaro.org
Cc: qemu-sta...@nongnu.org
Signed-off-by: Michael Roth mdr...@linux.vnet.ibm.com
---
v2:
* Fixed s/except/accept/ typo (Laszlo)
Reviewed-by: Amit Shah
:
Reviewed-by: Amit Shah amit.s...@redhat.com
Amit
with virtio refactoring in 59ccd20a9ac719cff82180429458728f03ec612f
CC: qemu-sta...@nongnu.org
Signed-off-by: Cole Robinson crobi...@redhat.com
---
Notes:
v2: Fix other instances in s390x code, pointed out by Frederic
Acked-by: Amit Shah amit.s...@redhat.com
Amit
/qemu/amit/virtio-serial.git
char-remove-watch-on-unplug
for you to fetch changes up to 386a5a1e0057e220f79c48fe3689e3dfb17f1b09:
char: remove watch callback on chardev detach from frontend (2013-09-05
18:30:36 +0530)
Amit Shah (3):
char: move backends' io watch tag to CharDriverState
char
On (Fri) 04 Oct 2013 [21:18:02], Amit Shah wrote:
Hi Anthony,
Please pull to receive a fix for a segfault in the char layer. The
patches have been on the list for a week, and Gerd has reviewed them.
(I'm overloading the virtio-serial git tree for this series, haven't
gotten around
On (Tue) 29 Oct 2013 [18:42:45], Amit Shah wrote:
On (Fri) 04 Oct 2013 [21:18:02], Amit Shah wrote:
Hi Anthony,
Please pull to receive a fix for a segfault in the char layer. The
patches have been on the list for a week, and Gerd has reviewed them.
(I'm overloading the virtio
On (Tue) 03 Sep 2013 [14:15:55], Michael S. Tsirkin wrote:
On Tue, Sep 03, 2013 at 04:40:21PM +0530, Amit Shah wrote:
On (Mon) 19 Aug 2013 [16:30:54], Stefan Hajnoczi wrote:
On Mon, Aug 19, 2013 at 05:28:44PM +0800, yinyin wrote:
Hi,all:
in func virtqueue_get_avail_bytes
This deduplicates code used a lot of times.
CC: qemu-sta...@nongnu.org
Reviewed-by: Gerd Hoffmann kra...@redhat.com
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c | 62 +++--
1 file changed, 19 insertions(+), 43 deletions
.
https://bugzilla.redhat.com/show_bug.cgi?id=985205
CC: qemu-sta...@nongnu.org
Reported-by: Sibiao Luo s...@redhat.com
Reviewed-by: Gerd Hoffmann kra...@redhat.com
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/qemu-char.c b/qemu
-by: Gerd Hoffmann kra...@redhat.com
Signed-off-by: Amit Shah amit.s...@redhat.com
---
include/sysemu/char.h | 1 +
qemu-char.c | 77 ++-
2 files changed, 40 insertions(+), 38 deletions(-)
diff --git a/include/sysemu/char.h b/include/sysemu
for you to fetch changes up to 386a5a1e0057e220f79c48fe3689e3dfb17f1b09:
char: remove watch callback on chardev detach from frontend (2013-09-05
18:30:36 +0530)
Amit Shah (3):
char: move backends' io watch tag to CharDriverState
char: use common function to disable callbacks on chardev
Hi,
On (Sun) 11 Aug 2013 [16:25:25], Gal Hammer wrote:
The redundant notification caused the Windows' driver to duplicate the
pending write request's buffer. The driver was fixed, but I think this
change is still required.
Signed-off-by: Gal Hammer gham...@redhat.com
---
for you to fetch changes up to 386a5a1e0057e220f79c48fe3689e3dfb17f1b09:
char: remove watch callback on chardev detach from frontend (2013-09-05
18:30:36 +0530)
Amit Shah (3):
char: move backends' io watch tag to CharDriverState
char: use common function to disable callbacks on chardev
On (Thu) 01 Aug 2013 [01:28:46], Andreas Färber wrote:
virtconsole and virtserialport are identical in every other aspect
except for the distinguishing VirtIOSerialPortClass::is_console field.
Cc: qemu-sta...@nongnu.org
Signed-off-by: Andreas Färber afaer...@suse.de
Reviewed-by: Amit Shah
probably
unrelated to the main problem, I'm including it because it should
qualify as an improvement / cleanup in its own right.
See https://bugzilla.redhat.com/show_bug.cgi?id=970047 for more
details.
Reviewed-by: Amit Shah amit.s...@redhat.com
Amit
On (Wed) 19 Jun 2013 [13:17:57], Laszlo Ersek wrote:
Hello Michael,
this is with reference to
https://bugzilla.redhat.com/show_bug.cgi?id=907733.
Ever since the initial qemu-ga commit AFAICS an exception for
virtio-serial has existed, when reading EOF from the channel.
For isa-serial,
Hi,
On (Mon) 25 Nov 2013 [10:07:40], Gal Hammer wrote:
Fix a bug that was introduced in commit 386a5a1e. A removal of a device
set the chr handlers to NULL. However when the device is plugged back,
its read callback is not restored so data can't be transfter from the
host to the guest via the
On (Mon) 09 Dec 2013 [22:10:12], Amos Kong wrote:
Bugzilla: https://bugs.launchpad.net/qemu/+bug/1253563
We have a requests queue to cache the random data, but the second
will come in when the first request is returned, so we always
only have one items in the queue. It effects the
On (Sun) 15 Dec 2013 [12:26:37], Gal Hammer wrote:
Fix a bug that was introduced in commit 386a5a1e. A removal of a device
set the chr handlers to NULL. However when the device is plugged back,
its read callback is not restored so data can't be transferred from the
host to the guest (e.g. via
On (Mon) 16 Dec 2013 [15:19:31], Anthony Liguori wrote:
On Mon, Dec 16, 2013 at 8:36 AM, Amit Shah amit.s...@redhat.com wrote:
On (Mon) 09 Dec 2013 [22:10:12], Amos Kong wrote:
Bugzilla: https://bugs.launchpad.net/qemu/+bug/1253563
We have a requests queue to cache the random data
On (Tue) 17 Dec 2013 [08:47:34], Markus Armbruster wrote:
Amos Kong ak...@redhat.com writes:
Bugzilla: https://bugs.launchpad.net/qemu/+bug/1253563
We have a requests queue to cache the random data, but the second
will come in when the first request is returned, so we always
only have
On (Tue) 17 Dec 2013 [11:12:02], Gal Hammer wrote:
On 16/12/2013 22:32, Amit Shah wrote:
On (Sun) 15 Dec 2013 [12:26:37], Gal Hammer wrote:
Fix a bug that was introduced in commit 386a5a1e. A removal of a device
set the chr handlers to NULL. However when the device is plugged back,
its read
On (Mon) Oct 11 2010 [17:15:30], Anthony Liguori wrote:
After suffering from a prolonged maintainer softlockup, I'm
attempting to get 0.13.0 release process back on track.
Anthony,
can you pick up the patches in the thread:
http://www.mail-archive.com/qemu-devel@nongnu.org/msg41478.html
On (Tue) Oct 19 2010 [23:12:20], Arun R Bharadwaj wrote:
Hi,
This is the v6 of the patch-series to have a generic asynchronous task
offloading framework (called threadlets) within qemu.
Request to consider pulling this series as discussed during the
Qemu-devel call.
I tried this out with
On (Wed) Oct 20 2010 [08:18:51], Anthony Liguori wrote:
On 10/20/2010 07:05 AM, Stefan Hajnoczi wrote:
On Wed, Oct 20, 2010 at 12:57 PM, Amit Shahamit.s...@redhat.com wrote:
On (Tue) Oct 19 2010 [23:12:20], Arun R Bharadwaj wrote:
Hi,
This is the v6 of the patch-series to have a generic
On (Sat) Oct 23 2010 [13:05:48], Stefan Hajnoczi wrote:
You cannot access guest memory using QEMU RAM functions (or use the
virtqueue_pop() function which uses them) from a thread without taking
the QEMU global mutex.
The abort stack trace is a result of accessing guest RAM from two
On (Fri) Nov 05 2010 [08:32:30], Adam Litke wrote:
On Thu, 2010-11-04 at 08:57 -0500, Michael Roth wrote:
This resembles vl.c's main_loop_wait() but I can see why you might want
your own. There is opportunity for sharing the select logic and ioh
callbacks but I think that could be
The current default of 16 buffers for the control vq is too small. We
can get more entries in there, example when asking the guest to add
max. allowed ports.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions
Hi,
On (Wed) Nov 10 2010 [19:37:19], Michael Roth wrote:
EXAMPLE USAGE:
The commandline options are a little convoluted right now; this will
addressed in later revisions.
- Configure guest agent to talk to host via virtio-serial
# start guest with virtio-serial/virtproxy/virtagent.
.
virtserialport.chardev=chr, The chardev to associate this port with.
virtserialport.name=string, Name for the port that's exposed to \
the guest for port discovery.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 17 ++---
hw/virtio-serial.h | 13
with this
virtual NIC.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
net.h |9 ++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/net.h b/net.h
index 25e7968..b3be73c 100644
--- a/net.h
+++ b/net.h
@@ -20,9 +20,12 @@ typedef struct NICConf {
} NICConf;
#define
Document the options common to all block devices.
This comes from Kevin.
Signed-off-by: Amit Shah amit.s...@redhat.com
CC: Kevin Wolf kw...@redhat.com
---
block_int.h | 14 --
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/block_int.h b/block_int.h
index 88a2546
-by: Amit Shah amit.s...@redhat.com
---
v2:
Make the descriptor entries depend on the max_nr_ports being used to
prevent wastage. This also copes up with any future enhancing of
max_supported_ports to higher values.
hw/virtio-serial-bus.c | 13 ++---
1 files changed, 10 insertions(+), 3
The initialisation for generic ports and console ports is similar.
Factor out the parts that are the same in a different function that can
be called from each of the initfns.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 31 ++-
1 files
indicates it can accept more data, start pushing!
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 17 -
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 749ed59..ec85ad5 100644
--- a/hw/virtio
Instead of passing each handler in the qemu_add_handlers() function,
create a struct of handlers that can be passed to the function instead.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
gdbstub.c|9 +++--
hw/debugcon.c|2 +-
hw/escc.c|9
The send_all function is modified to return to the caller in case the
driver cannot handle any more data. It returns -EAGAIN or
WSAEWOULDBLOCK on non-Windows and Windows platforms respectively. This
is only done when the caller sets a callback function handler indicating
it's not interested in
slow down in case of a slow host reader. The
worst-case condition was a guest writing data to a chardev that wasn't
being read from resulting in the guest getting unresponsive.
Amit Shah (7):
virtio-console: Factor out common init between console and generic
ports
char: Add
and letting
users of chardevs know that a driver became writable again.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c | 27 +++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index a24c4c2..e624600 100644
--- a/qemu-char.c
Introduce a char-specific wrapper to qemu_set_fd_handler functions.
This wrapper is useful to add / remove a write handler easily. Write
handlers are only used when the backend is blocked and cannot receive
any more input.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c | 64
On (Wed) Dec 01 2010 [11:59:35], Paul Brook wrote:
-qemu_chr_write(vcon-chr, buf, len);
+ret = qemu_chr_write(vcon-chr, buf, len);
+if (ret == -EAGAIN) {
+virtio_serial_throttle_port(port, true);
+}
}
This looks wrong. It will loose data
patches will enable the nonblocking and callback functionality.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c |3 +++
qemu-char.h |5 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 483a5fd..c16c2d7 100644
--- a/qemu
On (Wed) Dec 01 2010 [11:30:58], Paul Brook wrote:
/* Callback function that's called when the guest sends us data */
static void flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t
len) {
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
+int ret;
-
On (Wed) Dec 01 2010 [13:08:26], Paul Brook wrote:
On (Wed) Dec 01 2010 [11:59:35], Paul Brook wrote:
-qemu_chr_write(vcon-chr, buf, len);
+ret = qemu_chr_write(vcon-chr, buf, len);
+if (ret == -EAGAIN) {
+virtio_serial_throttle_port(port, true);
On (Thu) Dec 02 2010 [17:31:36], Paul Brook wrote:
when there's a partial write, it tries to do a write again, which will
fail with -EAGAIN.
Doesn't that cause the first partial chunk to be incorrectly transmitted
twice? You may only return EAGAIN if no data was transmitted.
On (Mon) Dec 06 2010 [09:35:10], Paul Brook wrote:
On (Thu) Dec 02 2010 [17:31:36], Paul Brook wrote:
when there's a partial write, it tries to do a write again, which
will fail with -EAGAIN.
Doesn't that cause the first partial chunk to be incorrectly
transmitted
On (Mon) Dec 06 2010 [13:23:50], Paul Brook wrote:
Sure. My proposal is for qemu_chr_write() to succeed all the time. If
the backend can block, and the caller can handle it, it can get a
-EAGAIN (or WSAEWOULDBLOCK) return. When the backend becomes writable,
the chardev can call the
-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c | 13 ++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 74ba5ec..eb7b362 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -736,7 +736,7
On (Wed) Dec 08 2010 [12:56:33], Paul Brook wrote:
Sure. My proposal is for qemu_chr_write() to succeed all the time. If
the backend can block, and the caller can handle it, it can get a
-EAGAIN (or WSAEWOULDBLOCK) return. When the backend becomes writable,
the chardev can call
Hi,
This patch series converts virtio-serial-bus to use the guest buffers
instead of copying over guest data to the host, as suggested by Paul.
In addition, there are some trivial fixes for the virtio-console and
virtio-serial code.
Amit Shah (5):
virtio-console: Factor out common init
The initialisation for generic ports and console ports is similar.
Factor out the parts that are the same in a different function that can
be called from each of the initfns.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 31 ++-
1 files
Remove unnecessary braces around a case statement.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c |3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index d7fe68b..d0b9354 100644
--- a/hw/virtio-console.c
When the guest writes something to a host, we copied over the entire
buffer first into the host and then processed it. Do away with that, it
could result in a malicious guest causing a DoS on the host.
Reported-by: Paul Brook p...@codesourcery.com
Signed-off-by: Amit Shah amit.s...@redhat.com
Separate out a non-changing condition over the period of a loop into an
if statement before the loop. This will be used later to re-work the
loop.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c |5 -
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git
Check if the guest really sent any items in the out_vq before using
them. Similarly, check if there is a buffer to send data in before
writing.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c | 19 +++
1 files changed, 19 insertions(+), 0 deletions
On (Fri) Dec 10 2010 [13:59:50], Paul Brook wrote:
Check if the guest really sent any items in the out_vq before using
them. Similarly, check if there is a buffer to send data in before
writing.
Can this actually happen? If so why/how?
Why does it need a special case in this device?
A
When the guest writes something to a host, we copied over the entire
buffer first into the host and then processed it. Do away with that, it
could result in a malicious guest causing a DoS on the host.
Reported-by: Paul Brook p...@codesourcery.com
Signed-off-by: Amit Shah amit.s...@redhat.com
On (Fri) Dec 10 2010 [15:17:18], Paul Brook wrote:
On (Fri) Dec 10 2010 [14:02:37], Paul Brook wrote:
-if (!discard) {
+if (discard) {
+goto next;
+}
+next:
virtqueue_push(vq, elem, 0);
Please don't do this.
to be done
- remove goto usage.
Amit Shah (4):
virtio-console: Factor out common init between console and generic
ports
virtio-console: Remove unnecessary braces
virtio-serial: Simplify condition for a while loop
virtio-serial: Don't copy over guest buffer to host
hw/virtio-console.c
On (Fri) Dec 10 2010 [14:02:37], Paul Brook wrote:
-if (!discard) {
+if (discard) {
+goto next;
+}
+next:
virtqueue_push(vq, elem, 0);
Please don't do this.
Could you elaborate?
I can move the 'discard' check into the following
The initialisation for generic ports and console ports is similar.
Factor out the parts that are the same in a different function that can
be called from each of the initfns.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 31 ++-
1 files
Separate out a non-changing condition over the period of a loop into an
if statement before the loop. This will be used later to re-work the
loop.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c |5 -
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git
On (Fri) Dec 10 2010 [15:17:58], Paul Brook wrote:
On (Fri) Dec 10 2010 [13:59:50], Paul Brook wrote:
Check if the guest really sent any items in the out_vq before using
them. Similarly, check if there is a buffer to send data in before
writing.
Can this actually happen? If
-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c | 13 ++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 74ba5ec..eb7b362 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -736,7 +736,7
and rebases needed.
If this looks acceptable, please apply!
Amit Shah (4):
qdev: Add a description field for qdev properties for documentation
virtio-serial: Add description fields for qdev properties
net.h: Add description fields for qdev properites
block_int.h: Provide documentation for common
.
virtserialport.chardev=chr, The chardev to associate this port with.
virtserialport.name=string, Name for the port that's exposed to \
the guest for port discovery.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 17 ++---
hw/virtio-serial.h | 13
Document the options common to all block devices.
This comes from Kevin.
Signed-off-by: Amit Shah amit.s...@redhat.com
CC: Kevin Wolf kw...@redhat.com
---
block_int.h | 20
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/block_int.h b/block_int.h
index
with this
virtual NIC.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
net.h | 12
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/net.h b/net.h
index aa4454b..9cfd2ed 100644
--- a/net.h
+++ b/net.h
@@ -21,10 +21,14 @@ typedef struct NICConf {
} NICConf;
#define
On (Mon) Jan 10 2011 [18:01:58], Chris Krumme wrote:
On 01/10/2011 08:31 AM, Markus Armbruster wrote:
Amit Shahamit.s...@redhat.com writes:
[...]
diff --git a/hw/qdev.c b/hw/qdev.c
index 6fc9b02..168d0f6 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -185,7 +185,8 @@ int
When the guest writes something to a host, we copied over the entire
buffer first into the host and then processed it. Do away with that, it
could result in a malicious guest causing a DoS on the host.
Reported-by: Paul Brook p...@codesourcery.com
Signed-off-by: Amit Shah amit.s...@redhat.com
Remove unnecessary braces around a case statement.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c |3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index d7fe68b..d0b9354 100644
--- a/hw/virtio-console.c
Instead of combining flush logic into the discard case and not discard
case, have one function doing discard case. This will help later when
adding flow control logic to the do_flush_queued_data() function.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c | 47
The initialisation for generic ports and console ports is similar.
Factor out the parts that are the same in a different function that can
be called from each of the initfns.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 31 ++-
1 files
.
Please apply.
v3:
- Move discard logic to a separate function
- Drop while-loop-rework patch as it's now no longer necessary with
the new discard logic
v2:
- drop the erroring out patch till we decide what's to be done
- remove goto usage.
Amit Shah (4):
virtio-console: Factor out common
indicates it can accept more data, start pushing!
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c | 11 +++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 7c12230..4c27e4c 100644
--- a/hw/virtio-console.c
Introduce a char-specific wrapper to qemu_set_fd_handler functions.
This wrapper is useful to add / remove a write handler easily. Write
handlers are only used when the backend is blocked and cannot receive
any more input.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c | 64
patches will enable the nonblocking and callback functionality.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c |3 +++
qemu-char.h |5 +
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 2420b6b..9a132b6 100644
--- a/qemu
Instead of passing each handler in the qemu_add_handlers() function,
create a struct of handlers that can be passed to the function instead.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
gdbstub.c|9 +++--
hw/debugcon.c|2 +-
hw/escc.c|9
is to be done. That involves
saving/restoring items from the VirtQueueElement struct, which needs a
bit of work.
Amit Shah (3):
virtio-serial: Let virtio-serial-bus know if all data was consumed
virtio-serial: Add support for flow control
virtio-console: Enable port throttling when chardev
in
the series shows.
I'll work on that once this is applied.
The virtio-console code will be the first user of this work, that
series will be sent shortly.
This series depends on the virtio-serial fixes and enhancements series
that I sent out a short while back.
Please review and apply,
Amit Shah (5
The have_data() API to hand off guest data to apps using virtio-serial
so far assumed all the data was consumed. Relax this assumption.
Future commits will allow for incomplete writes.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-console.c |4 ++--
hw/virtio-serial.h |7
The send_all function is modified to return to the caller in case the
driver cannot handle any more data. It returns -EAGAIN or
WSAEWOULDBLOCK on non-Windows and Windows platforms respectively. This
is only done when the caller sets a callback function handler indicating
it's not interested in
for
the TODO list.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c | 50 +--
hw/virtio-serial.h | 17
2 files changed, 56 insertions(+), 11 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio
and letting
users of chardevs know that a driver became writable again.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.c | 27 +++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 6e02334..55d442d 100644
--- a/qemu-char.c
On (Tue) Jan 11 2011 [15:39:46], Gerd Hoffmann wrote:
On 01/11/11 12:10, Amit Shah wrote:
Introduce a char-specific wrapper to qemu_set_fd_handler functions.
This wrapper is useful to add / remove a write handler easily. Write
handlers are only used when the backend is blocked and cannot
-by: Amit Shah amit.s...@redhat.com
---
hw/virtio-serial-bus.c | 13 ++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 74ba5ec..eb7b362 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -736,7 +736,7
On (Tue) Jan 11 2011 [16:54:48], Gerd Hoffmann wrote:
On 01/11/11 16:38, Amit Shah wrote:
On (Tue) Jan 11 2011 [15:39:46], Gerd Hoffmann wrote:
On 01/11/11 12:10, Amit Shah wrote:
Introduce a char-specific wrapper to qemu_set_fd_handler functions.
This wrapper is useful to add / remove
On (Tue) Jan 11 2011 [17:13:15], Blue Swirl wrote:
+static QemuChrHandlers gdb_handlers = {
+ .fd_can_read = gdb_chr_can_receive,
+ .fd_read = gdb_chr_receive,
+ .fd_event = gdb_chr_event,
+};
These structures should be const.
Hm, I had that but looks like it got lost in
On (Tue) Jan 11 2011 [14:38:00], Paolo Bonzini wrote:
On 01/11/2011 12:10 PM, Amit Shah wrote:
+char_set_fd_handlers(s-fd, tcp_chr_read_poll, tcp_chr_read,
+ char_write_unblocked, chr, poll_out);
Would the 4th parameter always be char_write_unblocked? If so, what
On (Wed) Jan 12 2011 [19:03:58], Blue Swirl wrote:
+static QemuChrHandlers null_handlers = {
+ /* All handlers are initialised to NULL */
+};
+
void qemu_chr_add_handlers(CharDriverState *s,
- IOCanReadHandler *fd_can_read,
-
If an iohandler is asked to be enabled but the handler doesn't exist,
don't enable the handler.
This can be used to simplify the conditions in main_loop_wait().
Signed-off-by: Amit Shah amit.s...@redhat.com
---
vl.c | 29 -
1 files changed, 20 insertions(+), 9
Add a get_iohandler() function instead of looking up the ioh twice in
qemu_set_fd_handler2().
Signed-off-by: Amit Shah amit.s...@redhat.com
---
vl.c | 44 ++--
1 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/vl.c b/vl.c
index 0292184
all the ops together
instead of passing individual ones to functions.
The older function, qemu_set_fd_handler2(), is now a wrapper to
assign_fd_handlers() and can be deprecated by converting the existing
usage to assign_fd_handlers().
Please apply.
Amit Shah (5):
iohandlers: Avoid code
a wrapper to assign_fd_handlers() with
NULL handlers.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.h |6 ++
vl.c| 24 +++-
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/qemu-char.h b/qemu-char.h
index e6ee6c4..0ef83f4 100644
Collect all the handlers in a IOHandlerOps struct instead of being
passed one at a time to each function.
Signed-off-by: Amit Shah amit.s...@redhat.com
---
qemu-char.h |7 ++-
vl.c| 51 ---
2 files changed, 34 insertions(+), 24
On (Thu) Jan 13 2011 [14:55:25], Gerd Hoffmann wrote:
On 01/13/11 14:00, Amit Shah wrote:
{
-return assign_fd_handlers(fd, fd_read_poll, fd_read, fd_write, opaque);
+assign_fd_handlers(fd, fd_read_poll, fd_read, fd_write, opaque);
+set_read_poll_fd_action(fd, true
On (Thu) Jan 13 2011 [15:02:37], Gerd Hoffmann wrote:
Hi,
+ioh-ops.fd_read_poll = ops-fd_read_poll;
+ioh-ops.fd_read = ops-fd_read;
+ioh-ops.fd_write = ops-fd_write;
You can write this as ioh-ops = *ops btw.
I guess the long-term plan (to be committed after killing the
On (Thu) Jan 13 2011 [14:59:26], Gerd Hoffmann wrote:
+int assign_fd_handlers(int fd,
+ IOCanReadHandler *fd_read_poll,
+ IOHandler *fd_read,
+ IOHandler *fd_write,
+ void *opaque);
+void
On (Thu) Jan 13 2011 [15:08:51], Gerd Hoffmann wrote:
On 01/13/11 15:00, Amit Shah wrote:
On (Thu) Jan 13 2011 [14:55:25], Gerd Hoffmann wrote:
On 01/13/11 14:00, Amit Shah wrote:
{
-return assign_fd_handlers(fd, fd_read_poll, fd_read, fd_write,
opaque);
+assign_fd_handlers(fd
- enable all specified handlers by default in assign_fd_handlers()
- Add comments for TODO items on deprecation of older interfaces.
Please apply.
Amit Shah (5):
iohandlers: Avoid code duplication
iohandlers: Introduce assign_fd_handlers() and remove_fd_handlers
iohandlers: Allow each
1 - 100 of 1938 matches
Mail list logo