Re: [Qemu-devel] [PATCH v2] wdt_i6300esb: fix vmstate versioning

2013-05-23 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH] wdt_i6300esb: fix vmstate versioning

2013-05-23 Thread Amit Shah
: Reviewed-by: Amit Shah amit.s...@redhat.com Amit

Re: [Qemu-devel] [PATCH v2] virtio-rng: Fix crash with non-default backend

2013-06-03 Thread Amit Shah
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-devel] [PULL v2][RESEND] char: fix segfault on chardev detach

2013-10-04 Thread Amit Shah
/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

Re: [Qemu-devel] [PULL v2][RESEND] char: fix segfault on chardev detach

2013-10-29 Thread Amit Shah
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

Re: [Qemu-devel] [PULL v2][RESEND] char: fix segfault on chardev detach

2013-10-29 Thread Amit Shah
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

Re: [Qemu-devel] [qemu-devel]question on virtqueue_get_avail_bytes

2013-09-04 Thread Amit Shah
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

[Qemu-devel] [PATCH 2/3] char: use common function to disable callbacks on chardev close

2013-09-05 Thread Amit Shah
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

[Qemu-devel] [PATCH 3/3] char: remove watch callback on chardev detach from frontend

2013-09-05 Thread Amit Shah
. 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

[Qemu-devel] [PATCH 1/3] char: move backends' io watch tag to CharDriverState

2013-09-05 Thread Amit Shah
-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

[Qemu-devel] [PULL] char: fix segfault on chardev detach

2013-09-05 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH v2] virtio-serial: Do not notify virtqueue if no element was pushed back.

2013-09-05 Thread Amit Shah
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 ---

[Qemu-devel] [PULL][RESEND] char: fix segfault on chardev detach

2013-09-24 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH RESEND for-1.6] virtio-console: Use exitfn for virtserialport, too

2013-08-01 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH 0/2] changes related to monitor flow control

2013-07-17 Thread 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

Re: [Qemu-devel] qemu-ga behavior on virtio-serial unplug

2013-06-20 Thread Amit Shah
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,

Re: [Qemu-devel] [PATCH] char: restore read callback on a reattached (hotplug) chardev

2013-12-05 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH RFC 1/2] rng-egd: improve egd backend performance

2013-12-16 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH V4] char: restore read callback on a reattached (hotplug) chardev

2013-12-16 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH RFC 1/2] rng-egd: improve egd backend performance

2013-12-16 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH RFC 1/2] rng-egd: improve egd backend performance

2013-12-17 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH V4] char: restore read callback on a reattached (hotplug) chardev

2013-12-17 Thread Amit Shah
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

Re: [Qemu-devel] [RFT] qemu 0.13.0-rc3

2010-10-13 Thread Amit Shah
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

Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework

2010-10-20 Thread Amit Shah
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

Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework

2010-10-22 Thread Amit Shah
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

Re: [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework

2010-10-27 Thread Amit Shah
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

Re: [Qemu-devel] Re: [RFC][RESEND][PATCH v1 02/15] virtproxy: qemu-vp, standalone daemon skeleton

2010-11-09 Thread Amit Shah
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

[Qemu-devel] [PATCH] virtio-serial-bus: Bump up control vq buffers to 32

2010-11-23 Thread Amit Shah
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

[Qemu-devel] Re: [RFC][PATCH v3 00/11] virtagent: host/guest RPC communication agent

2010-11-25 Thread Amit Shah
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.

[Qemu-devel] [PATCH 2/4] virtio-serial: Add description fields for qdev properties

2010-11-25 Thread Amit Shah
. 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

[Qemu-devel] [PATCH 3/4] net.h: Add description fields for qdev properites

2010-11-25 Thread Amit Shah
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

[Qemu-devel] [PATCH 4/4] block_int.h: Provide documentation for common block qdev properties

2010-11-25 Thread Amit Shah
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

[Qemu-devel] [PATCH v2] virtio-serial-bus: Bump up control vq descriptors to min. required

2010-11-29 Thread Amit Shah
-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

[Qemu-devel] [PATCH v8 1/7] virtio-console: Factor out common init between console and generic ports

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 2/7] char: Add a QemuChrHandlers struct to initialise chardev handlers

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 5/7] char: Update send_all() to handle nonblocking chardev write requests

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 0/7] char: non-blocking writes, virtio-console flow control

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 6/7] char: Equip the unix/tcp backend to handle nonblocking writes

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 3/7] char: Introduce char_set/remove_fd_handlers()

2010-12-01 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-01 Thread Amit Shah
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

[Qemu-devel] [PATCH v8 4/7] char: Add framework for a 'write unblocked' callback

2010-12-01 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-01 Thread Amit Shah
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; -

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-02 Thread Amit Shah
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);

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-05 Thread Amit Shah
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.

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-06 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-06 Thread Amit Shah
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

[Qemu-devel] [[PATCH][RESEND]] virtio-serial-bus: Bump up control vq descriptors to min. required

2010-12-07 Thread Amit Shah
-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

Re: [Qemu-devel] [PATCH v8 7/7] virtio-console: Enable port throttling when chardev is slow to consume data

2010-12-08 Thread Amit Shah
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

