Re: [Qemu-devel] [PATCH] configure: Virtfs doesn't require libcap.

2012-04-27 Thread Kusanagi Kouichi
On 2012-04-25 14:20:12 -0500, Anthony Liguori wrote: > On 04/22/2012 05:16 AM, Kusanagi Kouichi wrote: > >Only proxy helper does. > > > >Signed-off-by: Kusanagi Kouichi > > This broke the build: > > http://spunk.home.kraxel.org/bb/builders/ubuntu-default/builds/52 It turned out that hw/9pfs/virt

Re: [Qemu-devel] scsi-testsuite for virtio-scsi

2012-04-27 Thread Zhi Yong Wu
On Fri, Apr 27, 2012 at 11:15 PM, Stefan Hajnoczi wrote: > Christoph Hellwig has announced a new testsuite for the Linux > in-kernel SCSI target: > > http://risingtidesystems.com/git/?p=scsi-testsuite.git;a=tree > > We will need something similar for virtio-scsi.  Maybe we can > contribute and use

Re: [Qemu-devel] [PATCH 0/3]: runstate: introduce 'suspended' state

2012-04-27 Thread Michael Roth
On Fri, Apr 27, 2012 at 05:40:13PM -0300, Luiz Capitulino wrote: > I thought this would be trivial, but it brought a new issue. Please, check > patch 2/3 for more details. Series looks good to me. Reviewed-by: Michael Roth > > input.c |2 +- > qapi-schema.json |8 +--- >

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Crístian Viana
On 27-04-2012 18:23, Peter Maydell wrote: That appears to contain one of your older versions of this patch, not v3. (It touches bsd-user/main.c, for example.) -- PMM You were right, it was an older version. Now the branch is updated and rebased against the current master. Best regards, Crísti

[Qemu-devel] [PATCH 2/3] qemu-ga: add a whitelist for fsfreeze-safe commands

2012-04-27 Thread Michael Roth
Currently we rely on fsfreeze/thaw commands disabling/enabling logging then having other commands check whether logging is disabled to avoid executing if they aren't safe for running while a filesystem is frozen. Instead, have an explicit whitelist of fsfreeze-safe commands, and consolidate loggin

[Qemu-devel] [PATCH 1/3] qemu-ga: improve recovery options for fsfreeze

2012-04-27 Thread Michael Roth
guest-fsfreeze-thaw relies on state information obtained from guest-fsfreeze-freeze to determine what filesystems to unfreeze. This is unreliable due to the fact that that state does not account for FIFREEZE being issued by other processes, or previous instances of qemu-ga. This means in certain si

[Qemu-devel] [PATCH 3/3] qemu-ga: persist tracking of fsfreeze state via filesystem

2012-04-27 Thread Michael Roth
Currently, qemu-ga may die/get killed/go away for whatever reason after guest-fsfreeze-freeze has been issued, and before guest-fsfreeze-thaw has been issued. This means the only way to unfreeze the guest is via VNC/network/console access, but obtaining that access after-the-fact can often be very

[Qemu-devel] [PULL] qemu-ga: fsfreeze hardening/fixes

2012-04-27 Thread Michael Roth
The following changes since commit a8b69b8e2431edfcb6c4cfb069787e9071d6235b: Merge remote-tracking branch 'qmp/queue/qmp' into staging (2012-04-27 12:00:06 -0500) are available in the git repository at: git://github.com/mdroth/qemu.git qga-pull-4-27-12 Michael Roth (3): qemu-ga: impr

Re: [Qemu-devel] [PATCH v2] Remove the extra -lrt switch

2012-04-27 Thread Eric Blake
On 04/27/2012 04:20 PM, Andreas Färber wrote: > Am 27.04.2012 23:55, schrieb Eric Blake: >> On 04/27/2012 02:16 PM, Peter Portante wrote: >>> The package config check for gthreads might have already placed a >>> -lrt switch in LIBS earlier. >>> >>> Refactored the code from the pthread switch remova

[Qemu-devel] [PATCH] slirp: Untangle TCPOLEN_* from TCPOPT_*

2012-04-27 Thread Andreas Färber
From: Andreas Färber Commit b72210568ef0c0fb141a01cffb71a09c4efa0364 (slirp: clean up conflicts with system headers) enclosed TCPOLEN_MAXSEG with an #ifdef TCPOPT_EOL. This broke the build on illumos, which has TCPOPT_* but not TCPOLEN_*. Move them to their own #ifdef TCPOLEN_MAXSEG section to r

Re: [Qemu-devel] [PATCH v2] Remove the extra -lrt switch

2012-04-27 Thread Eric Blake
On 04/27/2012 04:16 PM, Peter Maydell wrote: > On 27 April 2012 22:55, Eric Blake wrote: >> Shorter (and probably faster) to write this as: >> >> add_to_libs() { >> case " $LIBS " in >>" $1 ") ;; >>*) LIBS="$1 $LIBS" ;; >> esac >> } > > ...doesn't that need to be > *" $1 "*) ;; Ye

Re: [Qemu-devel] [Bug 965867] Re: 9p virtual file system on qemu slow

