[PATCH RESEND v2 9/9] block: check availablity for preadv/pwritev on mac

2020-10-18 Thread Joelle van Dyne
From: osy macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12

[PATCH RESEND v2 3/9] qemu: add support for iOS host

2020-10-18 Thread Joelle van Dyne
From: osy This introduces support for building for iOS hosts. When the correct Xcode toolchain is used, iOS host will be detected automatically. block: disable features not supported by iOS sandbox slirp: disable SMB features for iOS target: disable system() calls for iOS tcg: use

[PATCH RESEND v2 1/9] configure: option to disable host block devices

2020-10-18 Thread Joelle van Dyne
From: osy Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure | 4 meson.build| 1 + block/file-posix.c | 8 +++- 3 files changed, 12 insertions(+), 1

[PATCH v7 10/11] hw/block/nvme: Separate read and write handlers

2020-10-18 Thread Dmitry Fomichev
With ZNS support in place, the majority of code in nvme_rw() has become read- or write-specific. Move these parts to two separate handlers, nvme_read() and nvme_write() to make the code more readable and to remove multiple is_write checks that so far existed in the i/o path. This is a refactoring

[PATCH v7 11/11] hw/block/nvme: Merge nvme_write_zeroes() with nvme_write()

2020-10-18 Thread Dmitry Fomichev
nvme_write() now handles WRITE, WRITE ZEROES and ZONE_APPEND. Signed-off-by: Dmitry Fomichev --- hw/block/nvme.c | 95 +-- hw/block/trace-events | 1 - 2 files changed, 28 insertions(+), 68 deletions(-) diff --git a/hw/block/nvme.c

[PATCH v7 07/11] hw/block/nvme: Support Zone Descriptor Extensions

2020-10-18 Thread Dmitry Fomichev
Zone Descriptor Extension is a label that can be assigned to a zone. It can be set to an Empty zone and it stays assigned until the zone is reset. This commit adds a new optional module property, "zone_descr_ext_size". Its value must be a multiple of 64 bytes. If this value is non-zero, it

[PATCH v7 09/11] hw/block/nvme: Document zoned parameters in usage text

2020-10-18 Thread Dmitry Fomichev
Added brief descriptions of the new device properties that are now available to users to configure features of Zoned Namespace Command Set in the emulator. This patch is for documentation only, no functionality change. Signed-off-by: Dmitry Fomichev --- hw/block/nvme.c | 41

[PATCH v7 03/11] hw/block/nvme: Add support for Namespace Types

2020-10-18 Thread Dmitry Fomichev
From: Niklas Cassel Define the structures and constants required to implement Namespace Types support. Namespace Types introduce a new command set, "I/O Command Sets", that allows the host to retrieve the command sets associated with a namespace. Introduce support for the command set and enable

[PATCH v7 08/11] hw/block/nvme: Add injection of Offline/Read-Only zones

2020-10-18 Thread Dmitry Fomichev
ZNS specification defines two zone conditions for the zones that no longer can function properly, possibly because of flash wear or other internal fault. It is useful to be able to "inject" a small number of such zones for testing purposes. This commit defines two optional device properties,

[PATCH v7 06/11] hw/block/nvme: Introduce max active and open zone limits

2020-10-18 Thread Dmitry Fomichev
Add two module properties, "max_active" and "max_open" to control the maximum number of zones that can be active or open. Once these variables are set to non-default values, these limits are checked during I/O and Too Many Active or Too Many Open command status is returned if they are exceeded.

[PATCH v7 05/11] hw/block/nvme: Support Zoned Namespace Command Set

2020-10-18 Thread Dmitry Fomichev
The emulation code has been changed to advertise NVM Command Set when "zoned" device property is not set (default) and Zoned Namespace Command Set otherwise. Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053) in PCI NVMe controller emulator. Define

[PATCH v7 04/11] hw/block/nvme: Support allocated CNS command variants