[Qemu-devel] [PATCH 0/5] virtio-serial: Trivial fixes, don't copy buffers to host

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH 1/5] virtio-console: Factor out common init between console and generic ports

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH 2/5] virtio-console: Remove unnecessary braces

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH 4/5] virtio-serial: Don't copy over guest buffer to host

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH 3/5] virtio-serial: Simplify condition for a while loop

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH 5/5] virtio-serial: Error out if guest sends unexpected vq elements

2010-12-10 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 5/5] virtio-serial: Error out if guest sends unexpected vq elements

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH v2 4/4] virtio-serial: Don't copy over guest buffer to host

2010-12-10 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 4/5] virtio-serial: Don't copy over guest buffer to host

2010-12-10 Thread Amit Shah
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.

[Qemu-devel] [PATCH v2 0/4] virtio-serial: Trivial fixes, don't copy buffers to host

2010-12-10 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 4/5] virtio-serial: Don't copy over guest buffer to host

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH v2 1/4] virtio-console: Factor out common init between console and generic ports

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [PATCH v2 3/4] virtio-serial: Simplify condition for a while loop

2010-12-10 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 5/5] virtio-serial: Error out if guest sends unexpected vq elements

2010-12-10 Thread Amit Shah
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

[Qemu-devel] [[PATCH][RESEND]] virtio-serial-bus: Bump up control vq descriptors to min. required

2011-01-04 Thread Amit Shah
-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

[Qemu-devel] [PATCH 0/4] [RESEND] [REBASE] Auto-document qdev devices

2011-01-04 Thread Amit Shah
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

[Qemu-devel] [PATCH 2/4] virtio-serial: Add description fields for qdev properties

2011-01-04 Thread Amit Shah
. 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

[Qemu-devel] [PATCH 4/4] block_int.h: Provide documentation for common block qdev properties

2011-01-04 Thread Amit Shah
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

[Qemu-devel] [PATCH 3/4] net.h: Add description fields for qdev properites

2011-01-04 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH 1/4] qdev: Add a description field for qdev properties for documentation

2011-01-10 Thread Amit Shah
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

[Qemu-devel] [PATCH v3 4/4] virtio-serial: Don't copy over guest buffer to host

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH v3 2/4] virtio-console: Remove unnecessary braces

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH v3 3/4] virtio-serial-bus: separate out discard logic in a separate function

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH v3 1/4] virtio-console: Factor out common init between console and generic ports

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH v3 0/4] virtio-serial: Trivial fixes, don't copy buffers to host

2011-01-11 Thread Amit Shah
. 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

[Qemu-devel] [PATCH 3/3] virtio-console: Enable port throttling when chardev is slow to consume data

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 2/5] char: Introduce char_set/remove_fd_handlers()

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 3/5] char: Add framework for a 'write unblocked' callback

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 1/5] char: Add a QemuChrHandlers struct to initialise chardev handlers

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 0/3] virtio-serial: Flow control

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH v9 0/5] char: Add support for nonblocking writes

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 1/3] virtio-serial: Let virtio-serial-bus know if all data was consumed

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 4/5] char: Update send_all() to handle nonblocking chardev write requests

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 2/3] virtio-serial: Add support for flow control

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH 5/5] char: Equip the unix/tcp backend to handle nonblocking writes

2011-01-11 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 2/5] char: Introduce char_set/remove_fd_handlers()

2011-01-11 Thread Amit Shah
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

[Qemu-devel] [PATCH][RESEND] virtio-serial-bus: Bump up control vq descriptors to min. required

2011-01-11 Thread Amit Shah
-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

[Qemu-devel] Re: [PATCH 2/5] char: Introduce char_set/remove_fd_handlers()

2011-01-11 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH 1/5] char: Add a QemuChrHandlers struct to initialise chardev handlers

2011-01-11 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 5/5] char: Equip the unix/tcp backend to handle nonblocking writes

2011-01-11 Thread Amit Shah
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

Re: [Qemu-devel] [PATCH 1/5] char: Add a QemuChrHandlers struct to initialise chardev handlers

2011-01-12 Thread Amit Shah
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, -                          

[Qemu-devel] [PATCH 4/5] iohandlers: Enable an iohandler only if the associated handler exists

2011-01-13 Thread Amit Shah
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

[Qemu-devel] [PATCH 1/5] iohandlers: Avoid code duplication

2011-01-13 Thread Amit Shah
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

[Qemu-devel] [PATCH 0/5] iohandlers: Add support for enabling/disabling individual handlers

2011-01-13 Thread Amit Shah
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

[Qemu-devel] [PATCH 2/5] iohandlers: Introduce assign_fd_handlers() and remove_fd_handlers

2011-01-13 Thread Amit Shah
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

[Qemu-devel] [PATCH 5/5] iohandlers: Add IOHandlerOps struct

2011-01-13 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 3/5] iohandlers: Allow each iohandler to be enabled/disabled individually

2011-01-13 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 5/5] iohandlers: Add IOHandlerOps struct

2011-01-13 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 2/5] iohandlers: Introduce assign_fd_handlers() and remove_fd_handlers

2011-01-13 Thread Amit Shah
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

[Qemu-devel] Re: [PATCH 3/5] iohandlers: Allow each iohandler to be enabled/disabled individually

2011-01-13 Thread Amit Shah
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

[Qemu-devel] [PATCH v2 0/5] iohandlers: Add support for enabling/disabling individual handlers

2011-01-13 Thread Amit Shah
- 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   2   3   4   5   6   7   8   9   10   >