2012-04-27 Thread Lutz Vieweg
On 04/26/2012 07:25 AM, M. Mohan Kumar wrote: Hi Max, Could you try passing msize=262144 for 9p mount point and post the results? Indeed the default value of 4096 for msize is unreasonably low. As I wrote in January on this mailing list: 128k would be a much more appropriate default value - p

Re: [Qemu-devel] [PATCH v2] Remove the extra -lrt switch

2012-04-27 Thread Andreas Färber
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 27.04.2012 23:55, schrieb Eric Blake: > On 04/27/2012 02:16 PM, Peter Portante wrote: >> The package config check for gthreads might have already placed a >> -lrt switch in LIBS earlier. >> >> Refactored the code from the pthread switch removal, fr

Re: [Qemu-devel] [PATCH v2] Remove the extra -lrt switch

2012-04-27 Thread Peter Maydell
On 27 April 2012 22:55, Eric Blake wrote: > Shorter (and probably faster) to write this as: > > add_to_libs() { >  case " $LIBS " in >    " $1 ") ;; >    *) LIBS="$1 $LIBS" ;; >  esac > } ...doesn't that need to be *" $1 "*) ;; ? -- PMM

Re: [Qemu-devel] [PATCH v2] Remove the extra -lrt switch

2012-04-27 Thread Eric Blake
On 04/27/2012 02:16 PM, Peter Portante wrote: > The package config check for gthreads might have already placed > a -lrt switch in LIBS earlier. > > Refactored the code from the pthread switch removal, from commit > e3c56761b465a4253871c32b06ebbc2d8b3fc3e1, to make it work for the > more general c