2020-10-18 Thread Dmitry Fomichev
From: Niklas Cassel Many CNS commands have "allocated" command variants. These include a namespace as long as it is allocated, that is a namespace is included regardless if it is active (attached) or not. While these commands are optional (they are mandatory for controllers supporting the

[PATCH v7 00/11] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-10-18 Thread Dmitry Fomichev
v6 -> v7: - Introduce ns->iocs initialization function earlier in the series, in CSE Log patch. - Set NVM iocs for zoned namespaces when CC.CSS is set to NVME_CC_CSS_NVM. - Clean up code in CSE log handler. v5 -> v6: - Remove zoned state persistence code. Replace

[PATCH v7 01/11] hw/block/nvme: Add Commands Supported and Effects log

2020-10-18 Thread Dmitry Fomichev
This log page becomes necessary to implement to allow checking for Zone Append command support in Zoned Namespace Command Set. This commit adds the code to report this log page for NVM Command Set only. The parts that are specific to zoned operation will be added later in the series. All

[PATCH v7 02/11] hw/block/nvme: Generate namespace UUIDs

2020-10-18 Thread Dmitry Fomichev
In NVMe 1.4, a namespace must report an ID descriptor of UUID type if it doesn't support EUI64 or NGUID. Add a new namespace property, "uuid", that provides the user the option to either specify the UUID explicitly or have a UUID generated automatically every time a namespace is initialized.

RE: [PATCH v6 03/11] hw/block/nvme: Add support for Namespace Types

2020-10-18 Thread Dmitry Fomichev
> -Original Message- > From: Niklas Cassel > Sent: Wednesday, October 14, 2020 9:01 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Alistair Francis > ; Matias Bjorling ; > Damien Le Moal ;

RE: [PATCH v6 05/11] hw/block/nvme: Support Zoned Namespace Command Set

2020-10-18 Thread Dmitry Fomichev
> -Original Message- > From: Niklas Cassel > Sent: Wednesday, October 14, 2020 7:59 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Alistair Francis > ; Matias Bjorling ; > Damien Le Moal ;

RE: [PATCH v6 01/11] hw/block/nvme: Add Commands Supported and Effects log

2020-10-18 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Tuesday, October 13, 2020 8:51 PM > To: Dmitry Fomichev > Cc: Klaus Jensen ; Kevin Wolf > ; Philippe Mathieu-Daudé ; > Maxim Levitsky ; Fam Zheng ; > Alistair Francis ; Matias Bjorling > ; Niklas Cassel ; > Damien Le Moal ;

[PATCH v2 9/9] block: check availablity for preadv/pwritev on mac

2020-10-18 Thread Joelle van Dyne
From: osy macOS 11/iOS 14 added preadv/pwritev APIs. Due to weak linking, configure will succeed with CONFIG_PREADV even when targeting a lower OS version. We therefore need to check at run time if we can actually use these APIs. Signed-off-by: Joelle van Dyne --- block/file-posix.c | 12

[PATCH v2 3/9] qemu: add support for iOS host

2020-10-18 Thread Joelle van Dyne
From: osy This introduces support for building for iOS hosts. When the correct Xcode toolchain is used, iOS host will be detected automatically. block: disable features not supported by iOS sandbox slirp: disable SMB features for iOS target: disable system() calls for iOS tcg: use

[PATCH v2 1/9] configure: option to disable host block devices

2020-10-18 Thread Joelle van Dyne
From: osy Some hosts (iOS) have a sandboxed filesystem and do not provide low-level APIs for interfacing with host block devices. Signed-off-by: Joelle van Dyne --- configure | 4 meson.build| 1 + block/file-posix.c | 8 +++- 3 files changed, 12 insertions(+), 1

[PATCH] qemu-img: add support for rate limit in qemu-img convert

2020-10-18 Thread Zhengui li
From: Zhengui Currently, there is no rate limit for qemu-img convert. This may cause the task of qemu-img convert to consume all the bandwidth of the storage. This will affect the IO performance of other processes and virtual machines under shared storage. So we add support for offline rate

[PATCH] qemu-img: add support for rate limit in qemu-img commit

2020-10-18 Thread Zhengui li
From: Zhengui Currently, there is no rate limit for qemu-img commit. This may cause the task of qemu-img commit to consume all the bandwidth of the storage. This will affect the IO performance of other processes and virtual machines under shared storage. So we add support for offline rate limit