{"id":2232485,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2232485/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-ppc/patch/076717370213882c79eaebf790ddc4ee3892055c.1777890280.git.karolina.stolarek@oracle.com/","project":{"id":69,"url":"http://patchwork.ozlabs.org/api/1.1/projects/69/?format=json","name":"QEMU powerpc development","link_name":"qemu-ppc","list_id":"qemu-ppc.nongnu.org","list_email":"qemu-ppc@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<076717370213882c79eaebf790ddc4ee3892055c.1777890280.git.karolina.stolarek@oracle.com>","date":"2026-05-04T13:59:40","name":"[1/5] scsi: Split SCSIBusInfo struct","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"6002e18cb078941351873fe1d0e8e0da05c480b7","submitter":{"id":89913,"url":"http://patchwork.ozlabs.org/api/1.1/people/89913/?format=json","name":"Karolina Stolarek","email":"karolina.stolarek@oracle.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-ppc/patch/076717370213882c79eaebf790ddc4ee3892055c.1777890280.git.karolina.stolarek@oracle.com/mbox/","series":[{"id":502682,"url":"http://patchwork.ozlabs.org/api/1.1/series/502682/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-ppc/list/?series=502682","date":"2026-05-04T13:59:40","name":"[1/5] scsi: Split SCSIBusInfo struct","version":1,"mbox":"http://patchwork.ozlabs.org/series/502682/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2232485/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232485/checks/","tags":{},"headers":{"Return-Path":"<qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256\n header.s=corp-2025-04-25 header.b=RZBklUEb;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g8QS30slCz1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 01:24:49 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-ppc-bounces@nongnu.org>)\n\tid 1wJv9w-0005Y8-Vb; Mon, 04 May 2026 11:24:36 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <karolina.stolarek@oracle.com>)\n id 1wJtqI-0004x3-JX; Mon, 04 May 2026 10:00:17 -0400","from mx0a-00069f02.pphosted.com ([205.220.165.32])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <karolina.stolarek@oracle.com>)\n id 1wJtqF-0002Mn-80; Mon, 04 May 2026 10:00:14 -0400","from pps.filterd (m0246629.ppops.net [127.0.0.1])\n by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 6448faRd1404885; Mon, 4 May 2026 14:00:01 GMT","from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com\n (iadpaimrmta01.appoci.oracle.com [130.35.100.223])\n by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4dw9eptpxv-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Mon, 04 May 2026 14:00:01 +0000 (GMT)","from pps.filterd\n (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1])\n by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.7/8.18.1.7)\n with ESMTP id 644DuT9d014253; Mon, 4 May 2026 14:00:00 GMT","from pps.reinject (localhost [127.0.0.1])\n by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id\n 4dx5adk967-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Mon, 04 May 2026 13:59:59 +0000 (GMT)","from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com\n (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1])\n by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 644Dxvoe027094;\n Mon, 4 May 2026 13:59:59 GMT","from kstolare-e5-ol8.osdevelopmeniad.oraclevcn.com\n (kstolare-e5-ol8.allregionaliads.osdevelopmeniad.oraclevcn.com\n [100.100.254.20])\n by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id\n 4dx5adk954-2; Mon, 04 May 2026 13:59:59 +0000 (GMT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc\n :content-transfer-encoding:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=\n corp-2025-04-25; bh=WTXv6ggNw4k3/KEZXtYbRHF2tUimvN8yb9zVOXhfW0E=; b=\n RZBklUEb1ZzQfn4+LqesIAxUiWkSn1bCXVU3SFq6rvOdBMwWMLzMvh72OYbFb/xQ\n Ek92gB33+fXCeVx1olOTc+Kf507XjHZL9hvhyUWjJNFsdFFf2zwnlI5wDp/J1wN0\n csePVLrDIkVCzZ3mf6WARUvESytWN1R9Occ2wG5ZD32uKqHp78zgS4XbcjiwABLc\n sq1EjI37S5xTLHTXaL0Owrtnw3AMG25JU7wIY3KKL/PdhxfXssO3yPoHvMj6Vixg\n 1eumsKcSn4z3/eAK09wcSMEn/yspvMwmI50eRCdD/qMPctGZ9chTi4IdDtfsllPl\n Jf7RhmTfG2y6DPoKO3RsXQ==","From":"Karolina Stolarek <karolina.stolarek@oracle.com>","To":"qemu-devel@nongnu.org","Cc":"=?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>,\n \"Michael S . Tsirkin\" <mst@redhat.com>,\n \"Maciej S . Szmigiero\" <maciej.szmigiero@oracle.com>,\n Karolina Stolarek <karolina.stolarek@oracle.com>,\n Richard Henderson <richard.henderson@linaro.org>,\n Helge Deller <deller@gmx.de>, Nicholas Piggin <npiggin@gmail.com>,\n Harsh Prateek Bora <harshpb@linux.ibm.com>,\n Dmitry Fleytman <dmitry.fleytman@gmail.com>,\n Jeuk Kim <jeuk20.kim@samsung.com>, qemu-block@nongnu.org, qemu-ppc@nongnu.org","Subject":"[PATCH 1/5] scsi: Split SCSIBusInfo struct","Date":"Mon,  4 May 2026 13:59:40 +0000","Message-ID":"\n <076717370213882c79eaebf790ddc4ee3892055c.1777890280.git.karolina.stolarek@oracle.com>","X-Mailer":"git-send-email 2.47.1","In-Reply-To":"<cover.1777890280.git.karolina.stolarek@oracle.com>","References":"<cover.1777890280.git.karolina.stolarek@oracle.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-05-04_04,2026-04-30_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=notspam policy=default score=0 suspectscore=0\n adultscore=0 lowpriorityscore=0 spamscore=0\n mlxlogscore=999 mlxscore=0\n phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx\n scancount=1 engine=8.19.0-2604200000 definitions=main-2605040145","X-Proofpoint-ORIG-GUID":"p7U5-te_aj2er5mQjBAS48YQyWvCHGtE","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNTA0MDE0NSBTYWx0ZWRfXwjjhk3lT6VbU\n 9glICHhB52Nocyo1x3qcG0tlhPC54R4nOVOs3xeFzDwBzUnhr26zyS5KAQdcOpS6mDtXZ/qEERL\n ys9vbvBRkWA8PWe03MGS0vayPmU5PrNKfQLafoO74maZiYg3IpfIIER0v7ZmsC+oYAdC5toeK5C\n hfz6d2q684+Kwfv7e+tHuaIYGdncerG8gfwbLFWTCCEUOfUZe+gl1pto/S2lJwH2HiKvYYJBTXX\n dJucyfKd2NuYanmuAYgkxy+dBzhH3+ikLec91s6EVB8XjfNCxch8dpe5dCck3rMVbAdmsmpKrta\n eeCVOM8wEggX6Ro9F4vtX93B6L/fdj/gyKQnyvUcMNlJg+Hj0w2elFlcKVOpeR8JYL+Gva96f09\n oM6rDxzHk5wdAOMGMo+Y+7CtVftjbOzGnwrx0isZi2bHbOEUQ+5KfyUAfLgb66EaLoMKF5KFIv4\n M5WXw5LpqJmwhubsTrtZfOykEgt//NKULczL2VqM=","X-Authority-Analysis":"v=2.4 cv=YKKvDxGx c=1 sm=1 tr=0 ts=69f8a661 b=1 cx=c_pps\n a=zPCbziy225d3KhSqZt3L1A==:117\n a=zPCbziy225d3KhSqZt3L1A==:17\n a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=jiCTI4zE5U7BLdzWsZGv:22 a=EIcjfB9IiI4px24ztqRk:22 a=KKAkSRfTAAAA:8\n a=pGLkceISAAAA:8 a=VnNF1IyMAAAA:8 a=hD80L64hAAAA:8 a=69wJf7TsAAAA:8\n a=yPCof4ZbAAAA:8 a=SZ3BYSetAXTqLoVbm0IA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10\n a=cvBusfyB2V15izCimMoJ:22 a=Fg1AiH1G6rFz08G2ETeA:22 cc=ntf awl=host:12306","X-Proofpoint-GUID":"p7U5-te_aj2er5mQjBAS48YQyWvCHGtE","Received-SPF":"pass client-ip=205.220.165.32;\n envelope-from=karolina.stolarek@oracle.com; helo=mx0a-00069f02.pphosted.com","X-Spam_score_int":"-27","X-Spam_score":"-2.8","X-Spam_bar":"--","X-Spam_report":"(-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-Mailman-Approved-At":"Mon, 04 May 2026 11:24:34 -0400","X-BeenThere":"qemu-ppc@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<qemu-ppc.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-ppc>","List-Post":"<mailto:qemu-ppc@nongnu.org>","List-Help":"<mailto:qemu-ppc-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Extract information about the SCSI bus capabilities\ninto a dedicated struct SCSIBusConfig and keep bus\ncallbacks in the existing struct. Update\nscsi_bus_init(_named) and their calling sites to\nreflect that change.\n\nCc: Richard Henderson <richard.henderson@linaro.org>\nCc: Helge Deller <deller@gmx.de>\nCc: Nicholas Piggin <npiggin@gmail.com>\nCc: Harsh Prateek Bora <harshpb@linux.ibm.com>\nCc: Dmitry Fleytman <dmitry.fleytman@gmail.com>\nCc: Jeuk Kim <jeuk20.kim@samsung.com>\nCc: qemu-block@nongnu.org\nCc: qemu-ppc@nongnu.org\nSuggested-by: Alex Bennée <alex.bennee@linaro.org>\nSigned-off-by: Karolina Stolarek <karolina.stolarek@oracle.com>\n---\n hw/scsi/esp-pci.c            |  7 +++++--\n hw/scsi/esp.c                |  7 +++++--\n hw/scsi/lasi_ncr710.c        |  6 ++++--\n hw/scsi/lsi53c895a.c         |  6 ++++--\n hw/scsi/megasas.c            |  7 +++++--\n hw/scsi/mptsas.c             |  7 +++++--\n hw/scsi/ncr53c710.c          |  6 ++++--\n hw/scsi/scsi-bus.c           | 18 ++++++++++--------\n hw/scsi/scsi-disk.c          |  2 +-\n hw/scsi/spapr_vscsi.c        |  7 +++++--\n hw/scsi/virtio-scsi.c        |  7 +++++--\n hw/scsi/vmw_pvscsi.c         |  7 +++++--\n hw/ufs/lu.c                  |  8 +++++---\n hw/usb/dev-storage-bot.c     |  7 +++++--\n hw/usb/dev-storage-classic.c |  6 ++++--\n hw/usb/dev-uas.c             |  7 +++++--\n include/hw/scsi/scsi.h       | 18 +++++++++++++-----\n 17 files changed, 90 insertions(+), 43 deletions(-)","diff":"diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c\nindex b31ccdbecc..34a095b73f 100644\n--- a/hw/scsi/esp-pci.c\n+++ b/hw/scsi/esp-pci.c\n@@ -373,11 +373,13 @@ static const VMStateDescription vmstate_esp_pci_scsi = {\n     }\n };\n \n-static const struct SCSIBusInfo esp_pci_scsi_info = {\n+static const struct SCSIBusConfig esp_pci_scsi_config = {\n     .tcq = false,\n     .max_target = ESP_MAX_DEVS,\n     .max_lun = 7,\n+};\n \n+static const struct SCSIBusInfo esp_pci_scsi_info = {\n     .transfer_data = esp_transfer_data,\n     .complete = esp_command_complete,\n     .cancel = esp_request_cancelled,\n@@ -409,7 +411,8 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp)\n     pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &pci->io);\n     s->irq = qemu_allocate_irq(esp_irq_handler, pci, 0);\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), d, &esp_pci_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), d, &esp_pci_scsi_info,\n+                  &esp_pci_scsi_config);\n }\n \n static void esp_pci_scsi_exit(PCIDevice *d)\ndiff --git a/hw/scsi/esp.c b/hw/scsi/esp.c\nindex 933271431b..851af4d9fa 100644\n--- a/hw/scsi/esp.c\n+++ b/hw/scsi/esp.c\n@@ -1558,11 +1558,13 @@ static const MemoryRegionOps sysbus_esp_pdma_ops = {\n     .impl.max_access_size = 2,\n };\n \n-static const struct SCSIBusInfo esp_scsi_info = {\n+static const struct SCSIBusConfig esp_scsi_config = {\n     .tcq = false,\n     .max_target = ESP_MAX_DEVS,\n     .max_lun = 7,\n+};\n \n+static const struct SCSIBusInfo esp_scsi_info = {\n     .load_request = esp_load_request,\n     .transfer_data = esp_transfer_data,\n     .complete = esp_command_complete,\n@@ -1608,7 +1610,8 @@ static void sysbus_esp_realize(DeviceState *dev, Error **errp)\n \n     qdev_init_gpio_in(dev, sysbus_esp_gpio_demux, 2);\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), dev, &esp_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), dev, &esp_scsi_info,\n+                  &esp_scsi_config);\n }\n \n static void sysbus_esp_hard_reset(DeviceState *dev)\ndiff --git a/hw/scsi/lasi_ncr710.c b/hw/scsi/lasi_ncr710.c\nindex 4fde2265b5..7abc92b0bb 100644\n--- a/hw/scsi/lasi_ncr710.c\n+++ b/hw/scsi/lasi_ncr710.c\n@@ -135,11 +135,13 @@ static void lasi_ncr710_command_complete(SCSIRequest *req, size_t resid)\n     ncr710_transfer_data(req, len);\n }\n \n-static const struct SCSIBusInfo lasi_ncr710_scsi_info = {\n+static const struct SCSIBusConfig lasi_ncr710_scsi_config = {\n     .tcq = true,\n     .max_target = 8,\n     .max_lun = 8,  /* full LUN support */\n+};\n \n+static const struct SCSIBusInfo lasi_ncr710_scsi_info = {\n     .transfer_data = lasi_ncr710_transfer_data,\n     .complete = lasi_ncr710_command_complete,\n     .cancel = lasi_ncr710_request_cancelled,\n@@ -176,7 +178,7 @@ static void lasi_ncr710_realize(DeviceState *dev, Error **errp)\n     trace_lasi_ncr710_device_realize();\n \n     scsi_bus_init(&s->ncr710.bus, sizeof(s->ncr710.bus), dev,\n-                  &lasi_ncr710_scsi_info);\n+                  &lasi_ncr710_scsi_info, &lasi_ncr710_scsi_config);\n     s->ncr710.as = &address_space_memory;\n     s->ncr710.irq = s->lasi_irq;\n \ndiff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c\nindex 54123f7757..da04f51cab 100644\n--- a/hw/scsi/lsi53c895a.c\n+++ b/hw/scsi/lsi53c895a.c\n@@ -2327,11 +2327,13 @@ static const VMStateDescription vmstate_lsi_scsi = {\n     }\n };\n \n-static const struct SCSIBusInfo lsi_scsi_info = {\n+static const struct SCSIBusConfig lsi_scsi_config = {\n     .tcq = true,\n     .max_target = LSI_MAX_DEVS,\n     .max_lun = 0,  /* LUN support is buggy */\n+};\n \n+static const struct SCSIBusInfo lsi_scsi_info = {\n     .transfer_data = lsi_transfer_data,\n     .complete = lsi_command_complete,\n     .cancel = lsi_request_cancelled,\n@@ -2383,7 +2385,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)\n     pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->ram_io);\n     QTAILQ_INIT(&s->queue);\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), d, &lsi_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), d, &lsi_scsi_info, &lsi_scsi_config);\n }\n \n static void lsi_scsi_exit(PCIDevice *dev)\ndiff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c\nindex 9e712721f8..f0824069f2 100644\n--- a/hw/scsi/megasas.c\n+++ b/hw/scsi/megasas.c\n@@ -2327,11 +2327,13 @@ static void megasas_scsi_uninit(PCIDevice *d)\n     msi_uninit(d);\n }\n \n-static const struct SCSIBusInfo megasas_scsi_info = {\n+static const struct SCSIBusConfig megasas_scsi_config = {\n     .tcq = true,\n     .max_target = MFI_MAX_LD,\n     .max_lun = 255,\n+};\n \n+static const struct SCSIBusInfo megasas_scsi_info = {\n     .transfer_data = megasas_xfer_complete,\n     .get_sg_list = megasas_get_sg_list,\n     .complete = megasas_command_complete,\n@@ -2447,7 +2449,8 @@ static void megasas_scsi_realize(PCIDevice *dev, Error **errp)\n         s->frames[i].state = s;\n     }\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev), &megasas_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev),\n+                  &megasas_scsi_info, &megasas_scsi_config);\n }\n \n static const Property megasas_properties_gen1[] = {\ndiff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c\nindex e4a7b2fee4..251ad575e8 100644\n--- a/hw/scsi/mptsas.c\n+++ b/hw/scsi/mptsas.c\n@@ -1259,11 +1259,13 @@ static void *mptsas_load_request(QEMUFile *f, SCSIRequest *sreq)\n     return req;\n }\n \n-static const struct SCSIBusInfo mptsas_scsi_info = {\n+static const struct SCSIBusConfig mptsas_scsi_config = {\n     .tcq = true,\n     .max_target = MPTSAS_NUM_PORTS,\n     .max_lun = 1,\n+};\n \n+static const struct SCSIBusInfo mptsas_scsi_info = {\n     .get_sg_list = mptsas_get_sg_list,\n     .complete = mptsas_command_complete,\n     .cancel = mptsas_request_cancelled,\n@@ -1325,7 +1327,8 @@ static void mptsas_scsi_realize(PCIDevice *dev, Error **errp)\n     s->request_bh = qemu_bh_new_guarded(mptsas_fetch_requests, s,\n                                         &DEVICE(dev)->mem_reentrancy_guard);\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), &dev->qdev, &mptsas_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), &dev->qdev,\n+                  &mptsas_scsi_info, &mptsas_scsi_config);\n }\n \n static void mptsas_scsi_uninit(PCIDevice *dev)\ndiff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c\nindex 57967e7a84..ba92870d9a 100644\n--- a/hw/scsi/ncr53c710.c\n+++ b/hw/scsi/ncr53c710.c\n@@ -2265,11 +2265,13 @@ static void ncr710_device_reset(DeviceState *dev)\n     ncr710_soft_reset(s);\n }\n \n-static const struct SCSIBusInfo ncr710_scsi_info = {\n+static const struct SCSIBusConfig ncr710_scsi_config = {\n     .tcq = true,\n     .max_target = 8,\n     .max_lun = 8,  /* Full LUN support */\n+};\n \n+static const struct SCSIBusInfo ncr710_scsi_info = {\n     .transfer_data = ncr710_transfer_data,\n     .complete = ncr710_command_complete,\n     .cancel = ncr710_request_cancelled,\n@@ -2415,7 +2417,7 @@ static void sysbus_ncr710_realize(DeviceState *dev, Error **errp)\n \n     trace_ncr710_device_realize();\n     scsi_bus_init(&s->ncr710.bus, sizeof(s->ncr710.bus), dev,\n-                  &ncr710_scsi_info);\n+                  &ncr710_scsi_info, &ncr710_scsi_config);\n     s->ncr710.as = &address_space_memory;\n \n     ncr710_scsi_fifo_init(&s->ncr710.scsi_fifo);\ndiff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c\nindex 1a6b181b9d..b195007617 100644\n--- a/hw/scsi/scsi-bus.c\n+++ b/hw/scsi/scsi-bus.c\n@@ -265,11 +265,13 @@ void scsi_device_unit_attention_reported(SCSIDevice *s)\n \n /* Create a scsi bus, and attach devices to it.  */\n void scsi_bus_init_named(SCSIBus *bus, size_t bus_size, DeviceState *host,\n-                         const SCSIBusInfo *info, const char *bus_name)\n+                         const SCSIBusInfo *info, const SCSIBusConfig *config,\n+                         const char *bus_name)\n {\n     qbus_init(bus, bus_size, TYPE_SCSI_BUS, host, bus_name);\n     bus->busnr = next_scsi_bus++;\n     bus->info = info;\n+    bus->config = config;\n     qbus_set_bus_hotplug_handler(BUS(bus));\n }\n \n@@ -336,15 +338,15 @@ static bool scsi_bus_check_address(BusState *qbus, DeviceState *qdev, Error **er\n     SCSIDevice *dev = SCSI_DEVICE(qdev);\n     SCSIBus *bus = SCSI_BUS(qbus);\n \n-    if (dev->channel > bus->info->max_channel) {\n+    if (dev->channel > bus->config->max_channel) {\n         error_setg(errp, \"bad scsi channel id: %d\", dev->channel);\n         return false;\n     }\n-    if (dev->id != -1 && dev->id > bus->info->max_target) {\n+    if (dev->id != -1 && dev->id > bus->config->max_target) {\n         error_setg(errp, \"bad scsi device id: %d\", dev->id);\n         return false;\n     }\n-    if (dev->lun != -1 && dev->lun > bus->info->max_lun) {\n+    if (dev->lun != -1 && dev->lun > bus->config->max_lun) {\n         error_setg(errp, \"bad scsi device lun: %d\", dev->lun);\n         return false;\n     }\n@@ -374,7 +376,7 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)\n         }\n         do {\n             is_free = scsi_bus_is_address_free(bus, dev->channel, ++id, dev->lun, NULL);\n-        } while (!is_free && id < bus->info->max_target);\n+        } while (!is_free && id < bus->config->max_target);\n         if (!is_free) {\n             error_setg(errp, \"no free target\");\n             return;\n@@ -384,7 +386,7 @@ static void scsi_qdev_realize(DeviceState *qdev, Error **errp)\n         int lun = -1;\n         do {\n             is_free = scsi_bus_is_address_free(bus, dev->channel, dev->id, ++lun, NULL);\n-        } while (!is_free && lun < bus->info->max_lun);\n+        } while (!is_free && lun < bus->config->max_lun);\n         if (!is_free) {\n             error_setg(errp, \"no free lun\");\n             return;\n@@ -493,7 +495,7 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus)\n     };\n \n     loc_push_none(&loc);\n-    for (unit = 0; unit <= bus->info->max_target; unit++) {\n+    for (unit = 0; unit <= bus->config->max_target; unit++) {\n         dinfo = drive_get(IF_SCSI, bus->busnr, unit);\n         if (dinfo == NULL) {\n             continue;\n@@ -700,7 +702,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r)\n         r->buf[2] = 5; /* Version */\n         r->buf[3] = 2 | 0x10; /* HiSup, response data format */\n         r->buf[4] = r->len - 5; /* Additional Length = (Len - 1) - 4 */\n-        r->buf[7] = 0x10 | (r->req.bus->info->tcq ? 0x02 : 0); /* Sync, TCQ.  */\n+        r->buf[7] = 0x10 | (r->req.bus->config->tcq ? 0x02 : 0); /* Sync, TCQ.  */\n         memcpy(&r->buf[8], \"QEMU    \", 8);\n         memcpy(&r->buf[16], \"QEMU TARGET     \", 16);\n         pstrcpy((char *) &r->buf[32], 4, QEMU_HW_VERSION);\ndiff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c\nindex 5ba5b46c4f..8eb38b3816 100644\n--- a/hw/scsi/scsi-disk.c\n+++ b/hw/scsi/scsi-disk.c\n@@ -859,7 +859,7 @@ static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)\n     }\n \n     /* Sync data transfer and TCQ.  */\n-    outbuf[7] = 0x10 | (req->bus->info->tcq ? 0x02 : 0);\n+    outbuf[7] = 0x10 | (req->bus->config->tcq ? 0x02 : 0);\n     return buflen;\n }\n \ndiff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c\nindex b4c8f94d22..f04dbc16c6 100644\n--- a/hw/scsi/spapr_vscsi.c\n+++ b/hw/scsi/spapr_vscsi.c\n@@ -1195,12 +1195,14 @@ static int vscsi_do_crq(struct SpaprVioDevice *dev, uint8_t *crq_data)\n     return 0;\n }\n \n-static const struct SCSIBusInfo vscsi_scsi_info = {\n+static const struct SCSIBusConfig vscsi_scsi_config = {\n     .tcq = true,\n     .max_channel = 7, /* logical unit addressing format */\n     .max_target = 63,\n     .max_lun = 31,\n+};\n \n+static const struct SCSIBusInfo vscsi_scsi_info = {\n     .transfer_data = vscsi_transfer_data,\n     .complete = vscsi_command_complete,\n     .cancel = vscsi_request_cancelled,\n@@ -1225,7 +1227,8 @@ static void spapr_vscsi_realize(SpaprVioDevice *dev, Error **errp)\n \n     dev->crq.SendFunc = vscsi_do_crq;\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev), &vscsi_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev),\n+                  &vscsi_scsi_info, &vscsi_scsi_config);\n \n     /* ibmvscsi SCSI bus does not allow hotplug. */\n     qbus_set_hotplug_handler(BUS(&s->bus), NULL);\ndiff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c\nindex 6c73768011..f3062c08bf 100644\n--- a/hw/scsi/virtio-scsi.c\n+++ b/hw/scsi/virtio-scsi.c\n@@ -1264,12 +1264,14 @@ static void virtio_scsi_drained_end(SCSIBus *bus)\n     }\n }\n \n-static struct SCSIBusInfo virtio_scsi_scsi_info = {\n+static struct SCSIBusConfig virtio_scsi_scsi_config = {\n     .tcq = true,\n     .max_channel = VIRTIO_SCSI_MAX_CHANNEL,\n     .max_target = VIRTIO_SCSI_MAX_TARGET,\n     .max_lun = VIRTIO_SCSI_MAX_LUN,\n+};\n \n+static const struct SCSIBusInfo virtio_scsi_scsi_info = {\n     .complete = virtio_scsi_command_complete,\n     .fail = virtio_scsi_command_failed,\n     .cancel = virtio_scsi_request_cancelled,\n@@ -1342,7 +1344,8 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)\n     }\n \n     scsi_bus_init_named(&s->bus, sizeof(s->bus), dev,\n-                       &virtio_scsi_scsi_info, vdev->bus_name);\n+                        &virtio_scsi_scsi_info, &virtio_scsi_scsi_config,\n+                        vdev->bus_name);\n     /* override default SCSI bus hotplug-handler, with virtio-scsi's one */\n     qbus_set_hotplug_handler(BUS(&s->bus), OBJECT(dev));\n \ndiff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c\nindex 11ae6b9b74..e1310f20eb 100644\n--- a/hw/scsi/vmw_pvscsi.c\n+++ b/hw/scsi/vmw_pvscsi.c\n@@ -1126,12 +1126,14 @@ static const MemoryRegionOps pvscsi_ops = {\n         },\n };\n \n-static const struct SCSIBusInfo pvscsi_scsi_info = {\n+static const struct SCSIBusConfig pvscsi_scsi_config = {\n         .tcq = true,\n         .max_target = PVSCSI_MAX_DEVS,\n         .max_channel = 0,\n         .max_lun = 0,\n+};\n \n+static const struct SCSIBusInfo pvscsi_scsi_info = {\n         .get_sg_list = pvscsi_get_sg_list,\n         .complete = pvscsi_command_complete,\n         .cancel = pvscsi_request_cancelled,\n@@ -1171,7 +1173,8 @@ pvscsi_realizefn(PCIDevice *pci_dev, Error **errp)\n     s->completion_worker = qemu_bh_new_guarded(pvscsi_process_completion_queue, s,\n                                                &DEVICE(pci_dev)->mem_reentrancy_guard);\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(pci_dev), &pvscsi_scsi_info);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(pci_dev),\n+                  &pvscsi_scsi_info, &pvscsi_scsi_config);\n     /* override default SCSI bus hotplug-handler, with pvscsi's one */\n     qbus_set_hotplug_handler(BUS(&s->bus), OBJECT(s));\n     pvscsi_reset_state(s);\ndiff --git a/hw/ufs/lu.c b/hw/ufs/lu.c\nindex 3f3c9589ce..297b0d95f8 100644\n--- a/hw/ufs/lu.c\n+++ b/hw/ufs/lu.c\n@@ -79,13 +79,14 @@ static QEMUSGList *ufs_get_sg_list(SCSIRequest *scsi_req)\n     UfsRequest *req = scsi_req->hba_private;\n     return req->sg;\n }\n-\n-static const struct SCSIBusInfo ufs_scsi_info = {\n+static const struct SCSIBusConfig ufs_scsi_config = {\n     .tcq = true,\n     .max_target = 0,\n     .max_lun = UFS_MAX_LUS,\n     .max_channel = 0,\n+};\n \n+static const struct SCSIBusInfo ufs_scsi_info = {\n     .get_sg_list = ufs_get_sg_list,\n     .complete = ufs_scsi_command_complete,\n };\n@@ -344,7 +345,8 @@ static void ufs_init_scsi_device(UfsLu *lu, BlockBackend *blk, Error **errp)\n {\n     DeviceState *scsi_dev;\n \n-    scsi_bus_init(&lu->bus, sizeof(lu->bus), DEVICE(lu), &ufs_scsi_info);\n+    scsi_bus_init(&lu->bus, sizeof(lu->bus), DEVICE(lu),\n+                  &ufs_scsi_info, &ufs_scsi_config);\n \n     blk_ref(blk);\n     blk_detach_dev(blk, DEVICE(lu));\ndiff --git a/hw/usb/dev-storage-bot.c b/hw/usb/dev-storage-bot.c\nindex a7f8d80c17..91e6588e29 100644\n--- a/hw/usb/dev-storage-bot.c\n+++ b/hw/usb/dev-storage-bot.c\n@@ -13,11 +13,13 @@\n #include \"hw/usb/desc.h\"\n #include \"hw/usb/msd.h\"\n \n-static const struct SCSIBusInfo usb_msd_scsi_info_bot = {\n+static const struct SCSIBusConfig usb_msd_scsi_config_bot = {\n     .tcq = false,\n     .max_target = 0,\n     .max_lun = 15,\n+};\n \n+static const struct SCSIBusInfo usb_msd_scsi_info_bot = {\n     .transfer_data = usb_msd_transfer_data,\n     .complete = usb_msd_command_complete,\n     .cancel = usb_msd_request_cancelled,\n@@ -36,7 +38,8 @@ static void usb_msd_bot_realize(USBDevice *dev, Error **errp)\n         s->dev.auto_attach = 0;\n     }\n \n-    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev), &usb_msd_scsi_info_bot);\n+    scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev),\n+                  &usb_msd_scsi_info_bot, &usb_msd_scsi_config_bot);\n     usb_msd_handle_reset(dev);\n }\n \ndiff --git a/hw/usb/dev-storage-classic.c b/hw/usb/dev-storage-classic.c\nindex 977151c4a0..76e176dc20 100644\n--- a/hw/usb/dev-storage-classic.c\n+++ b/hw/usb/dev-storage-classic.c\n@@ -16,11 +16,13 @@\n #include \"system/system.h\"\n #include \"system/block-backend.h\"\n \n-static const struct SCSIBusInfo usb_msd_scsi_info_storage = {\n+static const struct SCSIBusConfig usb_msd_scsi_config_storage = {\n     .tcq = false,\n     .max_target = 0,\n     .max_lun = 0,\n+};\n \n+static const struct SCSIBusInfo usb_msd_scsi_info_storage = {\n     .transfer_data = usb_msd_transfer_data,\n     .complete = usb_msd_command_complete,\n     .cancel = usb_msd_request_cancelled,\n@@ -56,7 +58,7 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp)\n     usb_desc_init(dev);\n     dev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);\n     scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(dev),\n-                 &usb_msd_scsi_info_storage);\n+                  &usb_msd_scsi_info_storage, &usb_msd_scsi_config_storage);\n     scsi_dev = scsi_bus_legacy_add_drive(&s->bus, blk, 0, !!s->removable,\n                                          &s->conf, dev->serial, errp);\n     blk_unref(blk);\ndiff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c\nindex 8576dfec96..de26114f10 100644\n--- a/hw/usb/dev-uas.c\n+++ b/hw/usb/dev-uas.c\n@@ -618,11 +618,13 @@ static void usb_uas_scsi_request_cancelled(SCSIRequest *r)\n     scsi_req_unref(req->req);\n }\n \n-static const struct SCSIBusInfo usb_uas_scsi_info = {\n+static const struct SCSIBusConfig usb_uas_scsi_config = {\n     .tcq = true,\n     .max_target = 0,\n     .max_lun = 255,\n+};\n \n+static const struct SCSIBusInfo usb_uas_scsi_info = {\n     .transfer_data = usb_uas_scsi_transfer_data,\n     .complete = usb_uas_scsi_command_complete,\n     .cancel = usb_uas_scsi_request_cancelled,\n@@ -939,7 +941,8 @@ static void usb_uas_realize(USBDevice *dev, Error **errp)\n                                          &d->mem_reentrancy_guard);\n \n     dev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE);\n-    scsi_bus_init(&uas->bus, sizeof(uas->bus), DEVICE(dev), &usb_uas_scsi_info);\n+    scsi_bus_init(&uas->bus, sizeof(uas->bus), DEVICE(dev),\n+                  &usb_uas_scsi_info, &usb_uas_scsi_config);\n }\n \n static const VMStateDescription vmstate_usb_uas = {\ndiff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h\nindex a3e246dbd9..53475effb8 100644\n--- a/include/hw/scsi/scsi.h\n+++ b/include/hw/scsi/scsi.h\n@@ -14,6 +14,7 @@\n #define TYPE_SCSI_BUS \"SCSI\"\n OBJECT_DECLARE_SIMPLE_TYPE(SCSIBus, SCSI_BUS)\n \n+typedef struct SCSIBusConfig SCSIBusConfig;\n typedef struct SCSIBusInfo SCSIBusInfo;\n typedef struct SCSIDevice SCSIDevice;\n typedef struct SCSIRequest SCSIRequest;\n@@ -137,9 +138,12 @@ struct SCSIReqOps {\n     void (*load_request)(QEMUFile *f, SCSIRequest *req);\n };\n \n-struct SCSIBusInfo {\n+struct SCSIBusConfig {\n     int tcq;\n     int max_channel, max_target, max_lun;\n+};\n+\n+struct SCSIBusInfo {\n     int (*parse_cdb)(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf,\n                      size_t buf_len, void *hba_private);\n     void (*transfer_data)(SCSIRequest *req, uint32_t arg);\n@@ -170,6 +174,7 @@ struct SCSIBus {\n \n     SCSISense unit_attention;\n     const SCSIBusInfo *info;\n+    const SCSIBusConfig *config;\n \n     int drain_count; /* protected by BQL */\n };\n@@ -179,7 +184,8 @@ struct SCSIBus {\n  * @bus: SCSIBus object to initialize\n  * @bus_size: size of @bus object\n  * @host: Device which owns the bus (generally the SCSI controller)\n- * @info: structure defining callbacks etc for the controller\n+ * @info: structure defining callbacks for the controller\n+ * @config: structure defining bus params\n  * @bus_name: Name to use for this bus\n  *\n  * This in-place initializes @bus as a new SCSI bus with a name\n@@ -189,7 +195,8 @@ struct SCSIBus {\n  * should use scsi_bus_init() instead.\n  */\n void scsi_bus_init_named(SCSIBus *bus, size_t bus_size, DeviceState *host,\n-                         const SCSIBusInfo *info, const char *bus_name);\n+                         const SCSIBusInfo *info, const SCSIBusConfig *config,\n+                         const char *bus_name);\n \n /**\n  * scsi_bus_init: Initialize a SCSI bus\n@@ -198,9 +205,10 @@ void scsi_bus_init_named(SCSIBus *bus, size_t bus_size, DeviceState *host,\n  * an automatically generated unique name.\n  */\n static inline void scsi_bus_init(SCSIBus *bus, size_t bus_size,\n-                                 DeviceState *host, const SCSIBusInfo *info)\n+                                 DeviceState *host, const SCSIBusInfo *info,\n+                                 const SCSIBusConfig *config)\n {\n-    scsi_bus_init_named(bus, bus_size, host, info, NULL);\n+    scsi_bus_init_named(bus, bus_size, host, info, config, NULL);\n }\n \n static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)\n","prefixes":["1/5"]}