Re: [Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Jordan Justen
On Fri, Apr 27, 2012 at 11:47, Laszlo Ersek wrote: > This was how I interpreted our discussion with Jordan: > > L: Shouldn't qemu & OVMF agree on GPE0? > J: Why? Anyway, OVMF should be correct, because all ACPI registers are > in one tight bunch, starting from 0x400. > L: None of those two charact

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Peter Maydell
On 27 April 2012 22:16, Crístian Viana wrote: > On 27-04-2012 14:41, Anthony Liguori wrote: >> >> Can you post a git tree on github so I can look at the difference?  Maybe >> patch applied it wrong. > > git://github.com/cd1/qemu.git, branch qemu-version That appears to contain one of your older v

[Qemu-devel] [PATCH 6/7] qdev: use int32_t container for devfn property

2012-04-27 Thread Michael Roth
Valid range for devfn is -1 to 255 (-1 for automatic assignment). We do not currently validate this due to devfn being stored as a uint32_t. This can lead to segfaults and other strange behavior. We could technically just cast it to int32_t to implement the checking, but this will not work for vis

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Crístian Viana
On 27-04-2012 14:41, Anthony Liguori wrote: Can you post a git tree on github so I can look at the difference? Maybe patch applied it wrong. git://github.com/cd1/qemu.git, branch qemu-version Best regards, Crístian.

[Qemu-devel] [PATCH 2/7] qapi: QMP input visitor, handle floats parsed as ints

2012-04-27 Thread Michael Roth
JSON numbers can be interpreted as either integers or floating point values depending on their representation. As a result, QMP input visitor might visit a QInt when it was expecting a QFloat, so add handling to account for this. Signed-off-by: Michael Roth --- qapi/qmp-input-visitor.c |9 ++

[Qemu-devel] [PATCH 2/3] runstate: introduce suspended state

2012-04-27 Thread Luiz Capitulino
QEMU enters in this state when the guest suspends to ram (S3). This is important so that HMP users and QMP clients can know that the guest is suspended. QMP clients also have an event for this, but events are not reliable and are limited (ie. a client can connect to QEMU after the event has been e

[Qemu-devel] [PATCH 3/3] vl: Drop is_suspended variable

2012-04-27 Thread Luiz Capitulino
Check for the RUN_STATE_SUSPENDED state instead. Signed-off-by: Luiz Capitulino --- vl.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vl.c b/vl.c index 2d828c8..43c696d 100644 --- a/vl.c +++ b/vl.c @@ -1292,7 +1292,6 @@ static pid_t shutdown_pid; static int powe

[Qemu-devel] [PATCH 5/7] qapi: add String visitor coverage to serialization unit tests

2012-04-27 Thread Michael Roth
Signed-off-by: Michael Roth --- tests/test-visitor-serialization.c | 40 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c index 6ef57d0..b8ad16f 100644 --- a/tests/test-

[Qemu-devel] [PATCH 3/7] qapi: unit tests for visitor-based serialization

2012-04-27 Thread Michael Roth
Currently we test our visitors individually, and seperately for input vs. output. This is useful for validating internal representations against the native C types and vice-versa, and other visitor-specific testing, but it doesn't cover the potential use-case of using visitor pairs for serializatio

[Qemu-devel] [PATCH 1/3] qapi-schema.json: fix RunState enums alphabetical order

2012-04-27 Thread Luiz Capitulino
Signed-off-by: Luiz Capitulino --- qapi-schema.json |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 9193fb9..0166ec2 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -92,6 +92,8 @@ # # @debug: QEMU is running on a debug

[Qemu-devel] [PATCH 0/3]: runstate: introduce 'suspended' state

2012-04-27 Thread Luiz Capitulino
I thought this would be trivial, but it brought a new issue. Please, check patch 2/3 for more details. input.c |2 +- qapi-schema.json |8 +--- qmp.c|2 ++ vl.c | 13 - 4 files changed, 16 insertions(+), 9 deletions(-)

[Qemu-devel] [PATCH 7/7] qdev: switch property accessors to fixed-width visitor interfaces

2012-04-27 Thread Michael Roth
Signed-off-by: Michael Roth --- hw/qdev-addr.c |4 +- hw/qdev-properties.c | 150 + 2 files changed, 91 insertions(+), 63 deletions(-) diff --git a/hw/qdev-addr.c b/hw/qdev-addr.c index 0bb16c7..b711b6b 100644 --- a/hw/qdev-addr.c +++ b

[Qemu-devel] [PATCH 4/7] qapi: String visitor, use %f represenation for floats

2012-04-27 Thread Michael Roth
Currently string-output-visitor formats floats as %g, which is nice in that trailing 0's are automatically truncated, but otherwise this causes some issues: - it 6 uses significant figures instead of 6 decimal places, which means something like 155777.5 (which even has an exact floating point

[Qemu-devel] [PATCH 1/7] qapi: add Visitor interfaces for uint*_t and int*_t

2012-04-27 Thread Michael Roth
This adds visitor interfaces for fixed-width integers types. Implementing these in visitors is optional, otherwise we fall back to visit_type_int() (int64_t) with some additional bounds checking to avoid integer overflows for cases where the value fetched exceeds the bounds of our target C type. S

[Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes

2012-04-27 Thread Michael Roth
These patches apply on top of qemu.git master, and can also be obtained from: git://github.com/mdroth/qemu.git visitor-fixed-width-v5 Some of these were being carried as part of Paolo's realize series due to some conflicts, but that looks to be targetted for 1.2 now, and there's a QMP visitor bug

[Qemu-devel] [PATCH v2] Remove the extra -lrt switch

2012-04-27 Thread Peter Portante
The package config check for gthreads might have already placed a -lrt switch in LIBS earlier. Refactored the code from the pthread switch removal, from commit e3c56761b465a4253871c32b06ebbc2d8b3fc3e1, to make it work for the more general case. Signed-off-by: Peter Portante --- configure | 26

[Qemu-devel] [PATCH] virtio-serial-bus: Unset guest_connected at reset and driver reset

2012-04-27 Thread Amit Shah
When a guest driver resets the virtio status to not ready, or when qemu is reset, reset all ports' guest_connected bit and let port users know of this event if they have the guest_close() callback registered. Reviewed-by: Alon Levy Signed-off-by: Amit Shah --- Fix style acc. to mst's comments (b

Re: [Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Gleb Natapov
On Fri, Apr 27, 2012 at 08:47:00PM +0200, Laszlo Ersek wrote: > On 04/27/12 20:09, Gleb Natapov wrote: > > On Fri, Apr 27, 2012 at 07:24:48PM +0200, Laszlo Ersek wrote: > > >> >From "5.2.9 Fixed ACPI Description Table (FADT)" in the ACPI spec (v5.0) > >> it would appear OVMF can freely choose wher

Re: [Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Laszlo Ersek
On 04/27/12 20:09, Gleb Natapov wrote: > On Fri, Apr 27, 2012 at 07:24:48PM +0200, Laszlo Ersek wrote: >> >From "5.2.9 Fixed ACPI Description Table (FADT)" in the ACPI spec (v5.0) >> it would appear OVMF can freely choose where to put GPE0_BLK, in both >> senses (ie. port address considered alone,

Re: [Qemu-devel] [PATCH 0/2] core dump: re-purpose VM_ALWAYSDUMP to user controlled VM_DONTDUMP

2012-04-27 Thread Jason Baron
On Tue, Apr 24, 2012 at 10:42:16AM +1200, Michael Kerrisk wrote: > Jason, > > On Thu, Mar 8, 2012 at 6:00 AM, Jason Baron wrote: > > Hi, > > > > The motivation for this change was that I was looking at a way for a > > qemu-kvm > > process, to exclude the guest memory from its core dump, which ca

[Qemu-devel] [Bug 712416] Re: kvm_intel kernel module crash with via nano vmx

2012-04-27 Thread James Page
** Changed in: kvm (Ubuntu) Importance: Undecided => Low -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/712416 Title: kvm_intel kernel module crash with via nano vmx Status in QEMU: New Status

Re: [Qemu-devel] [PATCH] Remove extra -lrt switch

2012-04-27 Thread Peter Portante
On 04/27/2012 02:14 PM, Peter Maydell wrote: On 27 April 2012 18:43, Peter Portante wrote: Remove the extra -lrt switch which might be there from the package config check for gthreads. See also: e3c56761b465a4253871c32b06ebbc2d8b3fc3e1 for the extra pthread switch removal. Signed-off-by: Pete

[Qemu-devel] Logging error in x86 after move to %cr4

2012-04-27 Thread Scott Miller
Hi, I'm getting the following error in a qemu trace file: "Disassembler disagrees with translator over instruction decoding Please report this to qemu-devel@nongnu.org" The instruction sequence involves a move to %cr4. After this instruction, the trace output is corrupted. The actual emulation

Re: [Qemu-devel] [PATCH] Remove extra -lrt switch

2012-04-27 Thread Peter Maydell
On 27 April 2012 18:43, Peter Portante wrote: > Remove the extra -lrt switch which might be there from the package > config check for gthreads. > > See also: e3c56761b465a4253871c32b06ebbc2d8b3fc3e1 for the extra > pthread switch removal. > > Signed-off-by: Peter Portante > --- >  configure |   1

Re: [Qemu-devel] [PATCH 4/4] configure: check for supported Python 2.x versions

2012-04-27 Thread Lluís Vilanova
Stefan Hajnoczi writes: > The tracetool code requires Python 2.4, which was released in 2004. > Check for a supported Python version so we can give a clear error > message. > Signed-off-by: Stefan Hajnoczi > --- > configure |7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > di

Re: [Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Gleb Natapov
On Fri, Apr 27, 2012 at 07:24:48PM +0200, Laszlo Ersek wrote: > On 04/27/12 17:12, Jordan Justen wrote: > > On Fri, Apr 27, 2012 at 07:31, Laszlo Ersek wrote: > > >> edk2's "OvmfPkg/AcpiTables/Platform.h" specifies GPE0_BLK at 0x40C, > >> while qemu's "hw/acpi_piix4.c" expects the guest to access

[Qemu-devel] [Bug 989504] [NEW] assertion failed when attaching USB MSD device

2012-04-27 Thread Roy Tam
Public bug reported: version: git rev be5ea8ed4481f0ffa4ea0f7ba13e465701536001 commandline: qemu-system-i386 -usb -fda dosusb.img -drive if=none,id=usbstick,file=usb.img -device usb-storage,bus=usb.0,drive=usbstick -boot a -L d:\_programs\qemu --- Microsoft Visual C++ Ru

Re: [Qemu-devel] [PATCH] Remove extra -lrt switch

2012-04-27 Thread Peter Portante
On Fri, Apr 27, 2012 at 1:43 PM, Peter Portante wrote: > Remove the extra -lrt switch which might be there from the package > config check for gthreads. > > See also: e3c56761b465a4253871c32b06ebbc2d8b3fc3e1 for the extra > pthread switch removal. > FYI: I am not trying to dribble these in, I am

Re: [Qemu-devel] [PATCH 3/4] tracetool: avoid str.rpartition() Python 2.5 function

2012-04-27 Thread Lluís Vilanova
Stefan Hajnoczi writes: > The str.rpartition() function is related to str.split() and is used for > splitting strings. It was introduced in Python 2.5 and therefore cannot > be used in tracetool as Python 2.4 compatibility is required. > Replace the code using str.rsplit(). > Signed-off-by: Ste

[Qemu-devel] [PATCH] Remove extra -lrt switch

2012-04-27 Thread Peter Portante
Remove the extra -lrt switch which might be there from the package config check for gthreads. See also: e3c56761b465a4253871c32b06ebbc2d8b3fc3e1 for the extra pthread switch removal. Signed-off-by: Peter Portante --- configure | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Anthony Liguori
On 04/27/2012 12:16 PM, Crístian Viana wrote: On 25-04-2012 16:16, Anthony Liguori wrote: If you run: x86_64-softmmu/qemu-system-x86_64 This will SEGV because machine == NULL. It's quite a bit later in this function when machine gets initialized with the default machine. You mean running onl

Re: [Qemu-devel] [PATCH 2/4] tracetool: use Python 2.4-compatible __import__() arguments

2012-04-27 Thread Lluís Vilanova
Stefan Hajnoczi writes: > In Python 2.5 keyword arguments were added to __import__(). Avoid using > them to achieve Python 2.4 compatibility. > Signed-off-by: Stefan Hajnoczi Reviewed-by: Lluís Vilanova > --- > scripts/tracetool/__init__.py |2 +- > 1 file changed, 1 insertion(+), 1 del

Re: [Qemu-devel] [PATCH 1/4] tracetool: use Python 2.4-compatible exception handling syntax

2012-04-27 Thread Lluís Vilanova
Stefan Hajnoczi writes: > The newer "except as :" syntax is not > supported by Python 2.4, we need to use "except , > :". > Tested all trace backends with Python 2.4. > Reported-by: Andreas Färber > Signed-off-by: Stefan Hajnoczi Reviewed-by: Lluís Vilanova > --- > scripts/tracetool.py |

[Qemu-devel] [PATCH V3 11/13] SD card: introduce "spi" property for SD card objects

2012-04-27 Thread Igor Mitsyanko
And drop passing is_spi argument to SDCardClass::init function. "spi" property could be set while SD card is in IDLE state. It defaults to "false". Signed-off-by: Igor Mitsyanko --- hw/sd.c | 33 +++-- hw/sd.h |8 ++-- 2 files changed, 37 insertions(+), 4 d

Re: [Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Laszlo Ersek
On 04/27/12 17:12, Jordan Justen wrote: > On Fri, Apr 27, 2012 at 07:31, Laszlo Ersek wrote: >> edk2's "OvmfPkg/AcpiTables/Platform.h" specifies GPE0_BLK at 0x40C, >> while qemu's "hw/acpi_piix4.c" expects the guest to access it at 0xAFE0. >> Which macro should be modified to get them in sync? >

[Qemu-devel] [PATCH V3 13/13] hw/sd.c: introduce "eject" property for SD card objects

2012-04-27 Thread Igor Mitsyanko
Boolean property "eject" could be used to query if virtual media is inserted into SD card object, or to deattach BlockDriverState from SD card object. Signed-off-by: Igor Mitsyanko --- hw/sd.c | 60 +++- 1 files changed, 51 insertions(+)

Re: [Qemu-devel] [PATCH 1/1 v3] Allow machines to configure the QEMU_VERSION that's exposed via hardware

2012-04-27 Thread Crístian Viana
On 25-04-2012 16:16, Anthony Liguori wrote: If you run: x86_64-softmmu/qemu-system-x86_64 This will SEGV because machine == NULL. It's quite a bit later in this function when machine gets initialized with the default machine. You mean running only the binary, without arguments? I got no SEG

[Qemu-devel] [PATCH V3 08/13] hw/sd.c: add SD card save/load support

2012-04-27 Thread Igor Mitsyanko
This patch updates SD card emulation to support save/load of card's state. Signed-off-by: Igor Mitsyanko --- hw/sd.c | 88 +- 1 files changed, 64 insertions(+), 24 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 20ebd8e..f8ab045 10

[Qemu-devel] [PULL 4/6] block: add 'speed' optional parameter to block-stream

2012-04-27 Thread Luiz Capitulino
From: Stefan Hajnoczi Allow streaming operations to be started with an initial speed limit. This eliminates the window of time between starting streaming and issuing block-job-set-speed. Users should use the new optional 'speed' parameter instead so that speed limits are in effect immediately wh

[Qemu-devel] [PATCH V3 09/13] hw/sd.c: convert SD state to QOM object

2012-04-27 Thread Igor Mitsyanko
A straightforward conversion of SD card implementation to a proper QEMU object. Wrapper functions were introduced for SDClass methods in order to avoid SD card users modification. Because of this, name change for several functions in hw/sd.c was required. Signed-off-by: Igor Mitsyanko --- hw/sd

[Qemu-devel] [PATCH V3 02/13] hw/sd.c: make sd_wp_addr() accept 64 bit address argument

2012-04-27 Thread Igor Mitsyanko
Currently sd_wp_addr() accepts 32 bit address arguments therefore implicitly restricting SD card address range. Change address argument type to uint64_t. Signed-off-by: Igor Mitsyanko --- hw/sd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 57

[Qemu-devel] [PULL 1/6] block: use Error mechanism instead of -errno for block_job_create()

2012-04-27 Thread Luiz Capitulino
From: Stefan Hajnoczi The block job API uses -errno return values internally and we convert these to Error in the QMP functions. This is ugly because the Error should be created at the point where we still have all the relevant information. More importantly, it is hard to add new error cases to

[Qemu-devel] [PATCH V3 06/13] hw/sd.c: make sd_dataready() return bool

2012-04-27 Thread Igor Mitsyanko
For the sake of code clarity Signed-off-by: Igor Mitsyanko Reviewed-by: Peter Maydell --- hw/sd.c |2 +- hw/sd.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index d4a8927..a51d18d 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -1705,7 +1705,7 @@ uint8_

[Qemu-devel] [PATCH V3 03/13] hw/sd.c: introduce wrapper for conversion address to wp group

2012-04-27 Thread Igor Mitsyanko
Add wrapper function sd_addr_to_wpnum() to replace long address-->wg_group conversion line. Signed-off-by: Igor Mitsyanko --- hw/sd.c | 27 +-- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index e24d04a..d0674d5 100644 --- a/hw/sd.c

Re: [Qemu-devel] [PATCH V3 12/13] hw/sd.c: introduce SD card "device-id" property

2012-04-27 Thread Igor Mitsyanko
On 04/27/2012 08:34 PM, Markus Armbruster wrote: Igor Mitsyanko writes: Setting "device-id" SD card property ties SD card with BlockDriverState of the same name. This property can be set dynamically, allowing for SD card hot-insert. With "device-id" property we no longer need SDClass::init

[Qemu-devel] [PATCH V3 12/13] hw/sd.c: introduce SD card "device-id" property

2012-04-27 Thread Igor Mitsyanko
Setting "device-id" SD card property ties SD card with BlockDriverState of the same name. This property can be set dynamically, allowing for SD card hot-insert. With "device-id" property we no longer need SDClass::init method, all work is done in property setter. Signed-off-by: Igor Mitsyanko -

[Qemu-devel] [PATCH V3 10/13] SD card users: optimize access to SDClass methods

2012-04-27 Thread Igor Mitsyanko
Rather that repeatedly call SD_GET_CLASS() in a loop, call it once before a loop starts. Signed-off-by: Igor Mitsyanko --- hw/omap_mmc.c|9 + hw/pl181.c |7 --- hw/pxa2xx_mmci.c |6 -- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/omap_m

[Qemu-devel] [PATCH V3 01/13] hw/sd.c: convert wp_groups in SDState to bitfield

2012-04-27 Thread Igor Mitsyanko
Representing each group write protection flag with only one bit instead of int variable significantly reduces memory consumption. Signed-off-by: Igor Mitsyanko --- hw/sd.c | 33 +++-- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/hw/sd.c b/hw/sd.c

[Qemu-devel] [PATCH V3 05/13] hw/sd.c: convert binary variables to bool

2012-04-27 Thread Igor Mitsyanko
Several members of SDState have type int when they actually are binary variables. Change type of these variables to bool to improve code readability. Change SD API to be in consistency with new variables type. Signed-off-by: Igor Mitsyanko Reviewed-by: Peter Maydell --- hw/sd.c | 24 +++

[Qemu-devel] [PATCH V3 07/13] hw/sd.c: make sd_wp_addr() return bool

2012-04-27 Thread Igor Mitsyanko
For the sake of code clarity Signed-off-by: Igor Mitsyanko --- hw/sd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index a51d18d..20ebd8e 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -544,7 +544,7 @@ static void sd_function_switch(SDState *sd, uint32_t ar

Re: [Qemu-devel] [PATCH V3 12/13] hw/sd.c: introduce SD card "device-id" property

2012-04-27 Thread Markus Armbruster
Igor Mitsyanko writes: > Setting "device-id" SD card property ties SD card with BlockDriverState of the > same name. This property can be set dynamically, allowing for SD card > hot-insert. > > With "device-id" property we no longer need SDClass::init method, all work is > done in property sette

[Qemu-devel] [PATCH V3 00/13] SD save/load support, SD qomification and bug fixes

2012-04-27 Thread Igor Mitsyanko
v2->v3 Patchset modified in such a way that all existing SD card model users are left intact. PATCH10 modifies hw/omap_mmc.c, hw/pl181.c and hw/pxa2xx_mmci.c but I'm not sure about its necessity. - don't use BITS_TO_LONGS when operating with bitfields; - added wrapper for trnslating SD card ad

Re: [Qemu-devel] [PATCH v2 06/24] qdev: fix -device foo,?

2012-04-27 Thread Anthony Liguori
On 04/27/2012 04:37 AM, Jiri Denemark wrote: On Wed, Apr 11, 2012 at 23:30:24 +0200, Paolo Bonzini wrote: Since most property types do not have a parse property now, this was broken. Fix it by looking at the setter instead. Signed-off-by: Paolo Bonzini --- hw/qdev-monitor.c |4 ++-- 1 f

[Qemu-devel] [PATCH V3 04/13] hw/sd.c: favour SD card type (SDSC or SDHC) when performing erase

2012-04-27 Thread Igor Mitsyanko
SDSC cards use byte unit address and SDHC and SDXC Cards use block unit address (512 bytes) when setting ERASE_START and ERASE_END with CMD32 and CMD33, we need to account for this. Signed-off-by: Igor Mitsyanko --- hw/sd.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --

Re: [Qemu-devel] [PATCH 1/3] Fix geometry sector calculation

2012-04-27 Thread Paolo Bonzini
Il 26/04/2012 15:49, Christian Borntraeger ha scritto: > Currently the sector value for the geometry is masked based on > the sector size. This works fine for with 512 physical sector size, > but it fails for dasd devices on s390. A dasd device can have > a physical block size of 4096 (== same for

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-04-27 Thread Paolo Bonzini
Il 26/04/2012 15:49, Christian Borntraeger ha scritto: > +#ifdef __linux__ > +} else if (bdrv_ioctl(bs, HDIO_GETGEO, &geo) == 0) { > +*pcyls = geo.cylinders; > +*pheads = geo.heads; > +*psecs = geo.sectors; > +bdrv_set_geometry_hint(bs, *pcyls, *pheads, *psecs);

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Luiz Capitulino
On Fri, 27 Apr 2012 09:22:46 -0600 Eric Blake wrote: > On 04/27/2012 07:26 AM, Luiz Capitulino wrote: > > The test n == ULLONG_MAX is redundant. > > But harmless. > >>> > >>> Yes, and I prefer to comply to the standard (as there's no strong > >>> reason not to do so). > >> > >> What

[Qemu-devel] [PULL 3/6] block: change block-job-set-speed argument from 'value' to 'speed'

2012-04-27 Thread Luiz Capitulino
From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Acked-by: Kevin Wolf Signed-off-by: Luiz Capitulino --- block.c |6 +++--- block/stream.c |8 block_int.h |4 ++-- blockdev.c |4 ++-- hmp-commands.hx |4 ++-- qapi-schema.json |4 ++--

Re: [Qemu-devel] [PATCH, repost] qemu-keymaps: Finnish keyboard mapping broken

2012-04-27 Thread Anthony Liguori
On 04/27/2012 02:08 AM, Markus Armbruster wrote: Michael Tokarev writes: On 14.04.2012 00:08, Anthony Liguori wrote: On 04/04/2012 07:34 AM, Michael Tokarev wrote: As mentioned in http://bugs.debian.org/660154 , finnish keyboard mapping is kind of broken. Fix it as Timo Sirainen suggests in

[Qemu-devel] [PATCH] qemu-timer: Fix limits for w32 mmtimer

2012-04-27 Thread Stefan Weil
timeSetEvent only accepts delays in the range which is returned by timeGetDevCaps. The lower limit is typically 1 (= 1 ms), so the constant value of 1 in the old code usually worked. The upper limit can be as low as 1 ms, so the latest changes in QEMU's timer handling which introduced timeout

[Qemu-devel] [PULL 2/6] block: use Error mechanism instead of -errno for block_job_set_speed()

2012-04-27 Thread Luiz Capitulino
From: Stefan Hajnoczi There are at least two different errors that can occur in block_job_set_speed(): the job might not support setting speeds or the value might be invalid. Use the Error mechanism to report the error where it occurs. Signed-off-by: Stefan Hajnoczi Acked-by: Kevin Wolf Signe

[Qemu-devel] [PULL 6/6] qapi: fix qmp_balloon() conversion

2012-04-27 Thread Luiz Capitulino
Commit d72f326431 forgot to convert a call from qerror_report() to error_set(). Fix it. Signed-off-by: Luiz Capitulino Reviewed-by: Michael Roth --- balloon.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balloon.c b/balloon.c index 0166744..aa354f7 100644 --- a/balloon

[Qemu-devel] [PULL 0/6]: QMP queue

2012-04-27 Thread Luiz Capitulino
Contains Stefan's new 'speed' argument to the block-stream command and a small fix from me to qmp_balloon(). I'm not including the netdev_add/del conversion and the HMP fixes to give any potential reviewers more time. The changes (since be5ea8ed4481f0ffa4ea0f7ba13e465701536001) are available in t

[Qemu-devel] [PULL 5/6] qemu-iotests: add block-stream speed value test case

2012-04-27 Thread Luiz Capitulino
From: Stefan Hajnoczi Add tests to exercise the InvalidParameter 'speed' error code path, as well as the regular success case for setting the speed. The block-stream 'speed' parameter allows the speed limit of the job to be applied immediately when the job starts instead of issuing a separate bl

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Eric Blake
On 04/27/2012 07:26 AM, Luiz Capitulino wrote: > The test n == ULLONG_MAX is redundant. But harmless. >>> >>> Yes, and I prefer to comply to the standard (as there's no strong >>> reason not to do so). >> >> What standard? > > http://pubs.opengroup.org/onlinepubs/009695399/functions/

[Qemu-devel] scsi-testsuite for virtio-scsi

2012-04-27 Thread Stefan Hajnoczi
Christoph Hellwig has announced a new testsuite for the Linux in-kernel SCSI target: http://risingtidesystems.com/git/?p=scsi-testsuite.git;a=tree We will need something similar for virtio-scsi. Maybe we can contribute and use this for QEMU SCSI emulation testing, I haven't checked how target-sp

Re: [Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Jordan Justen
On Fri, Apr 27, 2012 at 07:31, Laszlo Ersek wrote: > edk2's "OvmfPkg/AcpiTables/Platform.h" specifies GPE0_BLK at 0x40C, > while qemu's "hw/acpi_piix4.c" expects the guest to access it at 0xAFE0. > Which macro should be modified to get them in sync? Do they need to be in sync? We set PBMA to 0x4

[Qemu-devel] [PATCH] main-loop: Fix build for w32 and w64

2012-04-27 Thread Stefan Weil
This patch fixes a build regression with MinGW which was introduced by commit 7c7db75576bd5a31508208f153c5aada64b2c8df. The 3rd argument of g_main_context_query must point to a gint value. Using a pointer to an uint32_t value is wrong. The timeout argument of function os_host_main_loop_wait was n

Re: [Qemu-devel] [PATCH] tracetool: use Python 2.5-compatible exception handling syntax

2012-04-27 Thread Stefan Hajnoczi
On Wed, Apr 25, 2012 at 10:42 AM, Stefan Hajnoczi wrote: > The newer "except as :" syntax is not > supported by Python 2.5, we need to use "except , > :". > > Tested all trace backends with Python 2.5.6. > > Reported-by: Andreas Färber > Signed-off-by: Stefan Hajnoczi > --- >  scripts/tracetool

[Qemu-devel] [PATCH 3/4] tracetool: avoid str.rpartition() Python 2.5 function

2012-04-27 Thread Stefan Hajnoczi
The str.rpartition() function is related to str.split() and is used for splitting strings. It was introduced in Python 2.5 and therefore cannot be used in tracetool as Python 2.4 compatibility is required. Replace the code using str.rsplit(). Signed-off-by: Stefan Hajnoczi --- scripts/tracetoo

Re: [Qemu-devel] [PATCH 12/12 v14] introduce a new monitor command 'dump-guest-memory' to dump guest's memory

2012-04-27 Thread Luiz Capitulino
On Tue, 24 Apr 2012 12:10:07 +0800 Wen Congyang wrote: > The command's usage: >dump [-p] protocol [begin] [length] > The supported protocol can be file or fd: > 1. file: the protocol starts with "file:", and the following string is >the file's path. > 2. fd: the protocol starts with "fd:"

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()

2012-04-27 Thread Eric Blake
On 04/26/2012 05:18 PM, Luiz Capitulino wrote: >> Not quite right. ULLONG_MAX is a valid return, but you did not prime >> errno, so if errno has junk ERANGE from some earlier point in the >> program, you will have a false negative. You are guaranteed that errno >> is unchanged on success, so prim

[Qemu-devel] synching GPE0_BLK between OVMF and qemu

2012-04-27 Thread Laszlo Ersek
Hi, I'm trying to "improve understanding" between OVMF and qemu-kvm. edk2's "OvmfPkg/AcpiTables/Platform.h" specifies GPE0_BLK at 0x40C, while qemu's "hw/acpi_piix4.c" expects the guest to access it at 0xAFE0. Which macro should be modified to get them in sync? (SeaBIOS's "src/acpi.c" #defines P

[Qemu-devel] [PATCH 4/4] configure: check for supported Python 2.x versions

2012-04-27 Thread Stefan Hajnoczi
The tracetool code requires Python 2.4, which was released in 2004. Check for a supported Python version so we can give a clear error message. Signed-off-by: Stefan Hajnoczi --- configure |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 15

[Qemu-devel] [PATCH 1/4] tracetool: use Python 2.4-compatible exception handling syntax

2012-04-27 Thread Stefan Hajnoczi
The newer "except as :" syntax is not supported by Python 2.4, we need to use "except , :". Tested all trace backends with Python 2.4. Reported-by: Andreas Färber Signed-off-by: Stefan Hajnoczi --- scripts/tracetool.py |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[Qemu-devel] [PATCH 2/4] tracetool: use Python 2.4-compatible __import__() arguments

2012-04-27 Thread Stefan Hajnoczi
In Python 2.5 keyword arguments were added to __import__(). Avoid using them to achieve Python 2.4 compatibility. Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool/__init__.py b/scripts/trace

[Qemu-devel] [PATCH 0/4] tracetool: Python 2.4 compatibility fixes

2012-04-27 Thread Stefan Hajnoczi
The new Python tracetool implementation works great but does not run on older Python installations. This series takes us back to the happy days of Python 2.4, which was released in 2004. As a result tracetool should now work again on Mac OS X v10.5.8, OpenIndiana oi_151a, Solaris 10 U9, and Red H

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()

2012-04-27 Thread Luiz Capitulino
On Fri, 27 Apr 2012 08:07:20 -0600 Eric Blake wrote: > On 04/26/2012 05:18 PM, Luiz Capitulino wrote: > >> Not quite right. ULLONG_MAX is a valid return, but you did not prime > >> errno, so if errno has junk ERANGE from some earlier point in the > >> program, you will have a false negative. Yo

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Luiz Capitulino
On Fri, 27 Apr 2012 15:28:56 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > It's not checked currently, so something like: > > > > (qemu) balloon -10114334234 > > (qemu) > > > > Will just "work" (in this case the balloon command will get a random > > value).

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Markus Armbruster
Luiz Capitulino writes: > It's not checked currently, so something like: > > (qemu) balloon -10114334234 > (qemu) > > Will just "work" (in this case the balloon command will get a random > value). > > Fix it by checking if strtoul()/strtoull() overflowed. > > Signed-off-by: Lu

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Luiz Capitulino
On Fri, 27 Apr 2012 15:24:51 +0200 Markus Armbruster wrote: > Luiz Capitulino writes: > > > On Fri, 27 Apr 2012 06:22:48 -0600 > > Eric Blake wrote: > > > >> On 04/27/2012 03:04 AM, Markus Armbruster wrote: > >> > Luiz Capitulino writes: > >> > > >> >> It's not checked currently, so somethin

Re: [Qemu-devel] [PATCH 2/2] hmp: fix bad value conversion for M type

2012-04-27 Thread Markus Armbruster
Luiz Capitulino writes: > The M type converts from megabytes to bytes. However, the value can be > negative before the conversion, which will lead to a flawed conversion. > > For example, this: > > (qemu) balloon -1011 > (qemu) > > Just "works", but the value passed by the balloon c

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Markus Armbruster
Luiz Capitulino writes: > On Fri, 27 Apr 2012 06:22:48 -0600 > Eric Blake wrote: > >> On 04/27/2012 03:04 AM, Markus Armbruster wrote: >> > Luiz Capitulino writes: >> > >> >> It's not checked currently, so something like: >> >> >> >> >> +++ b/monitor.c >> >> @@ -3120,10 +3120,17 @@ static int

Re: [Qemu-devel] [PATCH 1/2] hmp: expr_unary(): check for overflow in strtoul()/strtoull()

2012-04-27 Thread Markus Armbruster
Eric Blake writes: > On 04/27/2012 03:04 AM, Markus Armbruster wrote: >> Luiz Capitulino writes: [...] >> You silently interpret a string that doesn't parse as zero. > > No... > >>> +if (n == ULONG_MAX && errno == ERANGE) { >>> +expr_error(mon, "number too large"); >>> +

Re: [Qemu-devel] [PATCH 3/3] support host sensing of block sizes

2012-04-27 Thread Christoph Hellwig
On Thu, Apr 26, 2012 at 03:49:25PM +0200, Christian Borntraeger wrote: > From: Einar Lueck > > This patch provides a new function to guess physical and logical block > sizes and exploits them in the context of s390 virtio bus. On s390 > there may be block sizes different then 512. Therefore, we w

  1   2   >