Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-27 Thread Hannes Reinecke
oroutine_fn (*bdrv_co_zone_report)(BlockDriverState *bs, +int64_t offset, int64_t len, int64_t *nr_zones, +BlockZoneDescriptor *zones); +int coroutine_fn (*bdrv_co_zone_mgmt)(BlockDriverState *bs, enum zone_op op, +int64_t offset, int64_t len); + /* removable

Re: [RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information.

2022-06-27 Thread Hannes Reinecke
ile); +zone_size = get_sysfs_long_val(fd, file, "chunk_sectors"); zone_size_mask = zone_size - 1; if (offset & zone_size_mask) { error_report("offset is not the start of a zone"); Round of applause. Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Han

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-27 Thread Hannes Reinecke
uot;truncate", @@ -2498,6 +2614,11 @@ static void __attribute((constructor)) init_qemuio_commands(void) qemuio_add_command(&aio_write_cmd); qemuio_add_command(&aio_flush_cmd); qemuio_add_command(&flush_cmd); +qemuio_add_command(&zone_report_cmd); +qemuio_ad

Re: [RFC v3 4/5] file-posix: introduce get_sysfs_str_val for device zoned model.

2022-06-27 Thread Hannes Reinecke
ck-common.h @@ -56,8 +56,8 @@ typedef enum zone_op { } zone_op; typedef enum zone_model { -BLK_Z_HM, -BLK_Z_HA, +BLK_Z_HM = 0x1, +BLK_Z_HA = 0x2, } zone_model; typedef enum BlkZoneCondition { Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h.

Re: [RFC v3 5/5] qemu-iotests: add zone operation tests.

2022-06-27 Thread Hannes Reinecke
_IO $IMG -c "zone_close 0x3e7000 0x8" +echo "report after:" +sudo $QEMU_IO $IMG -c "zone_report 0x3e7000 0 2" + + +echo "reset the second zone" +sudo $QEMU_IO $IMG -c "zone_reset 0x8 0x8" +echo "After resetting

Re: [RFC v4 1/9] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-07-11 Thread Hannes Reinecke
ocMode prealloc; Error **errp; } truncate; +struct { +int64_t *nr_zones; Why is this a pointer? I'd rather use a number here, seeing that it's the number of zones in the *zones array ... But the remainder looks good. Cheers, Hannes -- Dr. Hannes Reine

Re: [RFC v4 2/9] qemu-io: add zoned block device operations.

2022-07-11 Thread Hannes Reinecke
} +return ret; +} + +static const cmdinfo_t zone_report_cmd = { +.name = "zone_report", +.altname = "zp", +.cfunc = zone_report_f, +.argmin = 2, +.argmax = 2, + .args = "offset number", + .oneline = "rep

Re: [RFC v4 3/9] file-posix: introduce get_sysfs_long_val for a block queue of sysfs attribute

2022-07-11 Thread Hannes Reinecke
), 11 deletions(-) Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo

Re: [RFC v4 4/9] file-posix: introduce get_sysfs_str_val for device zoned model.

2022-07-11 Thread Hannes Reinecke
/block/block-common.h +++ b/include/block/block-common.h @@ -56,8 +56,8 @@ typedef enum zone_op { } zone_op; typedef enum zone_model { -BLK_Z_HM, -BLK_Z_HA, +BLK_Z_HM = 0x1, +BLK_Z_HA = 0x2, } zone_model; typedef enum BlkZoneCondition { This hunk is unrelated, pleas

Re: [PATCH v11 1/7] include: add zoned device structs

2022-10-09 Thread Hannes Reinecke
On 10/10/22 04:21, Sam Li wrote: Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes

Re: [PATCH v11 4/7] raw-format: add zone operations to pass through requests

2022-10-09 Thread Hannes Reinecke
insertions(+) Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev

Re: [PATCH v11 5/7] config: add check to block layer

2022-10-09 Thread Hannes Reinecke
. + */ +bool supports_zoned_children; + /* * Drivers not implementing bdrv_parse_filename nor bdrv_open should have * this field set to true, except ones that are defined only by their The remainder looks good. Once you fixed the minor editing issues you can add: Reviewed

Re: [PATCH v11 7/7] docs/zoned-storage: add zoned device documentation

2022-10-09 Thread Hannes Reinecke
se ``--blockdev zoned_host_device, + node-name=drive0,filename=/dev/nullb0`` to pass through ``/dev/nullb0`` + as ``drive0``. + Windows ^^^ Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Sof

Re: [PATCH] hw/block/nvme: re-enable NVMe PCI hotplug

2022-10-11 Thread Hannes Reinecke
On 10/10/22 19:01, Daniel Wagner wrote: On Tue, May 11, 2021 at 06:12:47PM +0200, Hannes Reinecke wrote: On 5/11/21 6:03 PM, Klaus Jensen wrote: On May 11 16:54, Hannes Reinecke wrote: On 5/11/21 3:37 PM, Klaus Jensen wrote: On May 11 15:12, Hannes Reinecke wrote: On 5/11/21 2:22 PM, Klaus

Re: [Qemu-block] [PULL 37/47] megasas: change behaviour of msix switch

2016-11-11 Thread Hannes Reinecke
On 11/10/2016 05:14 PM, Michael S. Tsirkin wrote: > From: Cao jin > > Resolve the TODO, msix=auto means msix on; if user specify msix=on, > then device creation fail on msix_init failure. > Also undo the overwrites of user configuration of msix. > > CC: Michael S. Tsirkin

Re: [Qemu-block] [PULL 39/47] megasas: remove unnecessary megasas_use_msix()

2016-11-11 Thread Hannes Reinecke
On 11/10/2016 05:14 PM, Michael S. Tsirkin wrote: > From: Cao jin > > Also move certain hunk above, to place msix init related code together. > > CC: Hannes Reinecke > CC: Paolo Bonzini > CC: Markus Armbruster > CC: Marcel Apfelbaum > CC: Michael S. Tsirki

Re: [Qemu-block] [PULL 40/47] megasas: undo the overwrites of msi user configuration

2016-11-11 Thread Hannes Reinecke
On 11/10/2016 05:14 PM, Michael S. Tsirkin wrote: > From: Cao jin > > Commit afea4e14 seems forgetting to undo the overwrites, which is > unsuitable. > > CC: Hannes Reinecke > CC: Paolo Bonzini > CC: Markus Armbruster > CC: Marcel Apfelbaum > CC: Michael S. Tsi

Re: [Qemu-block] [PULL 36/47] pci: Convert msix_init() to Error and fix callers to check it

2016-11-11 Thread Hannes Reinecke
who won't fail because of > msix_init's failure, suppress the error report by passing NULL error object. > > Bonus: add comment for msix_init. > > CC: Jiri Pirko > CC: Gerd Hoffmann > CC: Dmitry Fleytman > CC: Jason Wang > CC: Michael S. Tsirkin > CC:

Re: [Qemu-block] [PATCH] megasas: Add write function to handle write access to PCI BAR 3

2015-07-27 Thread Hannes Reinecke
t val, unsigned size) > +{ > +return; > +} > + > static const MemoryRegionOps megasas_queue_ops = { > .read = megasas_queue_read, > +.write = megasas_queue_write, > .endianness = DEVICE_LITTLE_ENDIAN, > .impl = { > .min_access_size

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

2015-09-22 Thread Hannes Reinecke
On 09/22/2015 10:16 PM, 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 > class being used has hw_version set). > > Cc: Hannes Reinecke > Cc: Pao

Re: [Qemu-block] [PATCH v2 02/30] trace: Fix incorrect megasas trace parameters

2017-03-13 Thread Hannes Reinecke
; -trace_megasas_abort_invalid_context(cmd->index, abort_cmd->index, > -abort_cmd->context); > +trace_megasas_abort_invalid_context(cmd->index, abort_cmd->context, > + abort_cmd-&

Re: [Qemu-block] [PATCH v2 25/30] trace: Fix parameter types in hw/scsi

2017-03-13 Thread Hannes Reinecke
- > 3 files changed, 63 insertions(+), 61 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürn

Re: [Qemu-block] megasas: Unexpected response from lun 1 while scanning, scan aborted

2019-03-27 Thread Hannes Reinecke
. Please use a different SCSI target number, not a non-zero LUN number. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)

Re: [Qemu-block] [Qemu-devel] megasas: Unexpected response from lun 1 while scanning, scan aborted

2019-03-28 Thread Hannes Reinecke
On 3/28/19 1:47 AM, Dongli Zhang wrote: On 3/27/19 7:31 PM, Hannes Reinecke wrote: On 3/26/19 5:47 PM, Dongli Zhang wrote: I am reporting an error that the scsi lun cannot initialize successfully when I am emulating megasas scsi controller with qemu. I am not sure if this is issue in qemu

Re: [PATCH 5/6] hw/scsi/megasas: Silent GCC9 duplicated-cond warning

2020-01-07 Thread Hannes Reinecke
#x27;s being hardcoded in the drivers themselves (even though the interface provides mechanisms to query it). So we can remove the duplicate lines. But then I prefer to stick with the define, and avoid having to check the magic '128' value directly; rather use the define throughout the code. Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

Re: [PATCH 1/4] hw/nvme: remove NvmeCtrl parameter from ns setup/check functions

2021-07-07 Thread Hannes Reinecke
++--- 3 files changed, 20 insertions(+), 21 deletions(-) Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409

Re: [PATCH 2/4] hw/nvme: mark nvme-subsys non-hotpluggable

2021-07-07 Thread Hannes Reinecke
otpluggable = false; device_class_set_props(dc, nvme_subsystem_props); } Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB

Re: [PATCH 3/4] hw/nvme: unregister controller with subsystem at exit

2021-07-07 Thread Hannes Reinecke
(+) Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

Re: [PATCH 4/4] hw/nvme: fix controller hot unplugging

2021-07-07 Thread Hannes Reinecke
ish between 'shared' and 'non-shared' subsystems instead of the ->subsys pointer? That way all namespaces can be children of the subsystem, we won't need any reparenting, and the whole thing will be more in-line with qdev, no? Cheers, Hannes -- Dr. Hannes Reinecke

Re: [PATCH 4/4] hw/nvme: fix controller hot unplugging

2021-07-07 Thread Hannes Reinecke
On 7/7/21 11:53 AM, Klaus Jensen wrote: On Jul  7 09:49, Hannes Reinecke wrote: On 7/6/21 11:33 AM, Klaus Jensen wrote: From: Klaus Jensen Prior to this patch the nvme-ns devices are always children of the NvmeBus owned by the NvmeCtrl. This causes the namespaces to be unrealized when the

Re: [PATCH v2 4/4] hw/nvme: fix controller hot unplugging

2021-07-07 Thread Hannes Reinecke
NvmeSubsystem *subsys = NVME_SUBSYS(dev); +qbus_create_inplace(&subsys->bus, sizeof(NvmeBus), TYPE_NVME_BUS, dev, + dev->id); + nvme_subsys_setup(subsys); } Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect

Re: [PATCH 4/4] hw/nvme: fix controller hot unplugging

2021-07-07 Thread Hannes Reinecke
On 7/7/21 6:14 PM, Stefan Hajnoczi wrote: On Wed, Jul 07, 2021 at 12:43:56PM +0200, Hannes Reinecke wrote: On 7/7/21 11:53 AM, Klaus Jensen wrote: On Jul  7 09:49, Hannes Reinecke wrote: On 7/6/21 11:33 AM, Klaus Jensen wrote: From: Klaus Jensen Prior to this patch the nvme-ns devices are

Re: [PATCH v2 0/4] hw/nvme: fix controller hotplugging

2021-07-08 Thread Hannes Reinecke
h 4? Without it this whole exercise is a bit pointless, seeing that it doesn't fix anything. Shall we go with that patch as an interim solution? Will you replace it with your 'object' patch? What is the plan? Cheers, Hannes -- Dr. Hannes ReineckeKernel Storag

Re: [PATCH v2 0/4] hw/nvme: fix controller hotplugging

2021-07-09 Thread Hannes Reinecke
On 7/9/21 8:55 AM, Klaus Jensen wrote: On Jul  9 08:16, Hannes Reinecke wrote: On 7/9/21 8:05 AM, Klaus Jensen wrote: On Jul  7 17:49, Klaus Jensen wrote: From: Klaus Jensen Back in May, Hannes posted a fix[1] to re-enable NVMe PCI hotplug. We discussed a bit back and fourth and I mentioned

Re: [PULL for-6.1 06/11] hw/nvme: fix controller hot unplugging

2021-09-09 Thread Hannes Reinecke
that namespaces are kept alive and not unrealized. Reviewed-by: Hannes Reinecke Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h | 15 --- hw/nvme/ctrl.c | 14 ++ hw/nvme/ns.c | 18 ++ hw/nvme/subsys.c | 3 +++ 4 files changed, 35 insertions

[PATCH] hw/nvme: reattach subsystem namespaces on hotplug

2021-09-09 Thread Hannes Reinecke
bsystem to the controller. Fixes: 5ffbaeed16 ("hw/nvme: fix controller hot unplugging") Cc: Klaus Jensen Signed-off-by: Hannes Reinecke --- hw/nvme/subsys.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/nvme/subsys.c b/hw/nvme/subsys.c index 93c35950d

[PATCH] hw/nvme: reattach subsystem namespaces on hotplug

2021-09-09 Thread Hannes Reinecke
bsystem to the controller. Fixes: 5ffbaeed16 ("hw/nvme: fix controller hot unplugging") Cc: Klaus Jensen Signed-off-by: Hannes Reinecke --- hw/nvme/subsys.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/nvme/subsys.c b/hw/nvme/subsys.c index 93c35950d

Re: [PULL for-6.1 06/11] hw/nvme: fix controller hot unplugging

2021-09-09 Thread Hannes Reinecke
On 9/9/21 9:59 AM, Klaus Jensen wrote: > On Sep 9 09:02, Hannes Reinecke wrote: >> On 7/26/21 9:18 PM, Klaus Jensen wrote: >>> From: Klaus Jensen >>> >>> Prior to this patch the nvme-ns devices are always children of the >>> NvmeBus owned by t

[PATCH] hw/nvme: select first free NSID for legacy drive configuration

2021-09-09 Thread Hannes Reinecke
If a legacy 'drive' argument is passed to the controller we cannot assume that '1' will be a free NSID, as the subsys might already have attached a namespace to this NSID. So select the first free one. Signed-off-by: Hannes Reinecke --- hw/nvme/ctrl.c | 9 - 1 file c

Re: [PATCH] hw/nvme: reattach subsystem namespaces on hotplug

2021-09-09 Thread Hannes Reinecke
On 9/9/21 12:47 PM, Klaus Jensen wrote: > On Sep 9 11:43, Hannes Reinecke wrote: >> With commit 5ffbaeed16 ("hw/nvme: fix controller hot unplugging") >> namespaces get moved from the controller to the subsystem if one >> is specified. >> That keeps the na

Re: [PATCH] hw/nvme: select first free NSID for legacy drive configuration

2021-09-09 Thread Hannes Reinecke
On 9/9/21 12:52 PM, Klaus Jensen wrote: > On Sep 9 11:51, Hannes Reinecke wrote: >> If a legacy 'drive' argument is passed to the controller we cannot >> assume that '1' will be a free NSID, as the subsys might already >> have attached a namespace to t

Re: [PATCH] hw/nvme: reattach subsystem namespaces on hotplug

2021-09-23 Thread Hannes Reinecke
On 9/23/21 10:09 PM, Klaus Jensen wrote: On Sep 9 13:37, Hannes Reinecke wrote: On 9/9/21 12:47 PM, Klaus Jensen wrote: On Sep 9 11:43, Hannes Reinecke wrote: With commit 5ffbaeed16 ("hw/nvme: fix controller hot unplugging") namespaces get moved from the controller to the subsys

[PATCH] hw/block/nvme: re-enable NVMe PCI hotplug

2021-05-11 Thread Hannes Reinecke
call. Fixes: e570768566 ("hw/block/nvme: support for shared namespace in subsystem") Signed-off-by: Hannes Reinecke --- capstone | 2 +- hw/block/nvme-ns.c | 31 ++ hw/block/nvme-subsys.c | 12 + hw/block

Re: [PATCH] hw/block/nvme: re-enable NVMe PCI hotplug

2021-05-11 Thread Hannes Reinecke
On 5/11/21 2:22 PM, Klaus Jensen wrote: > On May 11 09:35, Hannes Reinecke wrote: >> Ever since commit e570768566 ("hw/block/nvme: support for shared >> namespace in subsystem") NVMe PCI hotplug is broken, as the PCI >> hotplug infrastructure will only work for the

Re: [PATCH] hw/block/nvme: re-enable NVMe PCI hotplug

2021-05-11 Thread Hannes Reinecke
On 5/11/21 3:37 PM, Klaus Jensen wrote: > On May 11 15:12, Hannes Reinecke wrote: >> On 5/11/21 2:22 PM, Klaus Jensen wrote: [ .. ] >>> The hotplug fix looks good - I'll post a series that tries to integrate >>> both. >>> >> Ta. >> >&g

Re: [PATCH] hw/block/nvme: re-enable NVMe PCI hotplug

2021-05-11 Thread Hannes Reinecke
On 5/11/21 6:03 PM, Klaus Jensen wrote: On May 11 16:54, Hannes Reinecke wrote: On 5/11/21 3:37 PM, Klaus Jensen wrote: On May 11 15:12, Hannes Reinecke wrote: On 5/11/21 2:22 PM, Klaus Jensen wrote: [ .. ] The hotplug fix looks good - I'll post a series that tries to integrate both.

Re: [PATCH v2] hw/scsi/megasas: Silent GCC duplicated-cond warning

2023-06-05 Thread Hannes Reinecke
if (s->fw_cmds > MEGASAS_MAX_FRAMES) {   s->fw_cmds = MEGASAS_MAX_FRAMES;   } Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes ReineckeKernel Storage Architect h...@suse.de +49 911 74053 688 SUSE Software Solutio

Re: NVME hotplug support ?

2024-01-23 Thread Hannes Reinecke
On 1/23/24 11:59, Damien Hedde wrote: Hi all, We are currently looking into hotplugging nvme devices and it is currently not possible: When nvme was introduced 2 years ago, the feature was disabled. commit cc6fb6bc506e6c47ed604fcb7b7413dff0b7d845 Author: Klaus Jensen Date: Tue Jul 6 10:48:40

Re: NVME hotplug support ?

2024-01-23 Thread Hannes Reinecke
On 1/24/24 07:52, Philippe Mathieu-Daudé wrote: Hi Hannes, [+Markus as QOM/QDev rubber duck] On 23/1/24 13:40, Hannes Reinecke wrote: On 1/23/24 11:59, Damien Hedde wrote: Hi all, We are currently looking into hotplugging nvme devices and it is currently not possible: When nvme was

Re: NVME hotplug support ?

2024-01-29 Thread Hannes Reinecke
On 1/29/24 14:13, Damien Hedde wrote: On 1/24/24 08:47, Hannes Reinecke wrote: On 1/24/24 07:52, Philippe Mathieu-Daudé wrote: Hi Hannes, [+Markus as QOM/QDev rubber duck] On 23/1/24 13:40, Hannes Reinecke wrote: On 1/23/24 11:59, Damien Hedde wrote: Hi all, We are currently looking