[PATCH 2/3] hw/ssi/ssi: Update coding style to make checkpatch.pl happy

2020-10-11 Thread Philippe Mathieu-Daudé
To make the next commit easier to review, clean this code first. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/ssi/ssi.h | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index fe3028c39dc..c15548425a3 100644

Re: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
On 10/11/20 10:28 PM, Stefan Berger wrote: On 10/11/20 3:32 PM, Philippe Mathieu-Daudé wrote: The TPM TIS device uses IRQ #5 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by:

[PATCH 3/3] hw/ssi: Rename SSI 'slave' as 'peripheral'

2020-10-11 Thread Philippe Mathieu-Daudé
In order to use inclusive terminology, rename SSI 'slave' as 'peripheral', following the specification resolution: https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/ Patch created mechanically using: $ sed -i s/SSISlave/SSIPeripheral/ $(git grep -l SSISlave) $ sed -i

[PATCH 1/3] hw/ssi/aspeed_smc: Rename max_slaves as max_devices

2020-10-11 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé In order to use inclusive terminology, rename max_slaves as max_peripherals. Patch generated using: $ sed -i s/slave/peripheral/ \ hw/ssi/aspeed_smc.c include/hw/ssi/aspeed_smc.h One line in aspeed_smc_read() has been manually tweaked to pass checkpatch.

[PATCH 0/3] hw/ssi: Rename SSI 'slave' as 'peripheral'

2020-10-11 Thread Philippe Mathieu-Daudé
In order to use inclusive terminology, rename SSI 'slave' as 'peripheral', following the resolution Paolo pointed in [*]: https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names/ Candidate to be merged via the ARM or Trivial trees. [*]

Re: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition

2020-10-11 Thread Stefan Berger
On 10/11/20 3:32 PM, Philippe Mathieu-Daudé wrote: The TPM TIS device uses IRQ #5 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h

[PATCH] hw/scsi/megasas: Remove pointless parenthesis

2020-10-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/megasas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index e24c12d7eed..d57402c9b09 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2384,8 +2384,8 @@ static void

[PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The IDE controller uses IRQ #14 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/ide/isa.c | 2 +- 2 files changed,

[PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The network devices use IRQ #9 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/net/ne2000-isa.c | 2 +- 2 files changed,

[PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The floppy disk controller uses IRQ #6 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/block/fdc.c | 4 ++--

[PATCH 06/10] hw/isa: Add the ISA_IRQ_PAR_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The parallel port uses IRQ #7 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/char/parallel.c | 2 +- hw/sparc64/sun4u.c

[PATCH 09/10] hw/isa: Add the ISA_IRQ_MOU_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The PS2 mouse uses IRQ #12 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/input/pckbd.c | 2 +- hw/sparc64/sun4u.c

[PATCH 07/10] hw/isa: Add the ISA_IRQ_RTC_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The RTC time keep clock ses IRQ #8 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + include/hw/rtc/mc146818rtc.h | 1 -

[PATCH 01/10] hw/isa: Introduce IsaIrqNumber enum

2020-10-11 Thread Philippe Mathieu-Daudé
We are going to list all default ISA IRQs. As all the definitions are related, introduce the IsaIrqNumber type to enumerate them. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/isa/isa.h

[PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The TPM TIS device uses IRQ #5 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/i386/acpi-build.c | 2 +-

[PATCH 03/10] hw/isa: Add the ISA_IRQ_SER_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The first serial port uses IRQ #4 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/sparc64/sun4u.c | 2 +- 2 files

[PATCH 02/10] hw/isa: Add the ISA_IRQ_KBD_DEFAULT definition

2020-10-11 Thread Philippe Mathieu-Daudé
The PS2 keyboard uses IRQ #1 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 + hw/sparc64/sun4u.c | 2 +- 2 files changed, 2

[PATCH 00/10] hw/isa: Introduce definitions for default IRQ values

2020-10-11 Thread Philippe Mathieu-Daudé
Replace various magic values by definitions to make the code easier to read. This probably makes sense to merge this series via the 'PC chipset' tree, rather than qemu-trivial@. Regards, Phil. Philippe Mathieu-Daudé (10): hw/isa: Introduce IsaIrqNumber enum hw/isa: Add the

Re: [PULL 00/30] Block patches

2020-10-11 Thread Peter Maydell
On Fri, 9 Oct 2020 at 20:35, Stefan Hajnoczi wrote: > > The following changes since commit 497d415d76b9f59fcae27f22df1ca2c3fa4df64e: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20201008-1' into staging (2020-10-08 > 21:41:20 +0100) > > are available in the Git

[PATCH v2 2/2] block: qcow2: remove the created file on initialization error

2020-10-11 Thread Maxim Levitsky
If the qcow initialization fails after we created the storage file, we should remove it to avoid leaving stale files around. We already do this for luks raw images. Signed-off-by: Maxim Levitsky --- block/qcow2.c | 12 1 file changed, 12 insertions(+) diff --git a/block/qcow2.c

[PATCH v2 0/2] qcow2: don't leave partially initialized file on image creation

2020-10-11 Thread Maxim Levitsky
Use the bdrv_co_delete_file interface to delete the underlying file if qcow2 initilization fails (e.g due to bad encryption secret) This gives the qcow2 the same treatment as to luks. V2: added a patch to fix a memory leak. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1845353 Maxim

[PATCH v2 1/2] crypto: luks: fix tiny memory leak

2020-10-11 Thread Maxim Levitsky
In the case when underlying block device doesn't support the bdrv_co_delete_file interface, an 'Error' wasn't freed. Signed-off-by: Maxim Levitsky --- block/crypto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/crypto.c b/block/crypto.c index 0807557763..9b61fd4aa8 100644 ---

Re: [PATCH] qcow2: cleanup created file when qcow2_co_create

2020-10-11 Thread Maxim Levitsky
On Tue, 2020-09-01 at 15:30 +0200, Alberto Garcia wrote: > On Thu 16 Jul 2020 01:33:59 PM CEST, Maxim Levitsky wrote: > > if (ret < 0) { > > + > > +Error *local_delete_err = NULL; > > +int r_del = bdrv_co_delete_file(bs, _delete_err); > > +/* > > + * ENOTSUP

[PATCH v4 7/7] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-10-11 Thread Markus Armbruster
From: Kevin Wolf The command line parser for --object parses the input twice: Once into QemuOpts just for detecting help options, and then again into a QDict using the keyval parser for actually creating the object. Now that the keyval parser can also detect help options, we can simplify this

[PATCH v4 6/7] qom: Add user_creatable_print_help_from_qdict()

2020-10-11 Thread Markus Armbruster
From: Kevin Wolf This adds a function that, given a QDict of non-help options, prints help for user creatable objects. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster --- include/qom/object_interfaces.h | 21 ++--- qom/object_interfaces.c

[PATCH v4 5/7] qom: Factor out helpers from user_creatable_print_help()

2020-10-11 Thread Markus Armbruster
From: Kevin Wolf This creates separate helper functions for printing a list of user creatable object types and for printing a list of properties of a given type. This will allow using these parts without having a QemuOpts. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Markus

[PATCH v4 4/7] keyval: Parse help options

2020-10-11 Thread Markus Armbruster
From: Kevin Wolf This adds a special meaning for 'help' and '?' as options to the keyval parser. Instead of being an error (because of a missing value) or a value for an implied key, they now request help, which is a new boolean output of the parser in addition to the QDict. A new parameter

[PATCH v4 3/7] keyval: Fix parsing of ',' in value of implied key

2020-10-11 Thread Markus Armbruster
The previous commit demonstrated documentation and code disagree on parsing of ',' in the value of an implied key. Fix the code to match the documentation. This breaks uses of keyval_parse() that pass an implied key and accept a value containing ','. None of the existing uses does: * audiodev:

[PATCH v4 0/7] qemu-storage-daemon: Remove QemuOpts from --object

2020-10-11 Thread Markus Armbruster
This replaces the QemuOpts-based help code for --object in the storage daemon with code based on the keyval parser. Review of v3 led me to preexisting issues. Instead of posting my fixes separately, then working with Kevin to rebase his work on top of mine, I did the rebase myself and am posting

[PATCH v4 1/7] keyval: Fix and clarify grammar

2020-10-11 Thread Markus Armbruster
The grammar has a few issues: * key-fragment = / [^=,.]* / Prose restricts key fragments: they "must be valid QAPI names or consist only of decimal digits". Technically, '' consists only of decimal digits. The code rejects that. Fix the grammar. * val = { / [^,]* / | ',,' }

[PATCH v4 2/7] test-keyval: Demonstrate misparse of ', ' with implied key

2020-10-11 Thread Markus Armbruster
Add a test for "val,,ue" with implied key. Documentation says this should parse as implied key with value "val", then fail. The code parses it as implied key with value "val,ue", then succeeds. The next commit will fix it. Signed-off-by: Markus Armbruster --- tests/test-keyval.c | 7 +++