[Qemu-block] [PATCH RESEND v2 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION

2015-10-30 Thread Eduardo Habkost
szlo Ersek Signed-off-by: Eduardo Habkost --- hw/scsi/megasas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index dcd724e..d7dc667 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -757,7 +757,7 @@ static int megasas_ctr

Re: [Qemu-block] [PATCH v7 12/35] util: let qemu_fd_getlength support block device

2015-11-06 Thread Eduardo Habkost
As this patch affects raw_getlength(), CCing the raw block driver maintainer and the qemu-block mailing list. On Mon, Nov 02, 2015 at 05:13:14PM +0800, Xiao Guangrong wrote: > lseek can not work for all block devices as the man page says: > | Some devices are incapable of seeking and POSIX does no

Re: [Qemu-block] [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-06 Thread Eduardo Habkost
As this patch affects raw_getlength(), CCing the raw block driver maintainer and the qemu-block mailing list. On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote: > It is used to get the size of the specified file, also qemu_fd_getlength() > is introduced to unify the code with raw_getl

Re: [Qemu-block] [PATCH v7 12/35] util: let qemu_fd_getlength support block device

2015-11-06 Thread Eduardo Habkost
On Mon, Nov 02, 2015 at 05:13:14PM +0800, Xiao Guangrong wrote: > lseek can not work for all block devices as the man page says: > | Some devices are incapable of seeking and POSIX does not specify > | which devices must support lseek(). > > This patch tries to add the support on Linux by using BL

Re: [Qemu-block] [PATCH v7 12/35] util: let qemu_fd_getlength support block device

2015-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2015 at 01:58:27PM +0800, Xiao Guangrong wrote: > > > On 11/06/2015 11:54 PM, Eduardo Habkost wrote: > >On Mon, Nov 02, 2015 at 05:13:14PM +0800, Xiao Guangrong wrote: > >>lseek can not work for all block devices as the man page says: > >>| Some

Re: [Qemu-block] [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-09 Thread Eduardo Habkost
On Mon, Nov 09, 2015 at 12:44:55PM +0800, Xiao Guangrong wrote: > On 11/06/2015 11:50 PM, Eduardo Habkost wrote: > >As this patch affects raw_getlength(), CCing the raw block driver > >maintainer and the qemu-block mailing list. > > Eduardo, thanks for your reminder. I will

[Qemu-block] [RFC] ide: Don't use qemu_hw_version() for firmware revision

2015-11-11 Thread Eduardo Habkost
The IDEState.version field is used for firmware version information returned to the guest. Updating firmware information on QEMU upgrade is supposed to be acceptable, so IDE doesn't need the version compatibility magic of qemu_hw_version() and can use QEMU_VERSION directly. Signed-off-by: Ed

Re: [Qemu-block] [Qemu-devel] [RFC] ide: Don't use qemu_hw_version() for firmware revision

2015-11-12 Thread Eduardo Habkost
On Thu, Nov 12, 2015 at 09:27:56AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > The IDEState.version field is used for firmware version > > information returned to the guest. Updating firmware information > > on QEMU upgrade is supposed to be accepta

Re: [Qemu-block] [Qemu-devel] [RFC] Require Python 3 for building QEMU

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 05:55:27PM +0100, Peter Maydell wrote: > On 15 October 2018 at 17:33, Markus Armbruster wrote: > > Kevin Wolf writes: > > > >> Am 15.10.2018 um 12:02 hat Peter Maydell geschrieben: > >> It's easier to port stuff to Python 3 though than making them work with > >> both. I th

Re: [Qemu-block] [Qemu-devel] [RFC] Require Python 3 for building QEMU

2018-10-15 Thread Eduardo Habkost
l P. Berrangé > >>> wrote: > >>>> On Sat, Oct 13, 2018 at 02:02:27AM -0300, Eduardo Habkost wrote: > >>>>> Signed-off-by: Eduardo Habkost > >>>>> --- > >>>>> I'd like to do this in QEMU 3.1. I think it&

Re: [Qemu-block] [PATCH 1/9] iotests: Make nbd-fault-injector flush

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 04:14:45PM +0200, Max Reitz wrote: > When closing a connection, make the nbd-fault-injector flush the socket. > Without this, the output is a bit unreliable with Python 3. > > Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost -- Eduardo

Re: [Qemu-block] [PATCH 2/9] iotests: Flush in iotests.py's QemuIoInteractive

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 04:14:46PM +0200, Max Reitz wrote: > After issuing a command, flush the pipe. This does not change anything > in Python 2, but it makes a difference in Python 3. > > Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost -- Eduardo

Re: [Qemu-block] [PATCH 4/9] iotests: Use // for Python integer division

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 04:14:48PM +0200, Max Reitz wrote: > In Python 3, / is always a floating-point division. We usually do not > want this, and as Python 2.7 understands // as well, change all integer > divisions to use that. > > Signed-off-by: Max Reitz Reviewed-by:

Re: [Qemu-block] [PATCH 3/9] iotests: Use Python byte strings where appropriate

2018-10-15 Thread Eduardo Habkost
would probably need to make self.passwords[] contain byte strings instead of text. In either case, using 'ascii' as the encoding everywhere will ensure the code will not try to be too smart about string encodings if that happens. I like that. Reviewed-by: Eduardo Habkost -- Eduardo

Re: [Qemu-block] [PATCH 5/9] iotests: Different iterator behavior in Python 3

2018-10-15 Thread Eduardo Habkost
changed to a single-line for with next() wrapped > around, which works both in 2.7 and 3. > > Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Minor comments below: > --- > tests/qemu-iotests/044 | 12 ++-- > tests/qemu-iotests/056 | 2 +- > tes

Re: [Qemu-block] [PATCH 8/9] iotests: Modify imports for Python 3

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 02:59:28PM -0400, Cleber Rosa wrote: > > > On 10/15/18 10:14 AM, Max Reitz wrote: > > There are two imports that need to be modified when running the iotests > > under Python 3: One is StringIO, which no longer exists; instead, the > > StringIO class comes from the io modu

Re: [Qemu-block] [PATCH 6/9] iotests: Explicitly inherit FDs in Python

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 04:14:50PM +0200, Max Reitz wrote: > Python 3.2 introduced the inheritable attribute for FDs. At the same > time, it changed the default so that all FDs are not inheritable by > default, that only inheritable FDs are inherited to subprocesses, and > only if close_fds is exp

Re: [Qemu-block] [PATCH 7/9] iotests: 'new' module replacement in 169

2018-10-15 Thread Eduardo Habkost
essary at first look, but I have just confirmed that this doesn't work: setattr(klass, 'test_' + name, mc) Probably because the methodcaller object won't automatically become a instance method after the TestCase class is instantiated. Reviewed-by: Eduardo Habkost

Re: [Qemu-block] [PATCH 8/9] iotests: Modify imports for Python 3

2018-10-15 Thread Eduardo Habkost
else: > +from StringIO import StringIO Considering that io.StringIO exists on Python 2.7, a comment explaining why exactly it doesn't work would be nice. But this shouldn't block this workaround, so: Reviewed-by: Eduardo Habkost > + > if debug: >

Re: [Qemu-block] [Qemu-devel] [PATCH 9/9] iotests: Unify log outputs between Python 2 and 3

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 04:14:53PM +0200, Max Reitz wrote: > When dumping an object into the log, there are differences between > Python 2 and 3. First, unicode strings are prefixed by 'u' in Python 2 > (they are no longer in 3, because unicode strings are the default > there). [...] This could

Re: [Qemu-block] [PATCH 7/9] iotests: 'new' module replacement in 169

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 07:38:45PM -0400, Cleber Rosa wrote: > > > On 10/15/18 10:14 AM, Max Reitz wrote: > > iotest 169 uses the 'new' module to add methods to a class. This module > > no longer exists in Python 3. Instead, we can use a lambda. Best of > > all, this works in 2.7 just as well.

Re: [Qemu-block] [PATCH 8/9] iotests: Modify imports for Python 3

2018-10-15 Thread Eduardo Habkost
On Mon, Oct 15, 2018 at 08:05:02PM -0400, Cleber Rosa wrote: > > > On 10/15/18 5:17 PM, Eduardo Habkost wrote: > > On Mon, Oct 15, 2018 at 04:14:52PM +0200, Max Reitz wrote: > >> There are two imports that need to be modified when running the iotests > >> under

Re: [Qemu-block] [Qemu-devel] [PATCH 7/9] iotests: 'new' module replacement in 169

2018-10-19 Thread Eduardo Habkost
On Fri, Oct 19, 2018 at 11:46:59AM +0200, Max Reitz wrote: [...] > I mean, my personal goal is not to touch this beyond what I need to > because it's black magic to me anyway, so I'm happy with what works. I agree with this approach, and your original patch looks good enough to me. -- Eduardo

Re: [Qemu-block] [PATCH v2 5/9] iotests: Different iterator behavior in Python 3

2018-10-19 Thread Eduardo Habkost
t in advance before you get the first element. It would be OK to rewrite the expression using an actual list comprehension: drive = [drive for drive in result if drive['device'] == 'drive0'][0] But the solution you chose is OK, too. Reviewed-by: Eduardo Habkost > &g

Re: [Qemu-block] [PATCH v2 4/9] iotests: Use // for Python integer division

2018-10-19 Thread Eduardo Habkost
On Fri, Oct 19, 2018 at 09:15:18PM +0200, Max Reitz wrote: > In Python 3, / is always a floating-point division. We usually do not > want this, and as Python 2.7 understands // as well, change all integer > divisions to use that. > > Signed-off-by: Max Reitz Reviewed-by:

Re: [Qemu-block] [PATCH v2 6/9] iotests: Explicitly inherit FDs in Python

2018-10-19 Thread Eduardo Habkost
ne: I was going to suggest keeping the existing function parameter, and using: isinstance(fd_file_path, int) But your solution makes callers more explicit. This seems to be a good thing. Reviewed-by: Eduardo Habkost > +os.set_inheritable(fd, True) > + > fd_

Re: [Qemu-block] [PATCH v2 8/9] iotests: Modify imports for Python 3

2018-10-19 Thread Eduardo Habkost
gt; +# qemu-iotest can reliably diff the results against master output. > +if sys.version_info.major >= 3: > +output = io.StringIO() > +else: > +# StringIO() is for unicode strings, which is not what Nit: I would change the comment to say "io.StringIO&

Re: [Qemu-block] [PATCH v3 0/9] iotests: Make them work for both Python 2 and 3

2018-10-26 Thread Eduardo Habkost
On Mon, Oct 22, 2018 at 02:52:58PM +0100, Max Reitz wrote: > This series prepares the iotests to work with both Python 2 and 3. In > some places, it adds version-specific code and decides what to do based > on the version (for instance, whether to import the StringIO or the > BytesIO class from 'i

Re: [Qemu-block] [Qemu-devel] [PATCH 09/10] scripts/qemu.py: use a more consistent docstring style

2018-10-26 Thread Eduardo Habkost
On Mon, Oct 08, 2018 at 03:44:14PM -0400, John Snow wrote: > > > On 10/04/2018 12:18 PM, Cleber Rosa wrote: > > Signed-off-by: Cleber Rosa > > --- > > dtc | 2 +- > > scripts/qemu.py | 65 +++-- > > 2 files changed, 42 insertions(+), 25 d

Re: [Qemu-block] [Qemu-devel] [PATCH 00/10] Trivial fixes and clean ups

2018-10-26 Thread Eduardo Habkost
On Thu, Oct 04, 2018 at 12:18:42PM -0400, Cleber Rosa wrote: > Just a collection of trivial fixes and clean ups that have been lying > around here for some time. I'm queueing patches 07-10 on python-next. I'm aware that Laurent already queued some of them (thanks!), but I want to avoid conflicts

[Qemu-block] [PULL 02/15] iotests: Make nbd-fault-injector flush

2018-10-30 Thread Eduardo Habkost
From: Max Reitz When closing a connection, make the nbd-fault-injector flush the socket. Without this, the output is a bit unreliable with Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Reviewed-by: Eric Blake Message-Id: <20181022135307.14398-2-

[Qemu-block] [PULL 00/15] Python queue, 2018-10-30

2018-10-30 Thread Eduardo Habkost
Sorry for submitting this at the last minute. The following changes since commit a2e002ff7913ce93aa0f7dbedd2123dce5f1a9cd: Merge remote-tracking branch 'remotes/vivier2/tags/qemu-trivial-for-3.1-pull-request' into staging (2018-10-30 15:49:55 +) are available in the Git repository at:

[Qemu-block] [PULL 01/15] scripts/device-crash-test: Remove devices that are not user_creatable anymore

2018-10-30 Thread Eduardo Habkost
homas Huth Message-Id: <1538729067-7944-1-git-send-email-th...@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/device-crash-test | 17 - 1 file changed, 17 deletions(-) diff --git a/scripts/device-crash-test b/scripts/device-crash-test index 930200b034..e93a7c0c84 1007

[Qemu-block] [PULL 09/15] iotests: Modify imports for Python 3

2018-10-30 Thread Eduardo Habkost
, which has just been renamed to configparser. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20181022135307.14398-9-mre...@redhat.com> Signed-off-by: Eduardo Habkost --- tests/qemu-iotests/iotests.py| 13 + tests/qemu-i

[Qemu-block] [PULL 03/15] iotests: Flush in iotests.py's QemuIoInteractive

2018-10-30 Thread Eduardo Habkost
From: Max Reitz After issuing a command, flush the pipe. This does not change anything in Python 2, but it makes a difference in Python 3. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20181022135307.14398-3-mre...@redhat.com> Signed-

[Qemu-block] [PULL 05/15] iotests: Use // for Python integer division

2018-10-30 Thread Eduardo Habkost
From: Max Reitz In Python 3, / is always a floating-point division. We usually do not want this, and as Python 2.7 understands // as well, change all integer divisions to use that. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id

[Qemu-block] [PULL 06/15] iotests: Different iterator behavior in Python 3

2018-10-30 Thread Eduardo Habkost
-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20181022135307.14398-6-mre...@redhat.com> Signed-off-by: Eduardo Habkost --- tests/qemu-iotests/044 | 16 ++-- tests/qemu-iotests/056 | 2 +- tests/qemu-iotests/065 | 4 ++-- tests/qemu-iotes

[Qemu-block] [PULL 11/15] Bootstrap Python venv for tests

2018-10-30 Thread Eduardo Habkost
: <20181018153134.8493-2-cr...@redhat.com> Signed-off-by: Eduardo Habkost --- tests/requirements.txt | 3 +++ tests/Makefile.include | 26 ++ 2 files changed, 29 insertions(+) create mode 100644 tests/requirements.txt diff --git a/tests/requirements.txt b

[Qemu-block] [PULL 14/15] scripts/decodetree.py: fix reference to attributes

2018-10-30 Thread Eduardo Habkost
From: Cleber Rosa Signed-off-by: Cleber Rosa Message-Id: <20181004161852.11673-9-cr...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost --- scripts/decodetree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/decodetree.py b/s

[Qemu-block] [PULL 07/15] iotests: Explicitly bequeath FDs in Python

2018-10-30 Thread Eduardo Habkost
close_fds to False when working with subprocesses that may want to inherit FDs, and by trying to set_inheritable() on FDs that we do want to bequeath to them. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20181022135307.14398-7-mre...@redhat.

[Qemu-block] [PULL 04/15] iotests: Use Python byte strings where appropriate

2018-10-30 Thread Eduardo Habkost
so that the default streams are opened in text mode (hence this parameter is aliased as "text" as of 3.7), or, if that is not possible, we have to decode the output to a normal string. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Message-Id: <20181022135307.14398-4-mre.

[Qemu-block] [PULL 15/15] scripts/qemu.py: use a more consistent docstring style

2018-10-30 Thread Eduardo Habkost
From: Cleber Rosa Signed-off-by: Cleber Rosa Message-Id: <20181004161852.11673-10-cr...@redhat.com> [ehabkost: reverted unintentional submodule update] Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 65 +++-- 1 file changed, 41 inse

[Qemu-block] [PULL 13/15] Travis support for the acceptance tests

2018-10-30 Thread Eduardo Habkost
: Stefan Hajnoczi Acked-by: Wainer dos Santos Moschetta Reviewed-by: Caio Carrara Message-Id: <20181018153134.8493-4-cr...@redhat.com> Signed-off-by: Eduardo Habkost --- .travis.yml | 8 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 95be6ec59f..aa49

[Qemu-block] [PULL 12/15] Acceptance tests: add make rule for running them

2018-10-30 Thread Eduardo Habkost
schetta Reviewed-by: Caio Carrara Message-Id: <20181018153134.8493-3-cr...@redhat.com> Signed-off-by: Eduardo Habkost --- docs/devel/testing.rst | 43 +- tests/requirements.txt | 1 + tests/Makefile.include | 21 +++-- 3 files ch

[Qemu-block] [PULL 08/15] iotests: 'new' module replacement in 169

2018-10-30 Thread Eduardo Habkost
From: Max Reitz iotest 169 uses the 'new' module to add methods to a class. This module no longer exists in Python 3. Instead, we can use a lambda. Best of all, this works in 2.7 just as well. Signed-off-by: Max Reitz Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa

[Qemu-block] [PULL 10/15] iotests: Unify log outputs between Python 2 and 3

2018-10-30 Thread Eduardo Habkost
lse" are now in lower case). The quote change necessitates a small change to a filter used in test 207. Suggested-by: Eduardo Habkost Signed-off-by: Max Reitz Reviewed-by: Cleber Rosa Message-Id: <20181022135307.14398-10-mre...@redhat.com> Signed-off-by: Eduardo Habkost --- tests/qemu

[Qemu-block] [PATCH] tests: Fix Python 3 detection on older GNU make versions

2018-11-06 Thread Eduardo Habkost
The $(SHELLSTATUS) variable requires GNU make >= 4.2, but Travis seems to provide an older version. Change the existing rules to use command output instead of exit code, to make it compatible with older GNU make versions. Signed-off-by: Eduardo Habkost --- I think that's the cause of th

Re: [Qemu-block] [PATCH] tests: Fix Python 3 detection on older GNU make versions

2018-11-07 Thread Eduardo Habkost
On Wed, Nov 07, 2018 at 07:05:03AM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > The $(SHELLSTATUS) variable requires GNU make >= 4.2, but Travis > > seems to provide an older version. Change the existing rules to > > use command output inste

Re: [Qemu-block] [PATCH] tests: Fix Python 3 detection on older GNU make versions

2018-11-07 Thread Eduardo Habkost
On Wed, Nov 07, 2018 at 01:45:35PM +, Peter Maydell wrote: > On 7 November 2018 at 12:49, Eduardo Habkost wrote: > > Now, why do we need --with-python, and why do we need to use > > $(PYTHON) when running tests? If somebody wants to use a > > different Python binary whe

Re: [Qemu-block] [Qemu-devel] [PATCH] tests: Fix Python 3 detection on older GNU make versions

2018-11-08 Thread Eduardo Habkost
On Thu, Nov 08, 2018 at 11:06:45AM -0500, Cleber Rosa wrote: > > > On 11/8/18 3:45 AM, Markus Armbruster wrote: > > Cleber Rosa writes: > > > >> On 11/7/18 1:05 AM, Markus Armbruster wrote: > >>> Eduardo Habkost writes: > >>> > >&

Re: [Qemu-block] [Qemu-devel] [PATCH] tests: Fix Python 3 detection on older GNU make versions

2018-11-08 Thread Eduardo Habkost
On Thu, Nov 08, 2018 at 12:36:37PM -0500, Cleber Rosa wrote: > > > On 11/8/18 11:51 AM, Eduardo Habkost wrote: > > > I'm not sure I agree with the "is an important thing to keep > > track of" part. I don't think we'll have any need to keep t

Re: [Qemu-block] [RFC PATCH 0/2] Acceptance tests for qemu-img

2018-11-13 Thread Eduardo Habkost
On Tue, Nov 13, 2018 at 01:18:36PM +0100, Kevin Wolf wrote: [...] > Anyway, one specific concern about the "simple way" I have is that we're > adding a hard dependency on an external package (Avocado) that isn't > usually installed anyway on developer machines. Maintainers will of > course just ins

Re: [Qemu-block] [RFC PATCH 0/2] Acceptance tests for qemu-img

2018-11-13 Thread Eduardo Habkost
On Tue, Nov 13, 2018 at 02:51:16PM +0100, Kevin Wolf wrote: > Am 13.11.2018 um 14:26 hat Eduardo Habkost geschrieben: > > On Tue, Nov 13, 2018 at 01:18:36PM +0100, Kevin Wolf wrote: > > [...] > > > Anyway, one specific concern about the "simple way" I have

Re: [Qemu-block] [RFC PATCH 0/2] Acceptance tests for qemu-img

2018-11-13 Thread Eduardo Habkost
On Tue, Nov 13, 2018 at 09:20:11AM -0500, Cleber Rosa wrote: > > > On 11/13/18 8:51 AM, Kevin Wolf wrote: > > Am 13.11.2018 um 14:26 hat Eduardo Habkost geschrieben: > >> On Tue, Nov 13, 2018 at 01:18:36PM +0100, Kevin Wolf wrote: > >> [...] > >>> A

Re: [Qemu-block] [RFC PATCH 0/2] Acceptance tests for qemu-img

2018-11-13 Thread Eduardo Habkost
On Tue, Nov 13, 2018 at 09:43:49AM -0500, Cleber Rosa wrote: > > On 11/13/18 9:32 AM, Eduardo Habkost wrote: > > On Tue, Nov 13, 2018 at 09:20:11AM -0500, Cleber Rosa wrote: > > > > With check-venv, we made "installing avocado" a small > > implementati

Re: [Qemu-block] [RFC PATCH] Introduce Python module structure

2018-11-27 Thread Eduardo Habkost
On Tue, Nov 27, 2018 at 05:00:07PM -0200, Caio Carrara wrote: > Hi, Cleber. > > On Tue, Nov 27, 2018 at 05:50:34AM -0500, Cleber Rosa wrote: > > This is a simple move of Python code that wraps common QEMU > > functionality, and are used by a number of different tests > > and scripts. > > > > By t

Re: [Qemu-block] [Qemu-devel] [PULL 12/15] Acceptance tests: add make rule for running them

2018-11-28 Thread Eduardo Habkost
On Wed, Nov 07, 2018 at 12:24:55AM +0100, Paolo Bonzini wrote: > On 31/10/2018 01:31, Eduardo Habkost wrote: > > From: Cleber Rosa > > > > The acceptance (aka functional, aka Avocado-based) tests are > > Python files located in "tests/acceptance" that need to

[Qemu-block] [PATCH 2/5] block: Don't try to set *errp directly

2017-06-08 Thread Eduardo Habkost
itz Cc: qemu-block@nongnu.org Signed-off-by: Eduardo Habkost --- block.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index fa1d06d846..1750a1838e 100644 --- a/block.c +++ b/block.c @@ -4263,11 +4263,9 @@ bool bdrv_op_is_blocked(BlockDriverState *bs,

[Qemu-block] [PATCH 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION

2015-09-22 Thread Eduardo Habkost
Guest visible data shouldn't change with a simple QEMU upgrade, so use qemu_hw_version() to ensure it won't change (as long as the machine class being used has hw_version set). Cc: Hannes Reinecke Cc: Paolo Bonzini Cc: qemu-block@nongnu.org Signed-off-by: Eduardo Habkost --- hw/scsi

Re: [Qemu-block] [PATCH 3/3] megasas: Use qemu_hw_version() instead of QEMU_VERSION

2015-09-22 Thread Eduardo Habkost
On Tue, Sep 22, 2015 at 10:33:32PM +0200, Laszlo Ersek wrote: > On 09/22/15 22:16, Eduardo Habkost wrote: > > Guest visible data shouldn't change with a simple QEMU upgrade, so use > > qemu_hw_version() to ensure it won't change (as long as the machine > > clas

[Qemu-block] [RFC 00/10] [TESTING NEEDED] python: futurize --stage1 (Python 3 compatibility)

2018-05-11 Thread Eduardo Habkost
-stage1 on all Python code in the tree. To make review and testing easier, I have run the fixers separately instead of doing all changes in a single patch. [1] http://python-future.org/automatic_conversion.html Eduardo Habkost (10): python: futurize -f libfuturize.fixes.fix_print_with_import

[Qemu-block] [RFC 03/10] python: futurize -f libfuturize.fixes.fix_next_call

2018-05-11 Thread Eduardo Habkost
Change obj.next() calls to next(obj). This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_next_call $py

[Qemu-block] [RFC 04/10] python: futurize -f lib2to3.fixes.fix_has_key

2018-05-11 Thread Eduardo Habkost
Change "dict.has_key(key)" to "key in dict" This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fix

[Qemu-block] [RFC 02/10] python: futurize -f libfuturize.fixes.fix_absolute_import

2018-05-11 Thread Eduardo Habkost
;;) | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_absolute_import $py Signed-off-by: Eduardo Habkost --- scripts/qmp/qemu-ga-client | 3 ++- scripts/qmp/qmp | 3 ++- scripts/qmp/qmp-shell| 3 ++- scripts/qmp/qom-fuse

[Qemu-block] [RFC 01/10] python: futurize -f libfuturize.fixes.fix_print_with_import

2018-05-11 Thread Eduardo Habkost
nt_with_import $py Signed-off-by: Eduardo Habkost --- scripts/analyse-9p-simpletrace.py| 89 scripts/analyse-locks-simpletrace.py | 1 + scripts/analyze-migration.py | 11 ++-- scripts/dump-guest-memory.py

[Qemu-block] [RFC 08/10] python: futurize -f lib2to3.fixes.fix_renames

2018-05-11 Thread Eduardo Habkost
Change sys.maxint to sys.maxsize. This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fixes.fix_renames $py Signed-off-b

[Qemu-block] [RFC 07/10] python: futurize -f lib2to3.fixes.fix_tuple_params

2018-05-11 Thread Eduardo Habkost
Remove implicit tuple parameter unpacking. This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fixes.fix_tuple_para

[Qemu-block] [RFC 09/10] python: futurize -f lib2to3.fixes.fix_except

2018-05-11 Thread Eduardo Habkost
Convert "except X, T" to "except X as T". This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fi

[Qemu-block] [RFC 05/10] python: futurize -f lib2to3.fixes.fix_standarderror

2018-05-11 Thread Eduardo Habkost
Rename StandardError to Exception. This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fixes.fix_standarderror $py

[Qemu-block] [RFC 06/10] python: futurize -f lib2to3.fixes.fix_reduce

2018-05-11 Thread Eduardo Habkost
Handle the move of reduce() to functools.reduce(). This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fixes.fix_redu

[Qemu-block] [RFC 10/10] python: futurize -f lib2to3.fixes.fix_numliterals

2018-05-11 Thread Eduardo Habkost
Convert octal literals into the new syntax. This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fixes.fix_numlitera

Re: [Qemu-block] storing machine data in qcow images?

2018-05-18 Thread Eduardo Habkost
On Fri, May 18, 2018 at 06:30:38PM +0300, Michael S. Tsirkin wrote: > Hi! > Right now, QEMU supports multiple machine types within > a given architecture. This was the case for many architectures > (like ARM) for a while, somewhat more recently this is the case > for x86 with I440FX and Q35 options

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-18 Thread Eduardo Habkost
On Fri, May 18, 2018 at 06:09:56PM +0100, Daniel P. Berrangé wrote: > On Fri, May 18, 2018 at 06:30:38PM +0300, Michael S. Tsirkin wrote: > > Hi! > > Right now, QEMU supports multiple machine types within > > a given architecture. This was the case for many architectures > > (like ARM) for a while,

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-21 Thread Eduardo Habkost
On Sat, May 19, 2018 at 08:05:06AM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > [...] > > About being more expressive than just a single list of key,value > > pairs, I don't see any evidence of that being necessary for the > > problems we're

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-21 Thread Eduardo Habkost
On Mon, May 21, 2018 at 07:44:40PM +0100, Daniel P. Berrangé wrote: > On Mon, May 21, 2018 at 03:29:28PM -0300, Eduardo Habkost wrote: > > On Sat, May 19, 2018 at 08:05:06AM +0200, Markus Armbruster wrote: > > > Eduardo Habkost writes: > > > > > > [...] >

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-21 Thread Eduardo Habkost
On Mon, May 21, 2018 at 09:18:17PM +0100, Daniel P. Berrangé wrote: > On Fri, May 18, 2018 at 02:41:33PM -0300, Eduardo Habkost wrote: > > On Fri, May 18, 2018 at 06:09:56PM +0100, Daniel P. Berrangé wrote: > > > On Fri, May 18, 2018 at 06:30:38PM +0300, Michael S. Tsirkin

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-22 Thread Eduardo Habkost
On Tue, May 22, 2018 at 09:35:55AM +0200, Gerd Hoffmann wrote: > Hi, > > > You must /sometimes/ supply the correct machine type. > > > > It is quite dependent on the guest OS you have installed, and even > > just how the guest OS is configured. In general Linux is very > > flexible and can ada

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-22 Thread Eduardo Habkost
On Tue, May 22, 2018 at 05:02:21PM +0200, Kevin Wolf wrote: > Am 22.05.2018 um 16:19 hat Michael S. Tsirkin geschrieben: > > On Tue, May 22, 2018 at 09:35:55AM +0200, Gerd Hoffmann wrote: > > > Hi, > > > > > > > You must /sometimes/ supply the correct machine type. > > > > > > > > It is quite d

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-23 Thread Eduardo Habkost
On Wed, May 23, 2018 at 01:19:46PM +0200, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Mon, May 21, 2018 at 07:44:40PM +0100, Daniel P. Berrangé wrote: > >> On Mon, May 21, 2018 at 03:29:28PM -0300, Eduardo Habkost wrote: > >> > On Sat, May 19,

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-29 Thread Eduardo Habkost
On Tue, May 29, 2018 at 12:14:28PM +0200, Kevin Wolf wrote: > Am 29.05.2018 um 11:23 hat Max Reitz geschrieben: > > On 2018-05-28 21:09, Kevin Wolf wrote: > > > Am 28.05.2018 um 20:44 hat Max Reitz geschrieben: > > >> On 2018-05-28 20:38, Kevin Wolf wrote: > > >>> Am 28.05.2018 um 20:30 hat Richard

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-05-29 Thread Eduardo Habkost
On Tue, May 29, 2018 at 03:03:16PM +0100, Dr. David Alan Gilbert wrote: > * Richard W.M. Jones (rjo...@redhat.com) wrote: > > On Fri, May 18, 2018 at 06:09:56PM +0100, Daniel P. Berrangé wrote: > > > The closest to a cross-hypervisor standard is OVF which can store > > > metadata about required har

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-05 Thread Eduardo Habkost
On Tue, Jun 05, 2018 at 10:21:59AM +0100, Dr. David Alan Gilbert wrote: > > > This seems to have fizzled out because of a lack of a concrete proposal; > so here is one based on a reply to Max's post: > > * Max Reitz (mre...@redhat.com) wrote: > > > > > The original problem was that you need t

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-06 Thread Eduardo Habkost
On Wed, Jun 06, 2018 at 10:44:20AM +0100, Dr. David Alan Gilbert wrote: > * Eduardo Habkost (ehabk...@redhat.com) wrote: > > On Tue, Jun 05, 2018 at 10:21:59AM +0100, Dr. David Alan Gilbert wrote: > > > > > > > > > This seems to have fizzled out because of a l

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-06 Thread Eduardo Habkost
On Wed, Jun 06, 2018 at 01:44:02PM +0200, Max Reitz wrote: > On 2018-06-06 13:37, Dr. David Alan Gilbert wrote: > > * Max Reitz (mre...@redhat.com) wrote: > >> On 2018-06-06 13:19, Michal Suchánek wrote: > >>> On Wed, 6 Jun 2018 13:02:53 +0200 > >>> Max Reitz wrote: > >>> > On 2018-06-06 12:3

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-06 Thread Eduardo Habkost
On Wed, Jun 06, 2018 at 02:50:10PM +0100, Daniel P. Berrangé wrote: > On Wed, Jun 06, 2018 at 03:45:10PM +0200, Michal Suchánek wrote: > > > > I think that *if* we want an 'appliance' format that stores a whole VM > > in a single file to ease VM distribution then the logical place to look > > in q

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-06 Thread Eduardo Habkost
On Wed, Jun 06, 2018 at 04:17:14PM +0200, Max Reitz wrote: > On 2018-06-06 15:45, Michal Suchánek wrote: > > On Wed, 6 Jun 2018 15:14:03 +0200 > > Max Reitz wrote: > > > >> On 2018-06-06 14:13, Michal Suchánek wrote: > >>> On Wed, 6 Jun 2018 13:52:35 +0200 > >>> Max Reitz wrote: > >>> >

Re: [Qemu-block] [Qemu-devel] storing machine data in qcow images?

2018-06-06 Thread Eduardo Habkost
On Wed, Jun 06, 2018 at 08:33:39PM +0200, Michal Suchánek wrote: [...] > Lastly we are missing a developer of a management layer committed to > support such appliances. This is important. Without developers of management tools willing to help specify the requirements and implement the feature, al

[Qemu-block] [PATCH v2 00/10] python: futurize --stage1 (Python 3 compatibility)

2018-06-08 Thread Eduardo Habkost
n code in the tree. To make review and testing easier, I have run the fixers separately instead of doing all changes in a single patch. [1] http://python-future.org/automatic_conversion.html Eduardo Habkost (10): python: futurize -f libfuturize.fixes.fix_print_with_import python: futu

[Qemu-block] [PATCH v2 06/10] python: futurize -f lib2to3.fixes.fix_reduce

2018-06-08 Thread Eduardo Habkost
educe $py Reviewed-by: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- tests/image-fuzzer/qcow2/fuzz.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/image-fuzzer/qcow2/fuzz.py b/tests/image-fuzzer/qcow2/fuzz.py index 20eba6bc1b..abc4f0635d 100644 --- a/tests/image-fuzzer/qcow2/fuzz.py

[Qemu-block] [PATCH v2 02/10] python: futurize -f libfuturize.fixes.fix_absolute_import

2018-06-08 Thread Eduardo Habkost
;;) | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_absolute_import $py Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Moved "from __future__ import" line after copyright header --- scripts/qmp/qemu-ga-client | 3 ++- scripts/qmp/qm

[Qemu-block] [PATCH v2 03/10] python: futurize -f libfuturize.fixes.fix_next_call

2018-06-08 Thread Eduardo Habkost
Reviewed-by: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- scripts/ordereddict.py| 4 ++-- scripts/vmstate-static-checker.py | 4 ++-- tests/image-fuzzer/runner.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/ordereddict.py b/scripts/o

[Qemu-block] [PATCH v2 01/10] python: futurize -f libfuturize.fixes.fix_print_with_import

2018-06-08 Thread Eduardo Habkost
t_with_import $py Reviewed-by: Stefan Hajnoczi Acked-by: Fam Zheng Signed-off-by: Eduardo Habkost --- scripts/analyse-9p-simpletrace.py| 89 scripts/analyse-locks-simpletrace.py | 1 + scripts/analyze-migration.py | 11 +-- scripts/dump-gu

[Qemu-block] [PATCH v2 05/10] python: futurize -f lib2to3.fixes.fix_standarderror

2018-06-08 Thread Eduardo Habkost
Reviewed-by: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- scripts/qmp/qemu-ga-client | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/qmp/qemu-ga-client b/scripts/qmp/qemu-ga-client index 6045fcd3f2..976e69e05f 100755 --- a/scripts/qmp/qemu-ga-client +++ b/script

[Qemu-block] [PATCH v2 10/10] python: futurize -f lib2to3.fixes.fix_numliterals

2018-06-08 Thread Eduardo Habkost
Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost --- scripts/qmp/qom-fuse | 6 +++--- tests/qemu-iotests/118 | 24 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/qmp/qom-fuse b/scripts

[Qemu-block] [PATCH v2 04/10] python: futurize -f lib2to3.fixes.fix_has_key

2018-06-08 Thread Eduardo Habkost
ixes.fix_has_key $py Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost --- scripts/qmp/qmp| 4 ++-- scripts/qmp/qmp-shell | 2 +- scripts/qmp/qom-fuse | 2 +- scripts/qmp/qom-get| 2 +- scripts/qmp/qom-list | 2 +- scripts/qmp/qom-s

[Qemu-block] [PATCH v2 07/10] python: futurize -f lib2to3.fixes.fix_tuple_params

2018-06-08 Thread Eduardo Habkost
Reviewed-by: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- scripts/analyse-locks-simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analyse-locks-simpletrace.py b/scripts/analyse-locks-simpletrace.py index 352bc9c22d..30090bdfff 100755 --- a/script

[Qemu-block] [PATCH v2 09/10] python: futurize -f lib2to3.fixes.fix_except

2018-06-08 Thread Eduardo Habkost
fixes.fix_except $py Reviewed-by: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- scripts/simpletrace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py index 2658b5cc7c..d4a50a1e2b 100755 --- a/scripts/simpletrace.py +++ b/scrip

[Qemu-block] [PATCH v2 08/10] python: futurize -f lib2to3.fixes.fix_renames

2018-06-08 Thread Eduardo Habkost
y: Stefan Hajnoczi Signed-off-by: Eduardo Habkost --- tests/image-fuzzer/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py index 45e8fca63f..95d84f38f3 100755 --- a/tests/image-fuzzer/runner.py +++ b/tests/im

[Qemu-block] [PATCH] fixup! python: futurize -f libfuturize.fixes.fix_print_with_import

2018-06-08 Thread Eduardo Habkost
On Fri, Jun 08, 2018 at 09:29:43AM -0300, Eduardo Habkost wrote: > Change all Python code to use print as a function. > > This is necessary for Python 3 compatibility. > > Done using: > > $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -pr

Re: [Qemu-block] [Qemu-devel] [PATCH] block/parallels.c: avoid integer overflow in allocate_clusters()

2017-03-31 Thread Eduardo Habkost
On Fri, Mar 31, 2017 at 10:27:44AM -0300, Philippe Mathieu-Daudé wrote: > Hi, > > Eduardo you seem skilled regarding Coccinelle scripts, is it possible to > write one to find those overflows? Probably not. AFAIK, Coccinelle rules are based on local code syntax only. This means it doesn't know the

  1   2   3   >