Re: [RFC] Virtualizing tagged disaggregated memory capacity (app specific, multi host shared)

2024-08-16 Thread Hannes Reinecke
ems are worth discussing, and I do agree that the uconf will probably not providing sufficient time for this. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect h...@suse.de+49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr

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

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-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: [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: [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: [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 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 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 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: [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: [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 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 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 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 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: [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

Re: [PATCH 2/3] scsi: make io_timeout configurable

2021-09-22 Thread Hannes Reinecke
On 9/22/21 5:47 PM, Philippe Mathieu-Daudé wrote: Hi Hannes, On 11/16/20 19:31, Hannes Reinecke wrote: The current code sets an infinite timeout on SG_IO requests, causing the guest to stall if the host experiences a frame loss. This patch adds an 'io_timeout' parameter for SCSIDevi

Re: [PATCH 2/3] scsi: make io_timeout configurable

2021-09-20 Thread Hannes Reinecke
On 9/20/21 8:56 PM, Paolo Bonzini wrote: On Mon, Nov 16, 2020 at 7:31 PM Hannes Reinecke wrote: The current code sets an infinite timeout on SG_IO requests, causing the guest to stall if the host experiences a frame loss. This patch adds an 'io_timeout' parameter for SCSIDevice t

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-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

[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: [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: 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
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

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: [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 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 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 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 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 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 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 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] 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] 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 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: [Bug 1925496] Re: nvme disk cannot be hotplugged after removal

2021-05-11 Thread Hannes Reinecke
it would be a bug if reusing the ID after getting >> that event failed. >> > > From the bug report, it does not look like anything like that is done. > > I basically dont understand the deletion protocol here and why the drive > is not released immediately. Even if I

[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 7/7] scsi: move host_status handling into SCSI drivers

2020-11-17 Thread Hannes Reinecke
On 11/17/20 8:38 AM, Paolo Bonzini wrote: On 17/11/20 07:55, Hannes Reinecke wrote: On 11/16/20 11:00 PM, Paolo Bonzini wrote: On 16/11/20 20:05, Hannes Reinecke wrote: +    if (sreq->host_status == SCSI_HOST_OK) { +    SCSISense sense; + +    sreq->

Re: [PATCH 5/7] scsi: Add mapping for generic SCSI_HOST status to sense codes

2020-11-16 Thread Hannes Reinecke
On 11/16/20 9:05 PM, Paolo Bonzini wrote: On 16/11/20 20:03, Hannes Reinecke wrote: +    case SCSI_HOST_TARGET_FAILURE: +    *sense = SENSE_CODE(TARGET_FAILURE); +    return CHECK_CONDITION; +    case SCSI_HOST_RESERVATION_ERROR: +    return

Re: [PATCH 7/7] scsi: move host_status handling into SCSI drivers

2020-11-16 Thread Hannes Reinecke
On 11/16/20 11:00 PM, Paolo Bonzini wrote: On 16/11/20 20:05, Hannes Reinecke wrote: +    if (sreq->host_status == SCSI_HOST_OK) { +    SCSISense sense; + +    sreq->status = scsi_sense_from_host_status(sreq->host_status, &sense); +    if (sreq->status ==

Re: [PATCH 7/7] scsi: move host_status handling into SCSI drivers

2020-11-16 Thread Hannes Reinecke
On 11/16/20 7:58 PM, Paolo Bonzini wrote: On 16/11/20 19:40, Hannes Reinecke wrote: +    if (sreq->host_status == SCSI_HOST_OK) { +    SCSISense sense; + +    sreq->status = scsi_sense_from_host_status(sreq->host_status, &sense); +    if (sreq->status ==

Re: [PATCH 5/7] scsi: Add mapping for generic SCSI_HOST status to sense codes

2020-11-16 Thread Hannes Reinecke
On 11/16/20 7:57 PM, Paolo Bonzini wrote: On 16/11/20 19:40, Hannes Reinecke wrote: +    case SCSI_HOST_TARGET_FAILURE: +    *sense = SENSE_CODE(TARGET_FAILURE); +    return CHECK_CONDITION; +    case SCSI_HOST_RESERVATION_ERROR: +    return RESERVATION_CONFLICT

[PATCH 5/7] scsi: Add mapping for generic SCSI_HOST status to sense codes

2020-11-16 Thread Hannes Reinecke
As we don't have a driver-specific mapping (yet) we should provide for a detailed mapping from host_status to SCSI sense codes. Signed-off-by: Hannes Reinecke --- scsi/utils.c | 60 +++- 1 file changed, 55 insertions(+), 5 dele

[PATCH 1/7] scsi-disk: Add sg_io callback to evaluate status

2020-11-16 Thread Hannes Reinecke
Add a separate sg_io callback to allow us to evaluate the various states returned by the SG_IO ioctl. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-disk.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi

[PATCH 0/3] scsi: infinite guest hangs with scsi-disk

2020-11-16 Thread Hannes Reinecke
e admin to specify a command timeout for SG_IO request. It is initialized to 30 seconds to avoid the infinite hang as mentioned above. As usual, comments and reviews are welcome. Hannes Reinecke (3): virtio-scsi: trace events scsi: make io_timeout configurable scsi: add tracing for SG_IO com

[PATCH 7/7] scsi: move host_status handling into SCSI drivers

2020-11-16 Thread Hannes Reinecke
Some SCSI drivers like virtio have an internal mapping for the host_status. This patch moves the host_status translation into the SCSI drivers to allow those drivers to set up the correct values. Signed-off-by: Hannes Reinecke --- hw/scsi/esp.c | 10 ++ hw/scsi/lsi53c895a.c

[PATCH 3/7] scsi-disk: convert more errno values back to SCSI statuses

2020-11-16 Thread Hannes Reinecke
From: Paolo Bonzini Linux has some OS-specific (and sometimes weird) mappings for various SCSI statuses and sense codes. The most important is probably RESERVATION CONFLICT. Add them so that they can be reported back to the guest kernel. Cc: Hannes Reinecke Signed-off-by: Paolo Bonzini

[PATCH 4/7] scsi: Rename linux-specific SG_ERR codes to generic SCSI_HOST error codes

2020-11-16 Thread Hannes Reinecke
status. And this internal state is not necessarily linux-specific, but rather can refer to the qemu implementation itself. So rename the linux-only SG_ERR codes to SCSI_HOST codes and make them available generally. Signed-off-by: Hannes Reinecke --- include/scsi/utils.h | 23

[PATCH 2/7] scsi: drop 'result' argument from command_complete callback

2020-11-16 Thread Hannes Reinecke
The command complete callback has a SCSIRequest as the first argument, and the status field of that structure is identical to the 'status' argument. So drop the argument from the callback. Signed-off-by: Hannes Reinecke --- hw/scsi/esp-pci.c | 5 ++--- hw/scsi/esp.c

[PATCH 6/7] scsi: split sg_io_sense_from_errno() in two functions

2020-11-16 Thread Hannes Reinecke
allows us to use the function scsi_sense_from_errno() in scsi-disk.c instead of the switch statement, allowing us to consolidate the errno handling. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-disk.c| 72 +++-- hw/scsi/scsi-generic.c | 19 +-- include/scsi/utils.h

[PATCH 0/7] scsi: scsi-disk corrupts data

2020-11-16 Thread Hannes Reinecke
, which then is able to take appropriate action. As usual, comments and reviews are welcome. Hannes Reinecke (6): scsi-disk: Add sg_io callback to evaluate status scsi: drop 'result' argument from command_complete callback scsi: Rename linux-specific SG_ERR codes to generic SCSI_HO

[PATCH 1/3] virtio-scsi: trace events

2020-11-16 Thread Hannes Reinecke
Add trace events for virtio command and response tracing. Signed-off-by: Hannes Reinecke --- hw/scsi/trace-events | 9 + hw/scsi/virtio-scsi.c | 30 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/hw/scsi/trace-events b/hw/scsi/trace

[PATCH 2/3] scsi: make io_timeout configurable

2020-11-16 Thread Hannes Reinecke
d infinite stalls. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-disk.c| 6 -- hw/scsi/scsi-generic.c | 17 +++-- include/hw/scsi/scsi.h | 4 +++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e859534eaf..2959526

[PATCH 3/3] scsi: add tracing for SG_IO commands

2020-11-16 Thread Hannes Reinecke
Add tracepoints for SG_IO commands to allow for debugging of SG_IO commands. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-disk.c| 3 ++- hw/scsi/scsi-generic.c | 8 +++- hw/scsi/trace-events | 4 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/scsi/scsi

Re: [PATCH] scsi-disk: convert more errno values back to SCSI statuses

2020-11-12 Thread Hannes Reinecke
On 11/12/20 10:52 AM, Paolo Bonzini wrote: Linux has some OS-specific (and sometimes weird) mappings for various SCSI statuses and sense codes. The most important is probably RESERVATION CONFLICT. Add them so that they can be reported back to the guest kernel. Cc: Hannes Reinecke Signed-off

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: [Qemu-devel] [RFC 0/3] VirtIO RDMA

2019-04-19 Thread Hannes Reinecke
o, how would we route the I/O from one guest to the other? Shared memory? Implementing a full-blown RDMA switch in qemu? Oh, and I would _love_ to have a discussion about this at KVM Forum. Maybe I'll manage to whip up guest-to-guest RDMA connection using ivshmem ... let's see. Che

Re: [Qemu-devel] [PATCH] megasas: fix mapped frame size

2019-04-04 Thread Hannes Reinecke
; Indeed. Reviewed-by: Hannes Reinecke Cheers, Hannes

Re: [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: [Qemu-devel] 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-devel] libiscsi task cancellation

2018-02-08 Thread Hannes Reinecke
A firmware implement the abort task with just a blacklist; the TMF will be returned immediately and the command response will be dropped if and when is arrives. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking h...@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)

[Qemu-devel] [PATCH 1/2] block: implement shared block device count

2017-12-14 Thread Hannes Reinecke
By setting 'locking=off' when creating a 'file' format drive one can simulate a multipath setup. This patch adds infrastructure for tracking shared block devices. Signed-off-by: Hannes Reinecke --- block.c | 36

[Qemu-devel] [PATCH 2/2] scsi: Implement multipath support

2017-12-14 Thread Hannes Reinecke
Implement simple multipath support based on the shared block device feature. Whenever a shared device is detected the scsi-disk driver will report a simple ALUA setup with all paths in active/optimized. Signed-off-by: Hannes Reinecke --- block.c | 15 +++ hw/scsi/scsi

[Qemu-devel] [PATCH 0/2] scsi: Simple ALUA support

2017-12-14 Thread Hannes Reinecke
Hi all, qemu allows for a simple multipath emulation by just using the same backing file for two distinct block devices. This patchset adds a very basic ALUA support to properly report this scenario go the guest. As usual, comments and reviews are welcome. Hannes Reinecke (2): block

[Qemu-devel] [PATCH 1/4] scsi: use 64-bit LUN

2017-12-14 Thread Hannes Reinecke
The LUN value really is a 64-bit number, so we should as well treat it as such. And we should be using accessor functions to provide backwards compability. Signed-off-by: Hannes Reinecke --- hw/scsi/esp.c | 6 ++- hw/scsi/lsi53c895a.c | 7 +-- hw/scsi/megasas.c | 24

[Qemu-devel] [PATCH 0/4] virtio-vfc implementation

2017-12-14 Thread Hannes Reinecke
est can setup the FC infrastructure in sysfs. This patchset has a complementary patchset for the linux virtio-scsi driver which will be posted to the linux-scsi mailing list. As usual, comments and reviews are welcome. Hannes Reinecke (4): scsi: use 64-bit LUN virtio-scsi: implement target rescan vi

[Qemu-devel] [PATCH 3/4] virtio-scsi: Implement 'native LUN' feature

2017-12-14 Thread Hannes Reinecke
ader. With that virtio doesn't have to mangle the LUN number, allowing us to pass the 'real' LUN number to the guest. Of course, we do cut off the last 8 bytes of the 'real' LUN number, but I'm not aware of any array utilizing that, so the impact should be negligible.

[Qemu-devel] [PATCH 4/4] scsi: support REPORT_LUNS for LUNs != 0

2017-12-14 Thread Hannes Reinecke
SPC doesn't restrict the use of REPORT LUNS to LUN 0, so we shouldn't be doing so, either. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 83497ac916..67ac472c14 10

[Qemu-devel] [PATCH 2/4] virtio-scsi: implement target rescan

2017-12-14 Thread Hannes Reinecke
ound. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 10 + hw/scsi/scsi-disk.c | 16 +++- hw/scsi/virtio-scsi.c| 55 include/hw/scsi/scsi.h | 6 ++- incl

[Qemu-devel] [PATCH] scsi-bus: correct responses for INQUIRY and REQUEST SENSE

2017-08-18 Thread Hannes Reinecke
According to SPC-3 INQUIRY and REQUEST SENSE should return GOOD even on unsupported LUNS. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index

Re: [Qemu-devel] [PATCHv2 3/4] scsi: clarify sense codes for LUN0 emulation

2017-08-17 Thread Hannes Reinecke
On 08/18/2017 02:57 AM, Laszlo Ersek wrote: > On 08/18/17 02:16, Laszlo Ersek wrote: >> On 08/17/17 22:57, Laszlo Ersek wrote: >>> On 08/04/17 12:49, Paolo Bonzini wrote: >>>> On 04/08/2017 10:36, Hannes Reinecke wrote: >>>>> The LUN0 emulation

Re: [Qemu-devel] [PATCHv2 4/4] scsi: Add 'enclosure' option for scsi devices

2017-08-04 Thread Hannes Reinecke
On 08/04/2017 12:48 PM, Paolo Bonzini wrote: > On 04/08/2017 10:36, Hannes Reinecke wrote: >> Make enclosure support optional with the 'enclosure' argument to >> the scsi device. >> Adding 'enclosure=on' as option to the SCSI device will present >> a

[Qemu-devel] [PATCHv2 4/4] scsi: Add 'enclosure' option for scsi devices

2017-08-04 Thread Hannes Reinecke
the inquiry data if LUN0 is assigned to a block devices. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 11 --- hw/scsi/scsi-disk.c| 4 +++- include/hw/scsi/scsi.h | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi

[Qemu-devel] [PATCHv2 3/4] scsi: clarify sense codes for LUN0 emulation

2017-08-04 Thread Hannes Reinecke
The LUN0 emulation is just that, an emulation for a non-existing LUN0. So we should be returning LUN_NOT_SUPPORTED for any request coming from any other LUN. And we should be aborting unhandled commands with INVALID OPCODE, not LUN NOT SUPPORTED. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi

[Qemu-devel] [PATCHv2 0/4] scsi: enclosure support

2017-08-04 Thread Hannes Reinecke
data if LUN0 is assigned to a device. Changes to v1: - Add patch to clarify sense code responses - Add 'enclosure' option for SCSI devices Hannes Reinecke (4): scsi: Make LUN 0 a simple enclosure scsi: use qemu_uuid to generate logical identifier for SES scsi: clarify sense c

[Qemu-devel] [PATCHv2 2/4] scsi: use qemu_uuid to generate logical identifier for SES

2017-08-04 Thread Hannes Reinecke
The SES enclosure descriptor requires a logical identifier, so generate one using the qemu_uuid and the Qumranet OUI. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 17 + 1 file changed, 17 insertions(+) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index

[Qemu-devel] [PATCHv2 1/4] scsi: Make LUN 0 a simple enclosure

2017-08-04 Thread Hannes Reinecke
Instead of having an 'invisible' LUN0 (in case LUN 0 is not connected) this patch maks LUN0 a enclosure service, exposing it to the OS. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 56 +- 1 file changed, 55 insertions(+),

Re: [Qemu-devel] [PATCH 0/2] scsi: enclosure support

2017-08-04 Thread Hannes Reinecke
On 08/04/2017 08:10 AM, Paolo Bonzini wrote: > >> On 08/03/2017 05:10 PM, Paolo Bonzini wrote: >>> On 03/08/2017 15:26, Hannes Reinecke wrote: >>>> Hi all, >>>> >>>> due to a customer issue I've added simple subenclosure support >&g

Re: [Qemu-devel] [PATCH 0/2] scsi: enclosure support

2017-08-03 Thread Hannes Reinecke
On 08/03/2017 05:10 PM, Paolo Bonzini wrote: > On 03/08/2017 15:26, Hannes Reinecke wrote: >> Hi all, >> >> due to a customer issue I've added simple subenclosure support >> to the SCSI emulation. The patch simply converts the current invisible >> LUN0 int

Re: [Qemu-devel] [PATCH 1/2] scsi: Make LUN 0 a simple enclosure

2017-08-03 Thread Hannes Reinecke
On 08/03/2017 03:32 PM, Daniel P. Berrange wrote: > On Thu, Aug 03, 2017 at 03:27:00PM +0200, Hannes Reinecke wrote: >> Instead of having an 'invisible' LUN0 (in case LUN 0 is not connected) >> this patch maks LUN0 a enclosure service, exposing it to the OS. >> &g

[Qemu-devel] [PATCH 0/2] scsi: enclosure support

2017-08-03 Thread Hannes Reinecke
Hi all, due to a customer issue I've added simple subenclosure support to the SCSI emulation. The patch simply converts the current invisible LUN0 into an enclosure device; existing setups using LUN0 as disks or CD-ROMs will not be affected. Hannes Reinecke (2): scsi: Make LUN 0 a s

[Qemu-devel] [PATCH 1/2] scsi: Make LUN 0 a simple enclosure

2017-08-03 Thread Hannes Reinecke
Instead of having an 'invisible' LUN0 (in case LUN 0 is not connected) this patch maks LUN0 a enclosure service, exposing it to the OS. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 56 +- 1 file changed, 55 insertions(+),

[Qemu-devel] [PATCH 2/2] scsi: use qemu_uuid to generate logical identifier for SES

2017-08-03 Thread Hannes Reinecke
The SES enclosure descriptor requires a logical identifier, so generate one using the qemu_uuid and the Qumranet OUI. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 17 + 1 file changed, 17 insertions(+) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index

Re: [Qemu-devel] 答复: Re: [RFC] virtio-fc: draft idea of virtual fibre channel HBA

2017-05-16 Thread Hannes Reinecke
On 05/16/2017 06:22 PM, Paolo Bonzini wrote: > Pruning to sort out the basic disagreements. > > On 16/05/2017 17:22, Hannes Reinecke wrote: >>> That depends on how you would like to do controller passthrough in >>> general. iSCSI doesn't have the 64-bit target

Re: [Qemu-devel] 答复: Re: [RFC] virtio-fc: draft idea of virtual fibre channel HBA

2017-05-16 Thread Hannes Reinecke
_first_, >> keeping in mind all of these options. >> (1), (3), and (4) all require an update anyway :-) >> >> The big advantage I see with (1) is that it can be added with just some >> code changes to qemu and virtio-scsi. Every other option require some >> vend

Re: [Qemu-devel] 答复: Re: [RFC] virtio-fc: draft idea of virtual fibre channel HBA

2017-05-15 Thread Hannes Reinecke
st, but it would be > worse for lock in. Or... they would like it best *because* it would be > worse for lock in. > > The main disadvantage of (2)/(3) against (1) is more complex testing. I > guess we can add a vhost-fc target for testing to LIO, so as not to > require an FC c

[Qemu-devel] [PATCH 4/4] virtio: implement VIRTIO_SCSI_F_TIMEOUT feature

2017-05-12 Thread Hannes Reinecke
Implement a handler for the VIRTIO_SCSI_F_TIMEOUT feature, which allows to pass in the assigned command timeout in seconds or minutes. This allows to specify a timeout up to 3 hours. Signed-off-by: Hannes Reinecke --- hw/scsi/virtio-scsi.c| 16 include

[Qemu-devel] [PATCH 3/4] scsi: per-request timeouts

2017-05-12 Thread Hannes Reinecke
Add a 'timeout' value per request to allow to specify individual per-request timeouts. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-bus.c | 1 + hw/scsi/scsi-disk.c| 15 +++ hw/scsi/scsi-generic.c | 12 include/hw/scsi/scsi.h | 1 + 4 files c

[Qemu-devel] [PATCH 2/4] scsi: use host default timeouts for SCSI commands

2017-05-12 Thread Hannes Reinecke
Instead of disabling command aborts by setting the command timeout to infinity we should be setting it to '0' per default, allowing the host to fall back to its default values. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-disk.c| 3 +-- hw/scsi/scsi-generic.c | 2 +- 2 files

[Qemu-devel] [PATCH 1/4] scsi: make default command timeout user-settable

2017-05-12 Thread Hannes Reinecke
something sensible. Signed-off-by: Hannes Reinecke --- hw/scsi/scsi-disk.c| 4 +++- hw/scsi/scsi-generic.c | 5 - include/hw/scsi/scsi.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index a53f058621..dd01ff7e06 100644 --- a/hw

[Qemu-devel] [RFC PATCH 0/4] Virtio command timeouts (qemu part)

2017-05-12 Thread Hannes Reinecke
returned to the guest. The guest itself doesn't need to (and, in fact, in most cases can't) abort any commands anymore, so it just need to reset the I/O timer until the requests are returned. However, as this is quite an elaborate construct I'd like to get some feedback for it. Han

Re: [Qemu-devel] [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-devel] [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-devel] 答复: Re: [RFC] virtio-fc: draft idea of virtual fibre channel HBA

2017-02-22 Thread Hannes Reinecke
On 02/22/2017 09:19 AM, Lin Ma wrote: > Hi Hannes, > >>>> Hannes Reinecke 2017/2/16 星期四 下午 5:56 >>> >>On 02/16/2017 09:39 AM, Paolo Bonzini wrote: >>> >>> >>> On 16/02/2017 08:16, Lin Ma wrote: >>>>> What are the benef

  1   2   3   4   5   >