Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios

2009-11-26 Thread Gleb Natapov
On Thu, Nov 26, 2009 at 09:55:28PM +0100, Sebastian Herbszt wrote: > Gleb Natapov wrote: > >On Wed, Nov 25, 2009 at 11:04:20PM +0100, Sebastian Herbszt wrote: > >>Gleb Natapov wrote: > >>>On Wed, Nov 25, 2009 at 06:09:51AM +, Jamie Lokier wrote: > Gleb Natapov wrote: > > > But QEMU is u

[Qemu-devel] [PATCH] eepro100: Allocate a larger buffer for regname()

2009-11-26 Thread David Benjamin
This should avoid truncating the register name when debugging. Signed-off-by: David Benjamin --- hw/eepro100.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/eepro100.c b/hw/eepro100.c index 8734907..3676dc0 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -648,7 +

Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios

2009-11-26 Thread Kevin O'Connor
On Thu, Nov 26, 2009 at 11:35:52PM +0100, Sebastian Herbszt wrote: > Maybe the expansion rom bar can be used for pci devices like on real > hardware. The bios will check it and load the rom itself instead of > relying on qemu to do the job. SeaBIOS can pull roms from pci space today. Long term, I

Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios

2009-11-26 Thread Jamie Lokier
Sebastian Herbszt wrote: > >We could have qemu do a soft reset (not reload rom) on a triple fault > >or keyboard controller reset, and then have SeaBIOS request a hard > >reset (have qemu reload rom) if it detects a soft reset that is not a > >"resume" request. > > > >I'm also not sure what qemu do

[Qemu-devel] Re: [PATCHv2 0/3] pci: interrupt status/interrupt disable support

2009-11-26 Thread Isaku Yamahata
On Thu, Nov 26, 2009 at 05:48:23PM +0200, Michael S. Tsirkin wrote: > This patchset adds support for mandatory interupt > status and interrupt disable bits to all > PCI devices. This is required for PCI compliancy. Great. Now we have more optimized interrupt path. For all patches, Acked-by: Isaku

[Qemu-devel] [PATCH 20/20] QMP: Introduce vm-info

2009-11-26 Thread Luiz Capitulino
A Python script which uses qmp.py to print some simple VM info. Signed-off-by: Luiz Capitulino --- QMP/vm-info | 32 1 files changed, 32 insertions(+), 0 deletions(-) create mode 100755 QMP/vm-info diff --git a/QMP/vm-info b/QMP/vm-info new file mode 100755 i

[Qemu-devel] [PATCH 19/20] QMP: Introduce qmp-shell

2009-11-26 Thread Luiz Capitulino
This is a very simple shell written in Python for demonstration purposes. Unfortunately it's a bit awkward right now, as the user has to specify the arguments names and the printed data can be a raw dictionary or list, like the following example: (QEMU) pci_add pci_addr=auto type=nic {u'slot': 5,

[Qemu-devel] [PATCH 18/20] QMP: Introduce qmp-events.txt

2009-11-26 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- QMP/qmp-events.txt | 26 ++ 1 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 QMP/qmp-events.txt diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt new file mode 100644 index 000..682a5e5 --- /dev/null +++ b/Q

[Qemu-devel] [PATCH 17/20] QMP: Introduce specification

2009-11-26 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- QMP/qmp-spec.txt | 192 ++ 1 files changed, 192 insertions(+), 0 deletions(-) create mode 100644 QMP/qmp-spec.txt diff --git a/QMP/qmp-spec.txt b/QMP/qmp-spec.txt new file mode 100644 index 000..8429789

[Qemu-devel] [PATCH 16/20] QMP: Introduce README file

2009-11-26 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- QMP/README | 51 +++ 1 files changed, 51 insertions(+), 0 deletions(-) create mode 100644 QMP/README diff --git a/QMP/README b/QMP/README new file mode 100644 index 000..50c31f2 --- /dev/null +++ b/QMP/READ

[Qemu-devel] [PATCH 15/20] QMP: Disable monitor print functions

2009-11-26 Thread Luiz Capitulino
We still have handlers which will call monitor print functions in several places. Usually to report errors. If they do this when we are in control mode, we will be emitting garbage to our clients. To avoid this problem, this commit adds a way to disable those functions. If any of them is called w

[Qemu-devel] [PATCH 14/20] QMP: Introduce basic asynchronous events

2009-11-26 Thread Luiz Capitulino
Debug, shutdown, reset, powerdown and stop are all basic events, as they are very simple they can be added in the same commit. Signed-off-by: Luiz Capitulino --- monitor.c | 15 +++ monitor.h |5 + vl.c | 11 +-- 3 files changed, 29 insertions(+), 2 deletions

[Qemu-devel] [PATCH 13/20] QMP: Asynchronous events infrastructure

