[Qemu-devel] [PATCH 5/5] atapi: Implement 'media' subcommand of GET_EVENT_STATUS_NOTIFICATION command

2011-04-08 Thread Amit Shah
terribly. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 93 +++- hw/ide/internal.h |6 +++ 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index cdc2c56..627b2cf 100644 --- a/hw/ide

[Qemu-devel] [PATCH 1/2] atapi: Drives can be locked without media present

2011-04-09 Thread Amit Shah
Drivers are free to lock drives without any media present. Such a condition should not result in an error condition. See Table 341 in MMC-5 spec for details. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff

[Qemu-devel] [PATCH 2/2] atapi: Report correct errors on guest eject request

2011-04-09 Thread Amit Shah
Table 629 of the MMC-5 spec mentions two different error conditions when a CDROM eject is requested: a) while a disc is inserted and b) while a disc is not inserted. Ensure we return the appropriate error for the present condition of the drive and disc status. Signed-off-by: Amit Shah amit.s

[Qemu-devel] Re: [PATCH 3/5] atapi: GESN: Spin off No Event Available handling into own function

2011-04-09 Thread Amit Shah
On (Fri) 08 Apr 2011 [15:31:49], Kevin Wolf wrote: Am 08.04.2011 09:15, schrieb Amit Shah: Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available status in its own function. Also ensure the buffer the driver sent us is big enough to fill in all the data we have -- else just fill

[Qemu-devel] Re: [PATCH 4/5] atapi: GESN: Add enums for commonly-used field types

2011-04-09 Thread Amit Shah
On (Fri) 08 Apr 2011 [16:21:38], Kevin Wolf wrote: Am 08.04.2011 09:15, schrieb Amit Shah: Instead of using magic numbers, use enums that are more descriptive of the fields being used. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 11 +-- 1 files

[Qemu-devel] Re: [PATCH 5/5] atapi: Implement 'media' subcommand of GET_EVENT_STATUS_NOTIFICATION command

2011-04-09 Thread Amit Shah
On (Fri) 08 Apr 2011 [18:17:38], Kevin Wolf wrote: Am 08.04.2011 09:15, schrieb Amit Shah: Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION command. This helps us report tray open, tray closed, no media, media present states to the guest. Newer Linux kernels

[Qemu-devel] Re: To O_EXCL or not to O_EXCL open host_cdrom

2011-04-10 Thread Amit Shah
On (Fri) 08 Apr 2011 [12:33:27], Stefan Hajnoczi wrote: Amit and I were discussing the pros and cons of using O_EXCL to open host CD-ROM devices on IRC but this discussion could benefit from more input. Linux block devices (like /dev/sr0 CD-ROMs) can be opened with O_EXCL and only one

