Re: [RFC PATCH 00/17] hw/sd: Rework models for eMMC support

2022-04-21 Thread Cédric Le Goater
Hello, On 3/18/22 14:28, Cédric Le Goater wrote: Hello Philippe, I am restarting the discussion we started in : http://patchwork.ozlabs.org/project/qemu-devel/list/?series=250563 This series adds an extension for a new eMMC device using the framework you put in place. It's not perfect but

[PATCH 0/6] scsi: add support for FORMAT UNIT command and quirks

2022-04-21 Thread Mark Cave-Ayland
Here are the next set of patches from my ongoing work to allow the q800 machine to boot MacOS related to SCSI devices. The first patch implements a dummy FORMAT UNIT command which is used by the Apple HD SC Setup program when preparing an empty disk to install MacOS. Patches 2 adds a new quirks b

[PATCH 2/6] scsi-disk: add new quirks bitmap to SCSIDiskState

2022-04-21 Thread Mark Cave-Ayland
Since the MacOS SCSI implementation is quite old (and Apple added some firmware customisations to their drives for m68k Macs) there is need to add a mechanism to correctly handle Apple-specific quirks. Add a new quirks bitmap to SCSIDiskState that can be used to enable these features as required.

[PATCH 4/6] q800: implement compat_props to enable quirk_mode_page_apple for scsi-hd devices

2022-04-21 Thread Mark Cave-Ayland
By default quirk_mode_page_apple should be enabled for all scsi-hd devices connected to the q800 machine to enable MacOS to detect and use them. Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 099a

[PATCH 5/6] q800: add default vendor, product and version information for scsi-hd devices

2022-04-21 Thread Mark Cave-Ayland
The Apple HD SC Setup program uses a SCSI INQUIRY command to check that any SCSI hard disks detected match a whitelist of vendors and products before allowing the "Initialise" button to prepare an empty disk. Add known-good default vendor and product information using the existing compat_prop mech

[PATCH 1/6] scsi-disk: add FORMAT UNIT command

2022-04-21 Thread Mark Cave-Ayland
When initialising a drive ready to install MacOS, Apple HD SC Setup first attempts to format the drive. Add a simple FORMAT UNIT command which simply returns success to allow the format to succeed. Signed-off-by: Mark Cave-Ayland --- hw/scsi/scsi-disk.c | 4 hw/scsi/trace-events | 1 + 2

[PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh

2022-04-21 Thread Mark Cave-Ayland
One of the mechanisms MacOS uses to identify drives compatible with MacOS is to send a custom MODE SELECT command for page 0x30 to the drive. The response to this is a hard-coded manufacturer string which must match in order for the drive to be usable within MacOS. Add an implementation of the MOD

[PATCH 6/6] q800: add default vendor, product and version information for scsi-cd devices

2022-04-21 Thread Mark Cave-Ayland
The MacOS CDROM driver uses a SCSI INQUIRY command to check that any SCSI CDROMs detected match a whitelist of vendors and products before adding them to the list of available devices. Add known-good default vendor and product information using the existing compat_prop mechanism so the user doesn'

Re: [PATCH 2/2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-21 Thread Dmitry Tikhov
On Wed, Apr 20, 2022 at 21:16:15, Klaus Jensen wrote: > Discussed this with the TP authors and, no, reftag should not be > re-computed for PRACT 0, regardless of the PI type. Ok, should i resend patch with only adding nvme_dif_mangle_mdata in the read part?

Re: [PATCH 2/2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-21 Thread Klaus Jensen
On Apr 21 10:41, Dmitry Tikhov wrote: > On Wed, Apr 20, 2022 at 21:16:15, Klaus Jensen wrote: > > Discussed this with the TP authors and, no, reftag should not be > > re-computed for PRACT 0, regardless of the PI type. > Ok, should i resend patch with only adding nvme_dif_mangle_mdata in > the read

Re: [PATCH 02/26] qcow2: remove incorrect coroutine_fn annotations

2022-04-21 Thread Stefan Hajnoczi
On Tue, Apr 19, 2022 at 01:07:19PM -0500, Eric Blake wrote: > On Fri, Apr 15, 2022 at 03:18:36PM +0200, Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini > > --- > > Again, a sentence on why this is correct would be helpful. > > > block/qcow2-refcount.c | 4 ++-- > > block/qcow2.h

Re: [PATCH 01/26] block: remove incorrect coroutine_fn annotations

2022-04-21 Thread Stefan Hajnoczi
On Tue, Apr 19, 2022 at 12:57:54PM -0500, Eric Blake wrote: > On Fri, Apr 15, 2022 at 03:18:35PM +0200, Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini > > Might be nice to document in the commit message why the annotation was > incorrect, so someone stumbling across this commit in a bisect

[PATCH v2] hw/nvme: fix copy cmd for pi enabled namespaces

2022-04-21 Thread Dmitry Tikhov
Current implementation have problem in the read part of copy command. Because there is no metadata mangling before nvme_dif_check invocation, reftag error could be thrown for blocks of namespace that have not been previously written to. Signed-off-by: Dmitry Tikhov --- v2: * remove refactorin

Re: [PATCH 2/3] iotests: 314 test on duplicated clusters (parallels format)

2022-04-21 Thread Stefan Hajnoczi
On Mon, Apr 18, 2022 at 02:04:29PM +0300, Natalia Kuzmina wrote: > Reading from duplicated offset and from original offset returns > the same data. After repairing changing either of these > blocks of data does not affect another one. > > Signed-off-by: Natalia Kuzmina > --- > tests/qemu-iotests

Re: [PATCH 00/19] block: fix coroutine_fn annotations

2022-04-21 Thread Stefan Hajnoczi
On Fri, Apr 15, 2022 at 03:18:34PM +0200, Paolo Bonzini wrote: > This is the initial result of reviving Marc-André's series at > https://patchew.org/QEMU/20170704220346.29244-1-marcandre.lur...@redhat.com/. > A lot of the patches are similar to the ones that Marc-André wrote, > but due to the chang

Re: [PATCH 04/26] coroutine: remove incorrect coroutine_fn annotations

2022-04-21 Thread Stefan Hajnoczi
On Fri, Apr 15, 2022 at 03:18:38PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > include/qemu/coroutine.h | 2 +- > util/qemu-coroutine.c| 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) This one is easy to audit because the implementation of qemu_coroutine_get_

Re: [PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh

2022-04-21 Thread Fam Zheng
On 2022-04-21 07:51, Mark Cave-Ayland wrote: > One of the mechanisms MacOS uses to identify drives compatible with MacOS is > to > send a custom MODE SELECT command for page 0x30 to the drive. The response to > this is a hard-coded manufacturer string which must match in order for the > drive to b

[PULL 05/30] include: rename qemu-common.h qemu/help-texts.h

2022-04-21 Thread marcandre . lureau
From: Marc-André Lureau Suggested-by: Peter Maydell Signed-off-by: Marc-André Lureau Reviewed-by: Warner Losh Message-Id: <20220420132624.2439741-7-marcandre.lur...@redhat.com> --- include/{qemu-common.h => qemu/help-texts.h} | 0 bsd-user/main.c | 2 +- linux-use

[PULL 13/30] compiler.h: replace QEMU_NORETURN with G_NORETURN

2022-04-21 Thread marcandre . lureau
From: Marc-André Lureau G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in glib-compat. Note that this attribute must be placed before the function declaration (bringing a bit of consistency in qemu codebase usage). Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Be

[PULL 17/30] include: move qdict_{crumple,flatten} declarations

2022-04-21 Thread marcandre . lureau
From: Marc-André Lureau Move them where they belong, since the functions are implemented in block-qdict.c. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20220420132624.2439741-25-marcandre.lur...@redhat.com> --- include/block/qdict.h | 3 +++ include/qapi

[PULL 27/30] util: replace qemu_get_local_state_pathname()

2022-04-21 Thread marcandre . lureau
From: Marc-André Lureau Simplify the function to only return the directory path. Callers are adjusted to use the GLib function to build paths, g_build_filename(). Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20220420132624.2439741-39-marcandre.lur...@redhat.com

[PATCH] iotests/108: Fix when missing user_allow_other

2022-04-21 Thread Hanna Reitz
FUSE exports' allow-other option defaults to "auto", which means that it will try passing allow_other as a mount option, and fall back to not using it when an error occurs. We make no effort to hide fusermount's error message (because it would be difficult, and because users might want to know abo

Re: introducing vrc :)

2022-04-21 Thread Paolo Bonzini
On 4/20/22 20:12, Peter Xu wrote: a while ago I looked at tools that could be used too build a call graph. The simplest but most effective that I found was a small Perl program (called "egypt", which is rot13 for "rtlcg" aka RTL call graph) that used the GCC dumps to build the graph. Do you hav

[PULL 02/17] scripts/bench-block-job: switch to AQMP

2022-04-21 Thread John Snow
For this commit, we only need to remove accommodations for the synchronous QMP library. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Message-id: 20220321203315.909411-3-js...@redhat.com Signed-off-by: John Snow --- scripts

[PULL 07/17] python/qmp-shell: relicense as LGPLv2+

2022-04-21 Thread John Snow
qmp-shell is presently licensed as GPLv2 (only). I intend to include this tool as an add-on to an LGPLv2+ library package hosted on PyPI.org. I've selected LGPLv2+ to maximize compatibility with other licenses while retaining a copyleft license. To keep licensing matters simple, I'd like to relice

[PULL 00/17] Python patches

2022-04-21 Thread John Snow
The following changes since commit b1efff6bf031a93b5b8bf3912ddc720cc1653a61: Merge tag 'pull-ppc-20220420-2' of https://gitlab.com/danielhb/qemu into staging (2022-04-20 21:54:24 -0700) are available in the Git repository at: https://gitlab.com/jsnow/qemu.git tags/python-pull-request for y

[PULL 05/17] python/aqmp: add explicit GPLv2 license to legacy.py

2022-04-21 Thread John Snow
The legacy.py module is heavily based on the QMP module by Luiz Capitulino (et al) which is licensed as explicit GPLv2-only. The async QMP package is currently licensed similarly, but I intend to relicense the async package to the more flexible LGPLv2+. In preparation for that change, make the lic

[PULL 03/17] iotests/mirror-top-perms: switch to AQMP

2022-04-21 Thread John Snow
We don't have to maintain compatibility with both QMP libraries anymore, so we can just remove the old exception. While we're here, take advantage of the extra fields present in the VMLaunchFailure exception that machine.py now raises. (Note: I'm leaving the logging suppression here unchanged. I h

[PULL 09/17] python: temporarily silence pylint duplicate-code warnings

2022-04-21 Thread John Snow
The next several commits copy some code from qemu.qmp to qemu.aqmp, then delete qemu.qmp. In the interim, to prevent test failures, the duplicate code detection needs to be silenced to prevent bisect problems with CI testing. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Mes

[PULL 08/17] python/aqmp-tui: relicense as LGPLv2+

2022-04-21 Thread John Snow
aqmp-tui, the async QMP text user interface tool, is presently licensed as GPLv2+. I intend to include this tool as an add-on to an LGPLv2+ library package hosted on PyPI.org. I've selected LGPLv2+ to maximize compatibility with other licenses while retaining a copyleft license. To keep licensing

[PULL 10/17] python/aqmp: take QMPBadPortError and parse_address from qemu.qmp

2022-04-21 Thread John Snow
Shift these definitions over from the qmp package to the async qmp package. (Licensing: this is a lateral move, from GPLv2 (only) to GPLv2 (only)) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-3-js...@redhat.com

[PULL 13/17] python: remove the old QMP package

2022-04-21 Thread John Snow
Thank you for your service! Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-6-js...@redhat.com Signed-off-by: John Snow --- python/PACKAGE.rst | 4 +- python/README.rst | 2 +- python/qemu/q

[PULL 11/17] python/aqmp: fully separate from qmp.QEMUMonitorProtocol

2022-04-21 Thread John Snow
After this patch, qemu.aqmp.legacy.QEMUMonitorProtocol no longer inherits from qemu.qmp.QEMUMonitorProtocol. To do this, several inherited methods need to be explicitly re-defined. (Licensing: This is copying and modifying GPLv2-only code into a GPLv2-only file.) Signed-off-by: John Snow Reviewe

[PULL 17/17] python/qmp: remove pylint workaround from legacy.py

2022-04-21 Thread John Snow
Pylint upgraded recently (2.13.z) and having a pylint: disable comment in the middle of an argument field causes it some grief (It appears to stop parsing when it encounters it, causing some syntax problems). Since the duplicate line threshold was bumped up in 22305c2a081b, we don't need this worka

[PULL 01/17] python/machine: permanently switch to AQMP

2022-04-21 Thread John Snow
Remove the QEMU_PYTHON_LEGACY_QMP environment variable, making the switch from sync qmp to async qmp permanent. Update exceptions and import paths as necessary. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Message-id: 202203

[PULL 04/17] iotests: switch to AQMP

2022-04-21 Thread John Snow
iotests is already using async QMP, but to finalize the switchover we only need to update any remaining import paths to rely solely on the new library instead. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz Message-id: 2022032

[PULL 06/17] python/aqmp: relicense as LGPLv2+

2022-04-21 Thread John Snow
I am the sole author of all of the async QMP code (python/qemu/aqmp) with the following exceptions: python/qemu/aqmp/qmp_shell.py and python/qemu/aqmp/legacy.py were written by Luiz Capitulino (et al) and are already licensed separately as GPLv2 (only). aqmp_tui.py was written by Niteesh Babu G S

[PULL 12/17] python/aqmp: copy qmp docstrings to qemu.aqmp.legacy

2022-04-21 Thread John Snow
Copy the docstrings out of qemu.qmp, adjusting them as necessary to more accurately reflect the current state of this class. (Licensing: This is copying and modifying GPLv2-only licensed docstrings into a GPLv2-only file.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Revie

[PULL 14/17] python: re-enable pylint duplicate-code warnings

2022-04-21 Thread John Snow
With the old library gone, there's nothing duplicated in the tree, so the warning suppression can be removed. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Message-id: 20220330172812.3427355-7-js...@redhat.com Signed-off-by: John Snow --- python/

[PULL 16/17] python: rename 'aqmp-tui' to 'qmp-tui'

2022-04-21 Thread John Snow
This is the last vestige of the "aqmp" moniker surviving in the tree; remove it. Signed-off-by: John Snow Reviewed-by: Beraldo Leal Reviewed-by: Vladimir Sementsov-Ogievskiy Message-id: 20220330172812.3427355-9-js...@redhat.com Signed-off-by: John Snow --- python/qemu/qmp/{aqmp_tui.py => qmp_

[PULL 15/17] python: rename qemu.aqmp to qemu.qmp

2022-04-21 Thread John Snow
Now that we are fully switched over to the new QMP library, move it back over the old namespace. This is being done primarily so that we may upload this package simply as "qemu.qmp" without introducing confusion over whether or not "aqmp" is a new protocol or not. The trade-off is increased confus

Re: [PATCH] iotests/108: Fix when missing user_allow_other

2022-04-21 Thread Markus Armbruster
Hanna Reitz writes: > FUSE exports' allow-other option defaults to "auto", which means that it > will try passing allow_other as a mount option, and fall back to not > using it when an error occurs. We make no effort to hide fusermount's > error message (because it would be difficult, and becaus

Re: [PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh

2022-04-21 Thread Mark Cave-Ayland
On 21/04/2022 14:27, Fam Zheng wrote: On 2022-04-21 07:51, Mark Cave-Ayland wrote: One of the mechanisms MacOS uses to identify drives compatible with MacOS is to send a custom MODE SELECT command for page 0x30 to the drive. The response to this is a hard-coded manufacturer string which must ma

Re: introducing vrc :)

2022-04-21 Thread Peter Xu
On Thu, Apr 21, 2022 at 05:04:52PM +0200, Paolo Bonzini wrote: > On 4/20/22 20:12, Peter Xu wrote: > > > a while ago I looked at tools that could be used too build a call graph. > > > The simplest but most effective that I found was a small Perl program > > > (called "egypt", which is rot13 for "rt

[PATCH v2] Only advertise aio=io_uring if support is actually available

2022-04-21 Thread Dirk Müller
Change --help output for aio option to only list the aio backend options that are actually available. io_uring is an optional, linux only backend option so hide it for cases where it isn't there. Reviewed-by: Eric Blake Signed-off-by: Dirk Müller --- block/file-posix.c | 4 qemu-nbd.c

Re: [PATCH] Only advertise aio=io_uring if support is actually available

2022-04-21 Thread Dirk Müller
On Mittwoch, 20. April 2022 10:33:38 CEST Daniel P. Berrangé wrote: Hi Daniel, > That all said, the patch itself is OK, because for human targetted > interactive usage, it is desirable for --help to be representative > of what's available. > > IOW, I'm just complaining about the commit message j

Re: [PATCH v14 1/8] virtio: drop name parameter for virtio_init()

2022-04-21 Thread Dr. David Alan Gilbert
* Jonah Palmer (jonah.pal...@oracle.com) wrote: > This patch drops the name parameter for the virtio_init function. > > The pair between the numeric device ID and the string device ID > (name) of a virtio device already exists, but not in a way that > lets us map between them. > > This patch lets

Re: [PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh

2022-04-21 Thread Richard Henderson
On 4/21/22 08:29, Mark Cave-Ayland wrote: You need (1 << SCSI_DISK_QUIRK_MODE_PAGE_APPLE) instead. Doh, you're absolutely right. I believe the current recommendation is to use the BIT() macro in these cases. We probably need to fix BIT() to use 1ULL. At present it's using 1UL, to match the

Re: [PATCH v2] Only advertise aio=io_uring if support is actually available

2022-04-21 Thread Eric Blake
On Thu, Apr 21, 2022 at 06:50:48PM +0200, Dirk Müller wrote: > Change --help output for aio option to only list the aio backend options that > are actually available. io_uring is an optional, linux only backend > option so hide it for cases where it isn't there. As pointed out by Dan, this commit

Re: [PATCH 3/6] scsi-disk: add MODE_PAGE_APPLE quirk for Macintosh

2022-04-21 Thread BALATON Zoltan
On Thu, 21 Apr 2022, Richard Henderson wrote: On 4/21/22 08:29, Mark Cave-Ayland wrote: You need (1 << SCSI_DISK_QUIRK_MODE_PAGE_APPLE) instead. Doh, you're absolutely right. I believe the current recommendation is to use the BIT() macro in these cases. I think it's not a recommendation (as

Re: [PULL 00/17] Python patches

2022-04-21 Thread Richard Henderson
On 4/21/22 08:15, John Snow wrote: The following changes since commit b1efff6bf031a93b5b8bf3912ddc720cc1653a61: Merge tag 'pull-ppc-20220420-2' of https://gitlab.com/danielhb/qemu into staging (2022-04-20 21:54:24 -0700) are available in the Git repository at: https://gitlab.com/jsnow/q