2009-11-26 Thread Luiz Capitulino
Asynchronous events are generated with a call to monitor_protocol_event(). This function builds the right data-type and emit the event right away. The emitted data is always a JSON object and its format is as follows: { "event": json-string, "timestamp": { "seconds": json-number, "microseconds"

[Qemu-devel] [PATCH 12/20] QMP: Allow 'query-' commands

2009-11-26 Thread Luiz Capitulino
The 'info' command makes sense for the user protocol, but for QMP it doesn't, as its return data is not well defined. That is, it can return anything. To fix this Avi proposes having 'query-' commands when in protocol mode. For example, 'info balloon' would become 'query-balloon'. The right way o

[Qemu-devel] [PATCH 11/20] QMP: Input support

2009-11-26 Thread Luiz Capitulino
The JSON stream parser is used to do QMP input. When there are enough characters to be parsed it calls Monitor's handle_qmp_command() function to handle the input. This function's job is to check if the input is correct and call the appropriate handler. In other words, it does for QMP what handle_

[Qemu-devel] [PATCH 10/20] QMP: do_info() checks

2009-11-26 Thread Luiz Capitulino
This commit adds specific QMP checks to do_info(), so that it behaves as expected in QMP mode. Signed-off-by: Luiz Capitulino --- monitor.c | 18 +++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index ffb5ed2..de56201 100644 --- a/monitor

[Qemu-devel] [PATCH 09/20] QMP: Output support

2009-11-26 Thread Luiz Capitulino
In the new Monitor output is always performed by only two functions: do_info() and monitor_call_handler(). To support QMP output, we modify those functions to check if we are in control mode. If so, we call monitor_protocol_emitter() to emit QMP output, otherwise we do regular output. QMP has two

[Qemu-devel] [PATCH 08/20] QMP: Initial support

2009-11-26 Thread Luiz Capitulino
This commit adds initial QMP support in QEMU. It's important to notice that most QMP code will be part of the Monitor. Input will be read by monitor_control_read(). Currently it does nothing but next patches will add proper input support. The function monitor_json_emitter(), as its name implies,

[Qemu-devel] [PATCH 07/20] QError: Add errors needed by QMP

2009-11-26 Thread Luiz Capitulino
Only QERR_QMP_BAD_INPUT_OBJECT is QMP specific, the others can be used in different contexts by other subsystems. Please, note that QERR_JSON_PARSING signals any parsing error from the json parser. We will need it until the parser gets updated to use QError. Signed-off-by: Luiz Capitulino --- q

[Qemu-devel] [PATCH 06/20] monitor: Introduce 'info commands'

2009-11-26 Thread Luiz Capitulino
List QMP available commands. Only valid in control mode, where has to be used as 'query-commands. Signed-off-by: Luiz Capitulino --- monitor.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index 4c402e4..02dea2

[Qemu-devel] [PATCH 05/20] monitor: Rename monitor_handle_command()

2009-11-26 Thread Luiz Capitulino
As this series will add a new kind of Monitor command, it's better to rename monitor_handle_command() to what it really is: handle_user_command(). This will avoid confusion. Signed-off-by: Luiz Capitulino --- monitor.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH 04/20] monitor: Introduce monitor_find_command()

2009-11-26 Thread Luiz Capitulino
This commit moves the loop which searches for the command entry corresponding to a command name to its own function. It will be used by QMP code as well. Signed-off-by: Luiz Capitulino --- monitor.c | 22 +++--- 1 files changed, 15 insertions(+), 7 deletions(-) diff --git a/m

[Qemu-devel] [PATCH 03/20] monitor: Introduce monitor_call_handler()

2009-11-26 Thread Luiz Capitulino
This commit moves the code which calls Monitor handlers to its own function, as it will be used by QMP code as well. Signed-off-by: Luiz Capitulino --- monitor.c | 20 +--- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/monitor.c b/monitor.c index 4d18699..e0cc

[Qemu-devel] [PATCH 02/20] monitor: Command-line flag to enable control mode

2009-11-26 Thread Luiz Capitulino
This commit adds a flag called 'control' to the '-monitor' command-line option. This flag enables control mode. The syntax is: qemu [...] -monitor control, Where is a chardev (excluding 'vc', for obvious reasons). For example: $ qemu [...] -monitor control,tcp:localhost:,server Will run

[Qemu-devel] [PATCH 01/20] monitor: Introduce MONITOR_USE_CONTROL flag

2009-11-26 Thread Luiz Capitulino
This flag will be set when Monitor enters "control mode", in which the output will be defined by the QEMU Monitor Protocol. This also introduces a macro to check if the flag is set. Signed-off-by: Luiz Capitulino --- monitor.c |6 ++ monitor.h |1 + 2 files changed, 7 insertions(+),

[Qemu-devel] [PATCH v1 00/20] QEMU Monitor Protocol

2009-11-26 Thread Luiz Capitulino
Hi, This series has a number of improvements over v0 and is a serious candidate for inclusion. Something I'd like to make clear is that QMP is still unstable: some commands output are being fixed and most of the error handling has not been done yet. It might look scary to have an unstable pr

Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios

2009-11-26 Thread Sebastian Herbszt
Kevin O'Connor wrote: On Wed, Nov 25, 2009 at 11:04:20PM +0100, Sebastian Herbszt wrote: Do different things during reset depending on CMOS values doesn't sound right to me. I don't know what is implemented right now. I thought that we reload BIOS on reset. Currently the BIOS seems to be only

[Qemu-devel] Re: [PATCH][SEABIOS] Make SMBIOS table pass MS SVVP test

2009-11-26 Thread Sebastian Herbszt
Gleb Natapov wrote: On Wed, Nov 25, 2009 at 09:09:19PM +0100, Sebastian Herbszt wrote: Gleb Natapov wrote: >On Tue, Nov 24, 2009 at 10:57:02AM -0500, Kevin O'Connor wrote: >> >>That said, I think SeaBIOS should autodetect any values where that's >>feasible. So, for example, if the cpu identific

Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios

2009-11-26 Thread Sebastian Herbszt
Gleb Natapov wrote: On Wed, Nov 25, 2009 at 11:04:20PM +0100, Sebastian Herbszt wrote: Gleb Natapov wrote: >On Wed, Nov 25, 2009 at 06:09:51AM +, Jamie Lokier wrote: >>Gleb Natapov wrote: >>> > But QEMU is used to run old OSes too. >>> > > That's OK. I don't expect BIOS to be reloaded if OS

[Qemu-devel] PATCH: Building qemu on OpenSolaris 2009.06 (SPARC) host

2009-11-26 Thread Palle Lyckegaard
Hello brave qemu developers! Attached are a few patches that will enable qemu to build on a OpenSolaris 2009.06 host. Please consider to apply them to the repository. Regards Palle diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h index 0893ce3..592beca 100644 --- a/fpu/softfloat-n

[Qemu-devel] [PATCH, RFC] tap-linux: support opening arbitrary char devices

2009-11-26 Thread Arnd Bergmann
With the upcoming macvtap, we will want to open devices other than /dev/net/tun but no longer need to call TUNSETIFF. This makes it possible to do 'qemu -net tap,ifname=/dev/tap/macvtap0' to refer to a chardev in addition to the current way of doing 'qemu -net tap,ifname=tap0' to refer to a tap ne

[Qemu-devel] Re: F10 build failure

2009-11-26 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > Hi! > qemu build on fedora 10 fails with: > /root/scm/qemu/fpu/softfloat-native.c:132:5: error: "HOST_LONG_BITS" is not > defined > make[1]: *** [fpu/softfloat-native.o] Error 1 > make: *** [subdir-x86_64-softmmu] Error 2 > > just sticking > > #define HOST_LONG_BITS

[Qemu-devel] Re: [PATCHv2 1/3] pci: prepare irq code for interrupt state

2009-11-26 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > This rearranges code in preparation for interrupt state > implementation. > Changes: > - split up but walk away from interrupt handling > into a subroutine > - change irq_state from an array to bitmask > - verify that irq_state values are 0

[Qemu-devel] [PATCH 1/6] Fix coding style

2009-11-26 Thread Pierre Riteau
Signed-off-by: Pierre Riteau --- block-migration.c | 366 ++--- block-migration.h |2 +- savevm.c | 41 +++--- 3 files changed, 200 insertions(+), 209 deletions(-) diff --git a/block-migration.c b/block-migration.c index 09771ed..0c

[Qemu-devel] [PATCH 3/6] Switch block migration lists to QSIMPLEQ

2009-11-26 Thread Pierre Riteau
Signed-off-by: Pierre Riteau --- block-migration.c | 53 +++-- block-migration.h |2 +- 2 files changed, 20 insertions(+), 35 deletions(-) diff --git a/block-migration.c b/block-migration.c index 0cb162a..1626168 100644 --- a/block-migration.

[Qemu-devel] [PATCH 4/6] Fix compilation with DEBUG_BLK_MIGRATION, and improve debug messages

2009-11-26 Thread Pierre Riteau
Signed-off-by: Pierre Riteau --- block-migration.c | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/block-migration.c b/block-migration.c index 1626168..aff4c20 100644 --- a/block-migration.c +++ b/block-migration.c @@ -352,8 +352,9 @@ static void flush_blks(QEM

[Qemu-devel] [PATCH 5/6] Remove duplicated code

2009-11-26 Thread Pierre Riteau
Signed-off-by: Pierre Riteau --- block-migration.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/block-migration.c b/block-migration.c index aff4c20..e09db78 100644 --- a/block-migration.c +++ b/block-migration.c @@ -313,7 +313,8 @@ static void blk_mig_save_dirty_

[Qemu-devel] [PATCH 6/6] Merge mig_save_device_bulk and mig_read_device_bulk

2009-11-26 Thread Pierre Riteau
Signed-off-by: Pierre Riteau --- block-migration.c | 138 1 files changed, 43 insertions(+), 95 deletions(-) diff --git a/block-migration.c b/block-migration.c index e09db78..558890b 100644 --- a/block-migration.c +++ b/block-migration.c @@ -

[Qemu-devel] [PATCH 2/6] Import a simple queue implementation from NetBSD

2009-11-26 Thread Pierre Riteau
Signed-off-by: Pierre Riteau --- qemu-queue.h | 109 +++-- 1 files changed, 105 insertions(+), 4 deletions(-) diff --git a/qemu-queue.h b/qemu-queue.h index 8877efd..1d07745 100644 --- a/qemu-queue.h +++ b/qemu-queue.h @@ -1,8 +1,9 @@ -/*

[Qemu-devel] [PATCH 0/6] block-migration: Various cleanups

2009-11-26 Thread Pierre Riteau
Hi, While reading the block migration code I couldn't resist cleaning it up. Among other things I replaced the lists by simple queues from NetBSD (it can probably be useful for other subsystems). block-migration.c | 486 ++--- block-migration.h |

Re: [Qemu-devel] [PATCH 09/44] net: introduce qemu_new_net_client()

2009-11-26 Thread Mark McLoughlin
On Wed, 2009-11-25 at 20:36 +, Blue Swirl wrote: > On Wed, Nov 25, 2009 at 6:49 PM, Mark McLoughlin wrote: > > A replacement for qemu_new_vlan_client(), using NetClientInfo to > > replace most arguments. > > > +VLANClientState *qemu_new_net_client(NetClientInfo *info, > > +

Re: [Qemu-devel] Re: [PATCH 2/3 v5] Block live migration

2009-11-26 Thread Pierre Riteau
On 26 nov. 2009, at 16:50, Liran Schour wrote: > > Jan Kiszka wrote on 26/11/2009 15:53:49: > > >>> +qemu_get_buffer(f, buf, >>> +BLOCK_SIZE); >>> +if(bs != NULL) { >>> + >>> +bdrv_write(bs, (addr >> SECTOR_BITS), >>> +

Re: [Qemu-devel] Re: Live migration protocol, device features, ABIs and other beasts

2009-11-26 Thread Andrea Arcangeli
Very lengthy discussion, apologies if I repeat something in one of the various threads but I read lots of these discussions and I'm somewhat confused still of what this is all about... On Wed, Nov 25, 2009 at 04:09:55PM +0200, Michael S. Tsirkin wrote: > We were discussing features that are (mostl

[Qemu-devel] [PATCH 6/7] Don't call kvm cpu reset on initialization

2009-11-26 Thread Glauber Costa
All reset functions are called from the same place, and this was a leftover Signed-off-by: Glauber Costa --- kvm-all.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 28f7ab7..dbd69f3 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -204,8 +204,6 @@

[Qemu-devel] [PATCH 7/7] remove smp restriction from kvm

2009-11-26 Thread Glauber Costa
We don't support smp without irqchip in kernel, so only abort in that situation Signed-off-by: Glauber Costa --- kvm-all.c | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index dbd69f3..4134be3 100644 --- a/kvm-all.c +++ b/kvm-all.

[Qemu-devel] [PATCH 5/7] tell kernel about all registers instead of just mp_state

2009-11-26 Thread Glauber Costa
This fix a bug with -smp in kvm. Since we have updated apic_base, we also have to tell kernel about it. So instead of just updating mp_state, update every regs. Signed-off-by: Glauber Costa --- hw/apic-kvm.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/apic-kvm

[Qemu-devel] [PATCH 4/7] qemu_flush_work for remote vcpu execution

2009-11-26 Thread Glauber Costa
This function is similar to qemu-kvm's on_vcpu mechanism. Totally synchronous, and guarantees that a given function will be executed at the specified vcpu. The approach I am taking is to put it under the hood, in kvm_vcpu_ioctl. This way, the kvm_vcpu_ioctl can be used anywhere, and we guarantee i

[Qemu-devel] [PATCH 3/7] update halted state on mp_state sync

2009-11-26 Thread Glauber Costa
If we are using in-kernel irqchip, halted state belongs in the kernel. So everytime we grab kernel's idea of mpstate, we also need to propagate halted state to userspace. Signed-off-by: Glauber Costa --- target-i386/kvm.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git

[Qemu-devel] [PATCH 2/7] store thread-specific env information

2009-11-26 Thread Glauber Costa
Since we'll have multiple cpu threads, at least for kvm, we need a way to store and retrieve the CPUState associated with the current execution thread. For the I/O thread, this will be NULL. I am using pthread functions for that, for portability, but we could as well use __thread keyword. Signed-

[Qemu-devel] [PATCH 0/7] KVM SMP support, early version

2009-11-26 Thread Glauber Costa
Hi guys, This is an early version of smp support in kvm that kinda works. It has some known problems that I am still tracking. For example, it does not reset very well. Also, initialization is a bit slow, probably because of the number of remote ioctl calls involved. But I believe Jan's patch to d

[Qemu-devel] [PATCH 1/7] Don't mess with halted state.

2009-11-26 Thread Glauber Costa
When we have irqchip in kernel, halted state is kernel business. So don't initialize it in our code. Signed-off-by: Glauber Costa --- hw/apic-kvm.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/hw/apic-kvm.c b/hw/apic-kvm.c index 089fa45..e5a0bfc 100644 --- a/hw/apic

[Qemu-devel] Re: [PATCH 2/3 v5] Block live migration

2009-11-26 Thread Jan Kiszka
Jan Kiszka wrote: > Liran Schour wrote: >> Jan Kiszka wrote on 26/11/2009 15:53:49: >> >> +qemu_get_buffer(f, buf, +BLOCK_SIZE); +if(bs != NULL) { + +bdrv_write(bs, (addr >> SECTOR_BITS), +

[Qemu-devel] Re: [PATCH 2/3 v5] Block live migration

2009-11-26 Thread Jan Kiszka
Liran Schour wrote: > Jan Kiszka wrote on 26/11/2009 15:53:49: > > >>> +qemu_get_buffer(f, buf, >>> +BLOCK_SIZE); >>> +if(bs != NULL) { >>> + >>> +bdrv_write(bs, (addr >> SECTOR_BITS), >>> + buf, block_

[Qemu-devel] Re: what's on qemu tree for pci related fixes

2009-11-26 Thread Michael S. Tsirkin
On Sun, Nov 22, 2009 at 09:40:52AM -0600, Anthony Liguori wrote: > Michael S. Tsirkin wrote: >> Here's the list of patches on my pci fixes tree: >> git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu.git pci >> >> Here are the pci fixes I know of that haven't been applied already. >> They mostly

Re: [Qemu-devel] Re: POST failure (loop) with isapc and seabios

2009-11-26 Thread Kevin O'Connor
On Thu, Nov 26, 2009 at 10:19:57AM +0200, Gleb Natapov wrote: > On Thu, Nov 26, 2009 at 03:12:53AM -0500, Kevin O'Connor wrote: > > IMO, the ram at 0xf needs to get migrated just like the rest of > > the ram. > And it is! The old BIOS is running after migration. But on the first reset > after m

[Qemu-devel] [PATCHv2 2/3] pci: interrupt status bit implementation

2009-11-26 Thread Michael S. Tsirkin
interrupt status is a mandatory feature in PCI spec, so devices must implement it to be spec compliant. Signed-off-by: Michael S. Tsirkin --- hw/pci.c | 26 +- hw/pci.h |1 + 2 files changed, 26 insertions(+), 1 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 1

[Qemu-devel] F10 build failure

2009-11-26 Thread Michael S. Tsirkin
Hi! qemu build on fedora 10 fails with: /root/scm/qemu/fpu/softfloat-native.c:132:5: error: "HOST_LONG_BITS" is not defined make[1]: *** [fpu/softfloat-native.o] Error 1 make: *** [subdir-x86_64-softmmu] Error 2 just sticking #define HOST_LONG_BITS 64 in fpu/softfloat-native.c helps, but what

[Qemu-devel] Re: [PATCH 2/3 v5] Block live migration

2009-11-26 Thread Liran Schour
Jan Kiszka wrote on 26/11/2009 15:53:49: > > +qemu_get_buffer(f, buf, > > +BLOCK_SIZE); > > +if(bs != NULL) { > > + > > +bdrv_write(bs, (addr >> SECTOR_BITS), > > + buf, block_mig_state->sectors_per_bl

[Qemu-devel] [PATCHv2 3/3] pci: interrupt disable bit support

2009-11-26 Thread Michael S. Tsirkin
Interrupt disable bit is mandatory in PCI spec. Implement it to make devices spec compliant. Signed-off-by: Michael S. Tsirkin --- hw/pci.c | 29 +++-- hw/pci.h |1 + 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index f83ea93..

[Qemu-devel] [PATCHv2 1/3] pci: prepare irq code for interrupt state

2009-11-26 Thread Michael S. Tsirkin
This rearranges code in preparation for interrupt state implementation. Changes: - split up but walk away from interrupt handling into a subroutine - change irq_state from an array to bitmask - verify that irq_state values are 0 or 1 on load There are no functiona

[Qemu-devel] [PATCHv2 0/3] pci: interrupt status/interrupt disable support

2009-11-26 Thread Michael S. Tsirkin
This patchset adds support for mandatory interupt status and interrupt disable bits to all PCI devices. This is required for PCI compliancy. These patches are on top of my pci tree, including Isaku Yamahata's fixes. If this is a problem, let me know and I will rebase. This works fine for me, but

Re: [Qemu-devel] [sneak preview] major scsi overhaul

2009-11-26 Thread Hannes Reinecke
Gerd Hoffmann wrote: > On 11/26/09 15:27, Hannes Reinecke wrote: >> Gerd Hoffmann wrote: >>> sd_done() tries to figure how many sectors it actually got for serious >>> errors. I don't feel signaling "medium error" for the first sector >>> behind our limit just because we'd like to have smaller req

[Qemu-devel] Re: SeaBIOS cdrom regression with Vista

2009-11-26 Thread Avi Kivity
On 11/21/2009 12:36 AM, Kevin O'Connor wrote: It looks like I spoke too soon. It appears the SeaBIOS init can leave the ATA controller in an interrupts disabled state. This appears to confuse Vista. So, this is a SeaBIOS bug - I'll implement a fix. I've committed a fix to SeaBIOS - co

Re: [Qemu-devel] [sneak preview] major scsi overhaul

2009-11-26 Thread Gerd Hoffmann
On 11/26/09 15:27, Hannes Reinecke wrote: Gerd Hoffmann wrote: sd_done() tries to figure how many sectors it actually got for serious errors. I don't feel signaling "medium error" for the first sector behind our limit just because we'd like to have smaller requests. scsi_end_request is being

[Qemu-devel] [PATCH 20/30] scsi-disk: restruct emulation: MODE_SENSE

2009-11-26 Thread Gerd Hoffmann
Move MODE_SENSE emulation from scsi_send_command() to scsi_disk_emulate_command(). Create two helper functions: mode_sense_page() which writes the actual mode pages and scsi_disk_emulate_mode_sense() which holds the longish MODE_SENSE emulation code, calling into mode_sense_page() as needed. Sign

[Qemu-devel] [PATCH 25/30] scsi-disk: restruct emulation: READ_TOC

2009-11-26 Thread Gerd Hoffmann
Move READ_TOC emulation from scsi_send_command() to scsi_disk_emulate_command(). Add scsi_disk_emulate_read_toc() function which holds the longisch READ_TOC emulation code. Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c | 80 +-- 1 files ch

[Qemu-devel] [PATCH 23/30] scsi-disk: restruct emulation: READ_CAPACITY

2009-11-26 Thread Gerd Hoffmann
Move READ_CAPACITY emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c | 55 +++ 1 files changed, 27 insertions(+), 28 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c i

[Qemu-devel] [PATCH 24/30] scsi-disk: restruct emulation: SYNCHRONIZE_CACHE

2009-11-26 Thread Gerd Hoffmann
Move SYNCHRONIZE_CACHE emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 4f56a22..865c5db 100644 --- a/hw/scsi-di

[Qemu-devel] [PATCH 28/30] scsi-disk: restruct emulation: REPORT_LUNS

2009-11-26 Thread Gerd Hoffmann
Move REPORT_LUNS emulation from scsi_send_command() to scsi_disk_emulate_command(). Also add REPORT_LUNS to scsi-defs.h and scsi_command_name(). Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c |1 + hw/scsi-defs.h |1 + hw/scsi-disk.c | 16 3 files changed, 10 inserti

[Qemu-devel] [PATCH 22/30] scsi-disk: restruct emulation: ALLOW_MEDIUM_REMOVAL

2009-11-26 Thread Gerd Hoffmann
Move ALLOW_MEDIUM_REMOVAL emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 11e85f2..7d59998 100644 --- a/hw/scsi

[Qemu-devel] [PATCH 16/30] scsi-disk: restruct emulation: core + TEST_UNIT_READY.

2009-11-26 Thread Gerd Hoffmann
Add new scsi_disk_emulate_command() function, which will -- when finished -- handle all scsi disk command emulation except actual I/O (READ+WRITE commands) which goes to the block layer. The function builds on top of the new SCSIRequest struct. SCSI command emulation code is moved over from scsi_

[Qemu-devel] [PATCH 30/30] scsi: add read/write 16 commands.

2009-11-26 Thread Gerd Hoffmann
Add READ_16 + friends to scsi-defs.h, scsi_command_name() and the request parsing helper functions. Use them in scsi-disk.c too. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c |8 hw/scsi-defs.h |3 +++ hw/scsi-disk.c |6 -- 3 files changed, 15 insertions(+), 2 deletio

[Qemu-devel] [PATCH 26/30] scsi-disk: restruct emulation: GET_CONFIGURATION

2009-11-26 Thread Gerd Hoffmann
Move GET_CONFIGURATION emulation from scsi_send_command() to scsi_disk_emulate_command(). Also add GET_CONFIGURATION to scsi-defs.h and scsi_command_name(). Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c |1 + hw/scsi-defs.h |1 + hw/scsi-disk.c | 16 3 files changed

[Qemu-devel] [PATCH 29/30] scsi-disk: restruct emulation: VERIFY

2009-11-26 Thread Gerd Hoffmann
Move VERIFY emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 1507bcd..2910782 100644 --- a/hw/scsi-disk.c +++ b/hw

[Qemu-devel] [PATCH 21/30] scsi-disk: restruct emulation: START_STOP

2009-11-26 Thread Gerd Hoffmann
Move START_STOP emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 06289c3..11e85f2 100644 --- a/hw/scsi-dis

[Qemu-devel] [PATCH 18/30] scsi-disk: restruct emulation: INQUIRY

2009-11-26 Thread Gerd Hoffmann
Move INQUIRY emulation from scsi_send_command() to scsi_disk_emulate_command(). Also split the longish INQUITY emulation code into the new scsi_disk_emulate_inquiry() function. Serial number handling is slightly changed, we don't copy it any more but look it up directly in DriveInfo which we have

[Qemu-devel] [PATCH 27/30] scsi-disk: restruct emulation: SERVICE_ACTION_IN

2009-11-26 Thread Gerd Hoffmann
Move SERVICE_ACTION_IN emulation from scsi_send_command() to scsi_disk_emulate_command(). Also add SERVICE_ACTION_IN to scsi-defs.h and scsi_command_name(). Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c |1 + hw/scsi-defs.h |1 + hw/scsi-disk.c | 67 ++---

[Qemu-devel] [PATCH 19/30] scsi-disk: restruct emulation: RESERVE+RELEASE

2009-11-26 Thread Gerd Hoffmann
Move RESERVE+RELEASE emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c | 40 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index f94d513.

[Qemu-devel] [PATCH 15/30] scsi: add scsi_req_print()

2009-11-26 Thread Gerd Hoffmann
Handy for debugging. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c | 114 + hw/scsi.h |1 + 2 files changed, 115 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 2e4fd38..e362671 100644 --- a/hw/scsi

[Qemu-devel] [PATCH 07/30] scsi: add scsi-defs.h

2009-11-26 Thread Gerd Hoffmann
Largely based on from linux. Added into the tree so we can use the defines everywhere, not just in scsi-generic.c (which is linux-specific). Signed-off-by: Gerd Hoffmann --- hw/scsi-defs.h| 156 + hw/scsi-disk.c| 41 ++

[Qemu-devel] [PATCH 17/30] scsi-disk: restruct emulation: REQUEST_SENSE

2009-11-26 Thread Gerd Hoffmann
Move REQUEST_SENSE emulation from scsi_send_command() to scsi_disk_emulate_command(). Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c | 38 +++--- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index f851694..759

[Qemu-devel] [PATCH 13/30] scsi: move dinfo to SCSIDevice

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c| 63 ++--- hw/scsi-generic.c | 23 +-- hw/scsi.h |1 + 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 2eac40

[Qemu-devel] [PATCH 09/30] scsi: add request parsing helpers to common code.

2009-11-26 Thread Gerd Hoffmann
Add helper functions for scsi request parsing to common code. Getting command length, transfer size, and linear block address is handled. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c | 164 + hw/scsi-generic.c | 156 ---

[Qemu-devel] [PATCH 06/30] scsi: move blocksize from SCSIGenericState to SCSIDevice

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c|1 + hw/scsi-generic.c | 23 +++ hw/scsi.h |1 + 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index c18b7f0..0a8b8bb 100644 --- a/hw/scsi-disk.c +++ b/hw/

[Qemu-devel] [PATCH 10/30] scsi: use command defines in scsi-disk.c

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c | 40 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 6b5674b..4e92910 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -379,16 +379,16 @@ static i

[Qemu-devel] [PATCH 14/30] scsi: move status to SCSIRequest.

2009-11-26 Thread Gerd Hoffmann
Also add and use the scsi_req_complete() helper function for calling the completion callback. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c |9 + hw/scsi-disk.c| 13 - hw/scsi-generic.c | 18 -- hw/scsi.h |2 ++ 4 files changed, 27

[Qemu-devel] [PATCH 11/30] scsi: add xfer mode

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c | 46 ++ hw/scsi-generic.c | 40 +--- hw/scsi.h |7 +++ 3 files changed, 54 insertions(+), 39 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-

[Qemu-devel] [PATCH 12/30] scsi: move sense to SCSIDevice, create SCSISense struct.

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c | 10 ++ hw/scsi-disk.c |8 hw/scsi.h |9 + 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index e250e4f..666ca3c 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c

[Qemu-devel] [PATCH 05/30] scsi: move scsi command buffer from SCSIGenericReq to SCSIRequest.

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-generic.c | 15 ++- hw/scsi.h |6 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c index f63d83d..ac0b3ec 100644 --- a/hw/scsi-generic.c +++ b/hw/scsi-generic.c @@ -42,7

[Qemu-devel] [PATCH 08/30] scsi: move type from SCSIGenericState to SCSIDevice

2009-11-26 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c|1 + hw/scsi-generic.c | 13 ++--- hw/scsi.h |1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index b0eceaf..6b5674b 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c

[Qemu-devel] [PATCH 02/30] scsi: create common SCSIRequest structure.

2009-11-26 Thread Gerd Hoffmann
Rename the SCSIRequest structs in scsi-disk.c and scsi-generic.c to SCSIDiskReq and SCSIGenericReq. Create a SCSIRequest struct and move the common elements over. Signed-off-by: Gerd Hoffmann --- hw/scsi-disk.c| 109 ++--- hw/scsi-generic.c |

[Qemu-devel] [PATCH 01/30] scsi: add/fix header protection.

2009-11-26 Thread Gerd Hoffmann
Also delete the leftover and unused scsi-disk.h file. Signed-off-by: Gerd Hoffmann --- hw/esp.h |5 hw/scsi-disk.h | 67 hw/scsi.h |4 +- 3 files changed, 7 insertions(+), 69 deletions(-) delete mode 100644 hw/sc

[Qemu-devel] [PATCH 03/30] scsi: move request lists to QTAILQ.

2009-11-26 Thread Gerd Hoffmann
Changes: * Move from open-coded lists to QTAILQ macros. * Move the struct elements to the common data structures (SCSIDevice + SCSIRequest). * Drop free request pools. * Fix request cleanup in the destroy callback. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c |1 + hw/scsi-disk.

[Qemu-devel] [PATCH 04/30] scsi: move SCSIRequest management to common code.

2009-11-26 Thread Gerd Hoffmann
Create generic functions to allocate, find and release SCSIRequest structs. Make scsi-disk and scsi-generic use them. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c | 31 +++ hw/scsi-disk.c| 27 --- hw/scsi-generic.c | 29 +++

[Qemu-devel] [PATCH 00/30] scsi: data structures and cleanups.

2009-11-26 Thread Gerd Hoffmann
Hi, First batch of scsi patches. They bring some data structure unification and a bunch of fixes and cleanups. In preparation for the other scsi patches, but also useful on its own IMHO, so I'm hoping for a quick and painless merge. The major interface rewrite which needs more discussion and

Re: [Qemu-devel] [sneak preview] major scsi overhaul

2009-11-26 Thread Hannes Reinecke
Gerd Hoffmann wrote: > On 11/26/09 12:20, Hannes Reinecke wrote: >> Gerd Hoffmann wrote: >>> /me looks at drivers/scsi/sd.c:sd_done() >>> >>> I can't see any sane way to tell linux that the request was too big. >>> >> residuals is the key: >> >> drivers/scsi/scsi.c:scsi_finish_command() >> >> >>

Re: [Qemu-devel] [sneak preview] major scsi overhaul

2009-11-26 Thread Gerd Hoffmann
On 11/26/09 12:20, Hannes Reinecke wrote: Gerd Hoffmann wrote: /me looks at drivers/scsi/sd.c:sd_done() I can't see any sane way to tell linux that the request was too big. residuals is the key: drivers/scsi/scsi.c:scsi_finish_command() good_bytes = scsi_bufflen(cmd); if (

[Qemu-devel] Re: [PATCH 2/3 v5] Block live migration

2009-11-26 Thread Jan Kiszka
lir...@il.ibm.com wrote: > +static int block_load(QEMUFile *f, void *opaque, int version_id) > +{ > +int len, flags; > +char device_name[256]; > +int64_t addr; > +BlockDriverState *bs; > +uint8_t *buf; > + > +block_mig_state->sectors_per_block = bdrv_get_sectors_per_chun

[Qemu-devel] Re: Issues building seabios

2009-11-26 Thread Avi Kivity
On 11/21/2009 12:34 AM, Kevin O'Connor wrote: On Thu, Nov 19, 2009 at 04:02:06PM +0200, Avi Kivity wrote: On 11/19/2009 03:39 PM, Kevin O'Connor wrote: Long story short - this is the result of gcc's "-combine" being fragile. It's possible to avoid by compiling seabios with "make COMP

Re: [Qemu-devel] Re: [PATCH 0/4] pci: interrupt status/interrupt disable support

2009-11-26 Thread Michael S. Tsirkin
On Thu, Nov 26, 2009 at 01:21:39PM +, Paul Brook wrote: > >> It's really not that much of a fast path. Unless you're doing something > >> particularly obscure then even under heavy load you're unlikely to exceed > >> a few kHz. > > > >I think with kvm, heavy disk stressing benchmark can get hig

  1   2   >