Re: [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GESN

2011-04-11 Thread Amit Shah
On (Fri) 08 Apr 2011 [11:39:26], Markus Armbruster wrote: Results of quick test run now, patch review to follow. Test uses a simple program to try ioctl CDROM_DRIVE_STATUS (attached). ... Test in guest without your patches: [start with empty drive] # ./drive-status

Re: [Qemu-devel] [PATCH 0/5] atapi: Implement 'media' subcommand for GESN

2011-04-11 Thread Amit Shah
On (Mon) 11 Apr 2011 [15:46:33], Markus Armbruster wrote: Amit Shah amit.s...@redhat.com writes: On (Fri) 08 Apr 2011 [11:39:26], Markus Armbruster wrote: Results of quick test run now, patch review to follow. Test uses a simple program to try ioctl CDROM_DRIVE_STATUS (attached

[Qemu-devel] [PATCH v2 0/6] atapi: Implement 'media' subcommand for GESN

2011-04-12 Thread Amit Shah
/close notification (from Markus) RFC: - Orig. series Amit Shah (6): atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function atapi: GESN: Spin off No Event Available handling into own function atapi

[Qemu-devel] [PATCH v2 1/6] atapi: Allow GESN after media change

2011-04-12 Thread Amit Shah
After a media change, the only commands allowed from the guest were REQUEST_SENSE and INQUIRY. The guest may also issue GET_EVENT_STATUS_NOTIFICATION commands to get media changed notification. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 19 +-- 1 files

[Qemu-devel] [PATCH v2 2/6] atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function

2011-04-12 Thread Amit Shah
This makes the code more readable. Also, there's a block like: if () { ... } else { ... } Split that into if () { ... return; } ... Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 37 - 1 files changed, 24 insertions(+), 13

[Qemu-devel] [PATCH v2 3/6] atapi: GESN: Spin off No Event Available handling into own function

2011-04-12 Thread Amit Shah
Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available status in its own function. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 21 +++-- 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index d71bc41..c5913d8

[Qemu-devel] [PATCH v2 4/6] atapi: GESN: Use structs for commonly-used field types

2011-04-12 Thread Amit Shah
Instead of using magic numbers, use structs that are more descriptive of the fields being used. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index c5913d8

[Qemu-devel] [PATCH v2 6/6] atapi: Save / load the new GESN event states during migration

2011-04-12 Thread Amit Shah
Add a new subsection to save and restore the events state for the GET_EVENT_STATUS_NOTIFICATION command. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c

[Qemu-devel] [PATCH v2 5/6] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
terribly. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 92 +++- hw/ide/internal.h |6 +++ 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index fe50d8a..2683070 100644 --- a/hw/ide

[Qemu-devel] [PATCH v3 0/5] atapi: Implement 'media' subcommand for GESN

2011-04-12 Thread Amit Shah
into more patches - Add tray open/close notification (from Markus) RFC: - Orig. series Amit Shah (5): atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function atapi: GESN: Use structs for commonly-used field

[Qemu-devel] [PATCH v3 1/5] atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change

2011-04-12 Thread Amit Shah
After a media change, the only commands allowed from the guest were REQUEST_SENSE and INQUIRY. The guest may also issue GET_EVENT_STATUS_NOTIFICATION commands to get media changed notification. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 20 ++-- 1 files

[Qemu-devel] [PATCH v3 2/5] atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function

2011-04-12 Thread Amit Shah
This makes the code more readable. Also, there's a block like: if () { ... } else { ... } Split that into if () { ... return; } ... Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 37 - 1 files changed, 24 insertions(+), 13

[Qemu-devel] [PATCH v3 3/5] atapi: GESN: Use structs for commonly-used field types

2011-04-12 Thread Amit Shah
Instead of using magic numbers, use structs that are more descriptive of the fields being used. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index

[Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions

2011-04-12 Thread Amit Shah
Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a generic way so that future additions to the code to handle other response types is easier. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 24 +++- 1 files changed, 19 insertions(+), 5

[Qemu-devel] [PATCH v3 5/5] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
terribly. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 109 ++-- hw/ide/internal.h |6 +++ 2 files changed, 110 insertions(+), 5 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index a9bc1e3..1b2ed6a 100644 --- a/hw

Re: [Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions

2011-04-12 Thread Amit Shah
On (Tue) 12 Apr 2011 [15:09:33], Kevin Wolf wrote: Am 12.04.2011 13:43, schrieb Amit Shah: Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a generic way so that future additions to the code to handle other response types is easier. Signed-off-by: Amit Shah amit.s

Re: [Qemu-devel] [PATCH v3 3/5] atapi: GESN: Use structs for commonly-used field types

2011-04-12 Thread Amit Shah
On (Tue) 12 Apr 2011 [15:10:39], Markus Armbruster wrote: Amit Shah amit.s...@redhat.com writes: Instead of using magic numbers, use structs that are more descriptive of the fields being used. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 22

[Qemu-devel] [PATCH v4 0/5] atapi: Implement 'media' subcommand for GESN

2011-04-12 Thread Amit Shah
- Use struct instead of enum for cdb packet - Add a new subsection to vmstate for new fields for save/restore v1: - Split into more patches - Add tray open/close notification (from Markus) RFC: - Orig. series Amit Shah (5): atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change

[Qemu-devel] [PATCH v4 1/5] atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change

2011-04-12 Thread Amit Shah
After a media change, the only commands allowed from the guest were REQUEST_SENSE and INQUIRY. The guest may also issue GET_EVENT_STATUS_NOTIFICATION commands to get media changed notification. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 20 ++-- 1 files

[Qemu-devel] [PATCH v4 2/5] atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function

2011-04-12 Thread Amit Shah
This makes the code more readable. Also, there's a block like: if () { ... } else { ... } Split that into if () { ... return; } ... Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 37 - 1 files changed, 24 insertions(+), 13

[Qemu-devel] [PATCH v4 3/5] atapi: GESN: Use structs for commonly-used field types

2011-04-12 Thread Amit Shah
Instead of using magic numbers, use structs that are more descriptive of the fields being used. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 5b64676

[Qemu-devel] [PATCH v4 4/5] atapi: GESN: Standardise event response handling for future additions

2011-04-12 Thread Amit Shah
Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a generic way so that future additions to the code to handle other response types is easier. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 25 +++-- 1 files changed, 19 insertions

[Qemu-devel] [PATCH v4 5/5] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
terribly. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 109 ++-- hw/ide/internal.h |6 +++ 2 files changed, 110 insertions(+), 5 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index dafc049..209d8e6 100644 --- a/hw

Re: [Qemu-devel] [PATCH v3 4/5] atapi: GESN: Standardise event response handling for future additions

2011-04-12 Thread Amit Shah
On (Tue) 12 Apr 2011 [16:07:23], Kevin Wolf wrote: Am 12.04.2011 15:59, schrieb Amit Shah: On (Tue) 12 Apr 2011 [15:09:33], Kevin Wolf wrote: Am 12.04.2011 13:43, schrieb Amit Shah: Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a generic way so that future

Re: [Qemu-devel] [PATCH v4 5/5] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
On (Tue) 12 Apr 2011 [16:54:53], Kevin Wolf wrote: Am 12.04.2011 16:09, schrieb Amit Shah: Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION command. This helps us report tray open, tray closed, no media, media present states to the guest. Newer Linux kernels

Re: [Qemu-devel] [PATCH v4 5/5] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
On (Tue) 12 Apr 2011 [20:33:39], Amit Shah wrote: On (Tue) 12 Apr 2011 [16:54:53], Kevin Wolf wrote: Am 12.04.2011 16:09, schrieb Amit Shah: Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION command. This helps us report tray open, tray closed, no media, media

Re: [Qemu-devel] [PATCH v4 5/5] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
On (Tue) 12 Apr 2011 [17:11:22], Kevin Wolf wrote: Am 12.04.2011 17:03, schrieb Amit Shah: On (Tue) 12 Apr 2011 [16:54:53], Kevin Wolf wrote: Am 12.04.2011 16:09, schrieb Amit Shah: Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATION command. This helps us report tray

[Qemu-devel] [PATCH v5 0/5] atapi: Implement 'media' subcommand for GESN

2011-04-12 Thread Amit Shah
for save/restore v1: - Split into more patches - Add tray open/close notification (from Markus) RFC: - Orig. series Amit Shah (5): atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function atapi: GESN

[Qemu-devel] [PATCH v5 1/5] atapi: Allow GET_EVENT_STATUS_NOTIFICATION after media change

2011-04-12 Thread Amit Shah
After a media change, the only commands allowed from the guest were REQUEST_SENSE and INQUIRY. The guest may also issue GET_EVENT_STATUS_NOTIFICATION commands to get media changed notification. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 20 ++-- 1 files

[Qemu-devel] [PATCH v5 2/5] atapi: Move GET_EVENT_STATUS_NOTIFICATION command handling to its own function

2011-04-12 Thread Amit Shah
This makes the code more readable. Also, there's a block like: if () { ... } else { ... } Split that into if () { ... return; } ... Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 37 - 1 files changed, 24 insertions(+), 13

[Qemu-devel] [PATCH v5 3/5] atapi: GESN: Use structs for commonly-used field types

2011-04-12 Thread Amit Shah
Instead of using magic numbers, use structs that are more descriptive of the fields being used. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 5b64676

[Qemu-devel] [PATCH v5 4/5] atapi: GESN: Standardise event response handling for future additions

2011-04-12 Thread Amit Shah
Handle GET_EVENT_STATUS_NOTIFICATION's No Event Available response in a generic way so that future additions to the code to handle other response types is easier. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 25 +++-- 1 files changed, 19 insertions

[Qemu-devel] [PATCH v5 5/5] atapi: GESN: implement 'media' subcommand

2011-04-12 Thread Amit Shah
terribly. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 113 +++-- hw/ide/internal.h |6 +++ 2 files changed, 115 insertions(+), 4 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index dafc049..faf7004 100644 --- a/hw

[Qemu-devel] [PATCH] atapi: Indicate 'medium not ready' to 'medium ready' transition via error

2011-04-15 Thread Amit Shah
res 01/60:00:00:00:00/00:00:00:00:00/a0 Emask 0x3 (HSM violation) ata2.00: status: { ERR } ata2: soft resetting link ata2.00: configured for MWDMA2 ata2: EH complete Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 32 ++-- 1 files changed, 26

Re: [Qemu-devel] [PATCH] atapi: Indicate 'medium not ready' to 'medium ready' transition via error

2011-04-15 Thread Amit Shah
On (Fri) 15 Apr 2011 [13:05:00], Kevin Wolf wrote: Am 15.04.2011 11:33, schrieb Amit Shah: MMC-5 Table F.1 lists errors that can be thrown for the TEST_UNIT_READY command. Going from medium not ready to medium ready states is communicated by throwing an error. This adds the missing

Re: [Qemu-devel] [RFC PATCH] block: Fix eject -f for locked devices

2011-04-15 Thread Amit Shah
On (Fri) 18 Feb 2011 [16:16:07], Markus Armbruster wrote: From 8cd4978c9be6ff2bcc414bb1c1b258b96b9a74c1 Mon Sep 17 00:00:00 2001 From: Markus Armbruster arm...@redhat.com Date: Fri, 18 Feb 2011 15:54:02 +0100 After forcefully ejecting media locked by the guest, you can't ever again insert

[Qemu-devel] [PATCH] atapi: Add 'medium ready' to 'medium not ready' transition on cd change

2011-04-18 Thread Amit Shah
res 01/60:00:00:00:00/00:00:00:00:00/a0 Emask 0x3 (HSM violation) ata2.00: status: { ERR } ata2: soft resetting link ata2.00: configured for MWDMA2 ata2: EH complete Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/core.c | 20 1 files changed, 16 insertions

Re: [Qemu-devel] [PATCH 5/5] ide/atapi: Introduce NEED_DISK flag for commands

2011-04-19 Thread Amit Shah
On (Tue) 19 Apr 2011 [14:36:43], Kevin Wolf wrote: diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 032d1b0..88e7791 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -813,11 +813,7 @@ error_cmd: static void cmd_test_unit_ready(IDEState *s, uint8_t *buf) { -if

Re: [Qemu-devel] [PATCH 3/5] ide/atapi: Use table instead of switch for commands

2011-04-19 Thread Amit Shah
On (Tue) 19 Apr 2011 [14:36:41], Kevin Wolf wrote: +struct { +void (*handler)(IDEState *s, uint8_t *buf); +int flags; +} atapi_cmd_table[0x100] = { +[ 0x00 ] = { cmd_test_unit_ready, 0 }, +[ 0x03 ] = { cmd_request_sense, ALLOW_UA }, +[ 0x12

Re: [Qemu-devel] [PATCH 0/5] atapi: Some code restructuring

2011-04-19 Thread Amit Shah
On (Tue) 19 Apr 2011 [14:36:38], Kevin Wolf wrote: Not marking this as an RFC because I want to commit itif everyone is happy with it. Otherwise please treat it like an RFC. I don't mind too much if you think we shouldn't do this, it's just an option for which I wanted to try what it would

Re: [Qemu-devel] [PATCH] virtio-serial: Fix endianness bug in the config space

2011-04-20 Thread Amit Shah
On (Tue) 19 Apr 2011 [12:03:46], David Gibson wrote: From: Alexey Kardashevskiy a...@ozlabs.ru The virtio serial specification requres that the values in the config space are encoded in native endian of the guest. The qemu virtio-serial code did not do conversion to the guest endian

Re: [Qemu-devel] [PATCH] char: Allow devices to use a single multiplexed chardev.

2011-04-25 Thread Amit Shah
On (Fri) 22 Apr 2011 [21:59:42], Kusanagi Kouichi wrote: This fixes regression caused by commit 2d6c1ef40f3678ab47a4d14fb5dadaa486bfcda6 (char: Prevent multiple devices opening same chardev). What's the regression? How do I test it? Signed-off-by: Kusanagi Kouichi sl...@ac.auone-net.jp ---

Re: [Qemu-devel] [PATCH v2 1/5] ide: Split atapi.c out

2011-04-25 Thread Amit Shah
/ide/atapi.c @@ -0,0 +1,1083 @@ +/* + * QEMU ATAPI Emulatoin typo here. + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2006 Openedhand Ltd. Could you also add Copyright (C) 2011 Red Hat Inc. Copyright (C) 2011 Amit Shah amit.s...@redhat.com snip + +static void lba_to_msf

Re: [Qemu-devel] [PATCH v2 3/5] ide/atapi: Use table instead of switch for commands

2011-04-25 Thread Amit Shah
On (Wed) 20 Apr 2011 [13:30:13], Kevin Wolf wrote: Signed-off-by: Kevin Wolf kw...@redhat.com --- hw/ide/atapi.c | 115 +++ 1 files changed, 48 insertions(+), 67 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index

Re: [Qemu-devel] [PATCH v2 5/5] ide/atapi: Introduce CHECK_READY flag for commands

2011-04-25 Thread Amit Shah
On (Wed) 20 Apr 2011 [13:30:15], Kevin Wolf wrote: Some commands are supposed to report a Not Ready Conmdition (i.e. they require typo in Condition Amit

Re: [Qemu-devel] [PATCH 0/3] spicevmc - chardev: restore guest open / close (v2)

2011-04-25 Thread Amit Shah
On (Thu) 24 Mar 2011 [11:12:01], Hans de Goede wrote: Hi All, When we moved from the spicevmc device (which directly implemented a virtio serial port) to doing spicevmc as a chardev backend we lost the notification of the guest opening / closing the port to spice server. This causes the

Re: [Qemu-devel] [PATCH] char: Allow devices to use a single multiplexed chardev.

2011-04-25 Thread Amit Shah
On (Tue) 26 Apr 2011 [00:30:28], Kusanagi Kouichi wrote: On 2011-04-25 15:27:20 +0530, Amit Shah wrote: On (Fri) 22 Apr 2011 [21:59:42], Kusanagi Kouichi wrote: This fixes regression caused by commit 2d6c1ef40f3678ab47a4d14fb5dadaa486bfcda6 (char: Prevent multiple devices opening same

[Qemu-devel] [PULL] char, virtio-serial, spice

2011-04-28 Thread Amit Shah
in the config space Amit Shah (1): char: Detect chardev release by NULL handlers as well as NULL opaque Hans de Goede (3): chardev: Allow frontends to notify backends of guest open / close virtio-console: notify backend of guest open / close spice-chardev: listen to frontend guest open / close

[Qemu-devel] [PATCH 3/6] spice-chardev: listen to frontend guest open / close

2011-04-28 Thread Amit Shah
...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com --- spice-qemu-char.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/spice-qemu-char.c b/spice-qemu-char.c index 517f337..fa15a71 100644 --- a/spice-qemu-char.c +++ b/spice-qemu-char.c @@ -131,6 +131,18

[Qemu-devel] [PATCH 1/6] chardev: Allow frontends to notify backends of guest open / close

2011-04-28 Thread Amit Shah
to listen to this. Signed-off-by: Hans de Goede hdego...@redhat.com Reviewed-by: Alon Levy al...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com --- qemu-char.c | 17 + qemu-char.h |4 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu-char.c b

[Qemu-devel] [PATCH 2/6] virtio-console: notify backend of guest open / close

2011-04-28 Thread Amit Shah
From: Hans de Goede hdego...@redhat.com Signed-off-by: Hans de Goede hdego...@redhat.com Reviewed-by: Alon Levy al...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio-console.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 4/6] char: Allow devices to use a single multiplexed chardev.

2011-04-28 Thread Amit Shah
virtconsole,chardev=stdio -device isa-serial,chardev=stdio fails with: qemu-system-x86_64: -device isa-serial,chardev=stdio: Property 'isa-serial.chardev' can't take value 'stdio', it's in use Signed-off-by: Kusanagi Kouichi sl...@ac.auone-net.jp Signed-off-by: Amit Shah amit.s...@redhat.com

[Qemu-devel] [PATCH 5/6] char: Detect chardev release by NULL handlers as well as NULL opaque

2011-04-28 Thread Amit Shah
Juan says he prefers these extra checks to ensure a user of a chardev is releasing it. Requested-by: Juan Quintela quint...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com --- qemu-char.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/qemu-char.c b/qemu-char.c

[Qemu-devel] [PATCH 6/6] virtio-serial: Fix endianness bug in the config space

2011-04-28 Thread Amit Shah
Signed-off-by: David Gibson da...@gibson.dropbear.id.au Reviewed-by: Juan Quintela quint...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio-serial-bus.c | 23 +-- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw

[Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place

2011-04-28 Thread Amit Shah
Move misplaced comment for media_is_dvd() Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/atapi.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 690a0ab..86b18d8 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -71,12

[Qemu-devel] [PATCH 2/2] atapi: Explain why we need a 'media not present' state

2011-04-28 Thread Amit Shah
After the re-org of the atapi code, it might not be intuitive for a reader of the code to understand why we're inserting a 'media not present' state between cd changes. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/ide/atapi.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions

Re: [Qemu-devel] [PATCHv3] virtio-serial-bus: use bh for unthrottling

2011-04-29 Thread Amit Shah
On (Fri) 29 Apr 2011 [14:25:06], Alon Levy wrote: Instead of calling flush_queued_data when unthrottling, schedule a bh. That way we can return immediately to the caller, and the flush uses the same call path as a have_data for callbackee. No migration change is required because bh are

Re: [Qemu-devel] [PATCHv3] virtio-serial-bus: use bh for unthrottling

2011-04-29 Thread Amit Shah
On (Fri) 29 Apr 2011 [14:25:06], Alon Levy wrote: Instead of calling flush_queued_data when unthrottling, schedule a bh. That way we can return immediately to the caller, and the flush uses the same call path as a have_data for callbackee. No migration change is required because bh are

Re: [Qemu-devel] [PATCHv3] virtio-serial-bus: use bh for unthrottling

2011-05-02 Thread Amit Shah
On (Sat) 30 Apr 2011 [11:23:42], Alon Levy wrote: On Fri, Apr 29, 2011 at 06:26:49PM +0530, Amit Shah wrote: On (Fri) 29 Apr 2011 [14:25:06], Alon Levy wrote: Instead of calling flush_queued_data when unthrottling, schedule a bh. That way we can return immediately to the caller

Re: [Qemu-devel] [RFC PATCH 0/6] virtio-trace: Support virtio-trace

2012-07-26 Thread Amit Shah
On (Tue) 24 Jul 2012 [11:36:57], Yoshihiro YUNOMAE wrote: Hi All, The following patch set provides a low-overhead system for collecting kernel tracing data of guests by a host in a virtualization environment. A guest OS generally shares some devices with other guests or a host, so reasons

Re: [Qemu-devel] [PATCH 0/3] Introduce virtqueue_get_avail_bytes()

2012-07-26 Thread Amit Shah
On (Fri) 06 Jul 2012 [16:07:06], Amit Shah wrote: The current virtqueue_avail_bytes() is a weird API: it's oddly-named: doesn't tell us what the API is going to do, and also suits just one use-case (that in virtio-net.c). Introduce virtqueue_get_avail_bytes(), which returns the number

Re: [Qemu-devel] [RFC PATCH 0/6] virtio-trace: Support virtio-trace

2012-07-27 Thread Amit Shah
On (Fri) 27 Jul 2012 [17:55:11], Yoshihiro YUNOMAE wrote: Hi Amit, Thank you for commenting on our work. (2012/07/26 20:35), Amit Shah wrote: On (Tue) 24 Jul 2012 [11:36:57], Yoshihiro YUNOMAE wrote: [...] Therefore, we propose a new system virtio-trace, which uses enhanced virtio

Re: [Qemu-devel] [RFC PATCH 1/6] virtio/console: Add splice_write support

2012-08-09 Thread Amit Shah
. Signed-off-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com Cc: Amit Shah amit.s...@redhat.com Cc: Arnd Bergmann a...@arndb.de Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- +/* Faster zero-copy write by splicing */ +static ssize_t port_fops_splice_write(struct pipe_inode_info

Re: [Qemu-devel] [RFC PATCH 2/6] virtio/console: Add a failback for unstealable pipe buffer

2012-08-09 Thread Amit Shah
splice(). Signed-off-by: Masami Hiramatsu masami.hiramatsu...@hitachi.com Cc: Amit Shah amit.s...@redhat.com Cc: Arnd Bergmann a...@arndb.de Cc: Greg Kroah-Hartman gre...@linuxfoundation.org --- drivers/char/virtio_console.c | 28 +--- 1 files changed, 25 insertions

Re: [Qemu-devel] [RFC PATCH 2/6] virtio/console: Add a failback for unstealable pipe buffer

2012-08-09 Thread Amit Shah
On (Thu) 09 Aug 2012 [18:24:58], Masami Hiramatsu wrote: (2012/08/09 18:03), Amit Shah wrote: On (Tue) 24 Jul 2012 [11:37:18], Yoshihiro YUNOMAE wrote: From: Masami Hiramatsu masami.hiramatsu...@hitachi.com Add a failback memcpy path for unstealable pipe buffer. If buf-ops-steal() fails

Re: [Qemu-devel] [RFC PATCH 2/6] virtio/console: Add a failback for unstealable pipe buffer

2012-08-09 Thread Amit Shah
On (Thu) 09 Aug 2012 [12:58:13], Avi Kivity wrote: On 08/09/2012 12:55 PM, Amit Shah wrote: On (Thu) 09 Aug 2012 [18:24:58], Masami Hiramatsu wrote: (2012/08/09 18:03), Amit Shah wrote: On (Tue) 24 Jul 2012 [11:37:18], Yoshihiro YUNOMAE wrote: From: Masami Hiramatsu masami.hiramatsu

Re: [Qemu-devel] [RFC PATCH 0/6] virtio-trace: Support virtio-trace

2012-08-09 Thread Amit Shah
Hi, On (Tue) 24 Jul 2012 [11:36:57], Yoshihiro YUNOMAE wrote: Hi All, The following patch set provides a low-overhead system for collecting kernel tracing data of guests by a host in a virtualization environment. So I just have one minor comment, please post a non-RFC version of the patch.

Re: [Qemu-devel] [PATCH 4/4] virtio-rng: hardware random number generator device

2012-06-26 Thread Amit Shah
On (Mon) 25 Jun 2012 [17:59:28], Anthony Liguori wrote: On 06/25/2012 05:46 PM, Anthony Liguori wrote: From: Amit Shahamit.s...@redhat.com diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c +static void virtio_rng_class_init(ObjectClass *klass, void *data) +{ +DeviceClass *dc =

Re: [Qemu-devel] [PATCH 4/4] virtio-rng: hardware random number generator device

2012-06-26 Thread Amit Shah
On (Tue) 26 Jun 2012 [08:01:20], Anthony Liguori wrote: +/* Send data from a char device over to the guest */ +static void chr_read(void *opaque, const void *buf, size_t size) +{ +VirtIORNG *vrng = opaque; +size_t len; +int offset; + +if (!is_guest_ready(vrng)) { +

Re: [Qemu-devel] [RFC PATCH 0/4] virtio-rng and RngBackend infrastructure (v2)

2012-07-04 Thread Amit Shah
On (Sun) 01 Jul 2012 [23:06:36], Paul Brook wrote: This series depends on my QOM -object series that I just posted. In Amit's thread on virtio-rng, danpb mentioned that we really ought to have a proper RNG backend infrastructure and of course he's correct on that. Now that we have

[Qemu-devel] [PATCH 0/3] Introduce virtqueue_get_avail_bytes()

2012-07-06 Thread Amit Shah
/load of state for migration) isn't necessary. The virtio-serial-bus code becomes better too, that's patch 3 here. Please apply, Amit Shah (3): virtio: use unsigned int for counting bytes in vq virtio: Introduce virtqueue_get_avail_bytes() virtio-serial-bus: let chardev know the exact number

[Qemu-devel] [PATCH 3/3] virtio-serial-bus: let chardev know the exact number of bytes requested

2012-07-06 Thread Amit Shah
to the guest. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio-serial-bus.c | 11 +++ 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 96382a4..44d5862 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial

[Qemu-devel] [PATCH 1/3] virtio: use unsigned int for counting bytes in vq

2012-07-06 Thread Amit Shah
The virtqueue_avail_bytes() function counts bytes in an int. Use an unsigned int instead. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio.c b/hw/virtio.c index 168abe4..b21dcac 100644 --- a/hw

[Qemu-devel] [PATCH 2/3] virtio: Introduce virtqueue_get_avail_bytes()

2012-07-06 Thread Amit Shah
the number of bytes for buffers marked for both, in as well as out. virtqueue_avail_bytes() is made a wrapper over this new function. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio.c | 28 +--- hw/virtio.h |5 - 2 files changed, 25 insertions(+), 8

Re: [Qemu-devel] [PATCH 4/4] virtio-rng: hardware random number generator device

2012-07-06 Thread Amit Shah
On (Tue) 26 Jun 2012 [08:01:20], Anthony Liguori wrote: On 06/26/2012 05:48 AM, Amit Shah wrote: On (Mon) 25 Jun 2012 [17:59:28], Anthony Liguori wrote: On 06/25/2012 05:46 PM, Anthony Liguori wrote: From: Amit Shahamit.s...@redhat.com diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c

Re: [Qemu-devel] [PATCH 0/3] Introduce virtqueue_get_avail_bytes()

2012-07-16 Thread Amit Shah
On (Fri) 06 Jul 2012 [16:07:06], Amit Shah wrote: The current virtqueue_avail_bytes() is a weird API: it's oddly-named: doesn't tell us what the API is going to do, and also suits just one use-case (that in virtio-net.c). Introduce virtqueue_get_avail_bytes(), which returns the number

Re: [Qemu-devel] [PATCH 22/28] virtio-serial: convert to QEMU Object Model

2012-01-24 Thread Amit Shah
On (Tue) 24 Jan 2012 [13:33:14], Anthony Liguori wrote: diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 982ffbf..edf54d7 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -157,7 +157,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port,

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

2012-02-10 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/ccid-card-passthru.c | 11 +++ hw/debugcon.c

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

2012-02-10 Thread Amit Shah
On (Fri) 10 Feb 2012 [07:28:19], Anthony Liguori wrote: On 02/10/2012 07:19 AM, Amit Shah wrote: 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 Shahamit.s...@redhat.com Why

Re: [Qemu-devel] [PATCH 0/2 v3] kvm: notify host when guest panicked

2012-04-02 Thread Amit Shah
On (Mon) 02 Apr 2012 [18:05:45], Wen Congyang wrote: At 03/19/2012 03:33 PM, Wen Congyang Wrote: At 03/08/2012 03:57 PM, Wen Congyang Wrote: We can know the guest is paniced when the guest runs on xen. But we do not have such feature on kvm. Another purpose of this feature is:

Re: [Qemu-devel] [PATCH v2 1/1] virtio-rng: hardware random number generator device

2012-06-05 Thread Amit Shah
On (Mon) 04 Jun 2012 [19:04:41], Anthony Liguori wrote: On 05/26/2012 04:20 AM, Amit Shah wrote: On (Fri) 25 May 2012 [15:00:53], Anthony Liguori wrote: On 05/25/2012 02:32 PM, Amit Shah wrote: The Linux kernel already has a virtio-rng driver, this is the device implementation. When

Re: [Qemu-devel] [PATCH v2 1/1] virtio-rng: hardware random number generator device

2012-06-05 Thread Amit Shah
On (Tue) 05 Jun 2012 [17:54:30], Anthony Liguori wrote: On 06/05/2012 05:41 PM, Amit Shah wrote: On (Mon) 04 Jun 2012 [19:04:41], Anthony Liguori wrote: On 05/26/2012 04:20 AM, Amit Shah wrote: On (Fri) 25 May 2012 [15:00:53], Anthony Liguori wrote: On 05/25/2012 02:32 PM, Amit Shah wrote

Re: [Qemu-devel] [PATCH v3 0/2] Balloon event change notifications

2012-06-15 Thread Amit Shah
-May/msg00868.html Acked-by: Amit Shah amit.s...@redhat.com Amit

[Qemu-devel] [PATCH v3 0/1] virtio-rng: hardware random number generator

2012-06-20 Thread Amit Shah
event to at most 1 per second * Update to slightly different way to define new QEVENTS v2: * Remove hard-wiring to /dev/urandom * Use chardev for input * Add a QMP event for notifying listeners about entropy needed and the bytes asked for by the guest. * Add s390 code Amit Shah (1

[Qemu-devel] [PATCH v3 1/1] virtio-rng: hardware random number generator device

2012-06-20 Thread Amit Shah
asked by the guest: {timestamp: {seconds: 1337966878, microseconds: 517009}, \ event: ENTROPY_NEEDED, data: {bytes: 64}} Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/Makefile.objs |1 + hw/pci.h |1 + hw/s390-virtio-bus.c | 35 + hw/s390-virtio-bus.h

Re: [Qemu-devel] [PATCH v3 1/1] virtio-rng: hardware random number generator device

2012-06-22 Thread Amit Shah
On (Wed) 20 Jun 2012 [16:29:22], Anthony Liguori wrote: On 06/20/2012 01:59 AM, Amit Shah wrote: The Linux kernel already has a virtio-rng driver, this is the device implementation. When the guest asks for entropy from the virtio hwrng, it puts a buffer in the vq. We then put entropy

Re: [Qemu-devel] [PATCH v3 1/1] virtio-rng: hardware random number generator device

2012-06-22 Thread Amit Shah
On (Fri) 22 Jun 2012 [08:44:52], Anthony Liguori wrote: On 06/22/2012 08:34 AM, Daniel P. Berrange wrote: On Fri, Jun 22, 2012 at 07:58:53AM -0500, Anthony Liguori wrote: On 06/22/2012 07:31 AM, Daniel P. Berrange wrote: On Fri, Jun 22, 2012 at 07:22:51AM -0500, Anthony Liguori wrote: On

Re: [Qemu-devel] [PATCH v3 0/1] virtio-rng: hardware random number generator

2012-09-16 Thread Amit Shah
On (Sun) 16 Sep 2012 [13:42:46], H. Peter Anvin wrote: On 06/19/2012 11:59 PM, Amit Shah wrote: Hello, Here's the 3rd iteration of the virtio-rng device. This update just rebases the patch on top of current master. Details on the patch in the commit message. Hi everyone... I just

[Qemu-devel] [PATCH 1/1] kvmclock: fix guest stop notification

2012-09-20 Thread Amit Shah
: Paolo Bonzini pbonz...@redhat.com CC: Laszlo Ersek ler...@redhat.com Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/kvm/clock.c | 21 +++-- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/kvm/clock.c b/hw/kvm/clock.c index 824b978..f3427eb 100644 --- a/hw

[Qemu-devel] [PATCH RESEND 0/3] Introduce virtqueue_get_avail_bytes()

2012-09-24 Thread Amit Shah
is. With this series applied, the popping (and the subsequent save/load of state for migration) isn't necessary. The virtio-serial-bus code becomes better too, that's patch 3 here. Please apply, Amit Shah (3): virtio: use unsigned int for counting bytes in vq virtio: Introduce virtqueue_get_avail_bytes

[Qemu-devel] [PATCH RESEND 2/3] virtio: Introduce virtqueue_get_avail_bytes()

2012-09-24 Thread Amit Shah
the number of bytes for buffers marked for both, in as well as out. virtqueue_avail_bytes() is made a wrapper over this new function. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio.c | 28 +--- hw/virtio.h |5 - 2 files changed, 25 insertions(+), 8

[Qemu-devel] [PATCH RESEND 1/3] virtio: use unsigned int for counting bytes in vq

2012-09-24 Thread Amit Shah
The virtqueue_avail_bytes() function counts bytes in an int. Use an unsigned int instead. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio.c b/hw/virtio.c index 209c763..4c9e20a3 100644 --- a/hw

[Qemu-devel] [PATCH RESEND 3/3] virtio-serial-bus: let chardev know the exact number of bytes requested

2012-09-24 Thread Amit Shah
to the guest. Signed-off-by: Amit Shah amit.s...@redhat.com --- hw/virtio-serial-bus.c | 11 +++ 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 82073f5..d20bd8b 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial

<    4   5   6   7   8   9   10   11   12   13   >