[{"id":3678318,"web_url":"http://patchwork.ozlabs.org/comment/3678318/","msgid":"<CA+JCrau4wmDG_9H8bm4ryu5sXyt602dghZ38UMGSon+aHKj=4Q@mail.gmail.com>","list_archive_url":null,"date":"2026-04-16T18:47:40","subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","submitter":{"id":93170,"url":"http://patchwork.ozlabs.org/api/people/93170/","name":"Rafet T","email":"rafettaskindev@gmail.com"},"content":"this is continuation of\nhttps://lore.kernel.org/qemu-devel/aeEicSrfbE2sZo8w@redhat.com/T/#t\n\nOn Thu, Apr 16, 2026 at 9:36 PM rft0 <rafettaskindev@gmail.com> wrote:\n\n> Add initial emulation of SCSI tape device supporting basic\n> INQUIRY operation for now.\n>\n> Signed-off-by: rft0 <rafettaskindev@gmail.com>\n> ---\n> Second patch:\n>  - Add kconfig entry\n>  - Validate vendor, product, version, serial lengths\n>\n>  hw/scsi/Kconfig     |   5 +\n>  hw/scsi/meson.build |   1 +\n>  hw/scsi/scsi-tape.c | 349 ++++++++++++++++++++++++++++++++++++++++++++\n>  3 files changed, 355 insertions(+)\n>  create mode 100644 hw/scsi/scsi-tape.c\n>\n> diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig\n> index 5743ee9b4d..06e7cab178 100644\n> --- a/hw/scsi/Kconfig\n> +++ b/hw/scsi/Kconfig\n> @@ -1,6 +1,11 @@\n>  config SCSI\n>      bool\n>\n> +config SCSI_TAPE\n> +    bool\n> +    default y\n> +    depends on SCSI\n> +\n>  config LSI_SCSI_PCI\n>      bool\n>      default y if PCI_DEVICES\n> diff --git a/hw/scsi/meson.build b/hw/scsi/meson.build\n> index 69fde0cf84..1c62115d8e 100644\n> --- a/hw/scsi/meson.build\n> +++ b/hw/scsi/meson.build\n> @@ -8,6 +8,7 @@ scsi_ss.add(files(\n>    'scsi-disk.c',\n>    'scsi-generic.c',\n>  ))\n> +scsi_ss.add(when: 'CONFIG_SCSI_TAPE', if_true: files('scsi-tape.c'))\n>  scsi_ss.add(when: 'CONFIG_ESP', if_true: files('esp.c'))\n>  scsi_ss.add(when: 'CONFIG_ESP_PCI', if_true: files('esp-pci.c'))\n>  scsi_ss.add(when: 'CONFIG_LSI_SCSI_PCI', if_true: files('lsi53c895a.c'))\n> diff --git a/hw/scsi/scsi-tape.c b/hw/scsi/scsi-tape.c\n> new file mode 100644\n> index 0000000000..adbae9b4ad\n> --- /dev/null\n> +++ b/hw/scsi/scsi-tape.c\n> @@ -0,0 +1,349 @@\n> +/*\n> + * SCSI Tape Device emulation\n> + *\n> + * SPDX-License-Identifier: GPL-2.0-or-later\n> + *\n> + * Written by Rafet Taskin <rafettaskindev@gmail.com>\n> + *\n> + * SCSI Tape device emulation.\n> + *\n> + */\n> +\n> +#include \"qemu/hw-version.h\"\n> +#include \"qemu/osdep.h\"\n> +#include \"qapi/error.h\"\n> +#include \"qemu/module.h\"\n> +#include \"qemu/memalign.h\"\n> +#include \"qemu/cutils.h\"\n> +#include \"hw/scsi/scsi.h\"\n> +#include \"scsi/constants.h\"\n> +#include \"system/block-backend.h\"\n> +#include \"hw/block/block.h\"\n> +#include \"hw/core/qdev-properties.h\"\n> +#include \"hw/core/qdev-properties-system.h\"\n> +#include \"qom/object.h\"\n> +\n> +#define SCSI_MAX_INQUIRY_LEN    256\n> +\n> +#define MAX_SERIAL_LEN 36\n> +\n> +#define TYPE_SCSI_TAPE \"scsi-tape\"\n> +\n> +OBJECT_DECLARE_SIMPLE_TYPE(SCSITapeState, SCSI_TAPE)\n> +\n> +typedef struct SCSITapeReq {\n> +    SCSIRequest req;\n> +\n> +    uint32_t buflen;\n> +    struct iovec iov;\n> +\n> +    QEMUIOVector qiov;\n> +} SCSITapeReq;\n> +\n> +struct SCSITapeState {\n> +    SCSIDevice qdev;\n> +\n> +    char *vendor;\n> +    char *product;\n> +    char *version;\n> +    char *serial;\n> +};\n> +\n> +static void scsi_free_request(SCSIRequest *req)\n> +{\n> +    SCSITapeReq *r = DO_UPCAST(SCSITapeReq, req, req);\n> +\n> +    qemu_vfree(r->iov.iov_base);\n> +}\n> +\n> +static uint8_t *scsi_get_buf(SCSIRequest *req)\n> +{\n> +    SCSITapeReq *r = DO_UPCAST(SCSITapeReq, req, req);\n> +\n> +    return (uint8_t *)r->iov.iov_base;\n> +}\n> +\n> +static void scsi_init_iovec(SCSITapeReq *r, size_t size)\n> +{\n> +    if (!r->iov.iov_base) {\n> +        r->buflen = size;\n> +        r->iov.iov_base = qemu_memalign(qemu_real_host_page_size(), size);\n> +    }\n> +\n> +    r->iov.iov_len = size;\n> +    qemu_iovec_init_external(&r->qiov, &r->iov, 1);\n> +}\n> +\n> +static void scsi_check_condition(SCSITapeReq *r, SCSISense sense)\n> +{\n> +    scsi_req_build_sense(&r->req, sense);\n> +    scsi_req_complete(&r->req, CHECK_CONDITION);\n> +}\n> +\n> +static int scsi_disk_emulate_vpd_page(SCSIRequest *req, uint8_t *outbuf)\n> +{\n> +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, req->dev);\n> +    uint8_t page_code = req->cmd.buf[2];\n> +\n> +    outbuf[0] = TYPE_TAPE;\n> +    outbuf[1] = page_code;\n> +    outbuf[2] = 0x00;\n> +    outbuf[3] = 0x00;\n> +\n> +    switch (page_code) {\n> +    case 0x00: /* Supported VPD pages */\n> +        outbuf[4] = 0x00;   /* page 0x00 (this page) */\n> +        if (s->serial) {\n> +            outbuf[5] = 0x80;   /* page 0x80 (serial number) */\n> +            outbuf[3] = 2;      /* page data length */\n> +            return 6;\n> +        }\n> +        outbuf[3] = 1;\n> +        return 5;\n> +\n> +    case 0x80: /* Unit Serial Number */\n> +        if (!s->serial) {\n> +            return -1;   /* not supported, caller sends INVALID_FIELD */\n> +        }\n> +        {\n> +            int l = strlen(s->serial);\n> +            outbuf[3] = l;\n> +            memcpy(&outbuf[4], s->serial, l);\n> +            return 4 + l;\n> +        }\n> +\n> +    default:\n> +        return -1;  /* unsupported VPD page */\n> +    }\n> +}\n> +\n> +static int scsi_tape_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)\n> +{\n> +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, req->dev);\n> +    int buflen;\n> +\n> +    if (req->cmd.buf[1] & 0x1) {\n> +        return scsi_disk_emulate_vpd_page(req, outbuf);\n> +    }\n> +\n> +    /* Standard INQUIRY, not a VPD request */\n> +    if (req->cmd.buf[2] != 0) {\n> +        return -1;\n> +    }\n> +\n> +    /* PAGE_CODE == 0 */\n> +    buflen = req->cmd.xfer;\n> +    if (buflen > SCSI_MAX_INQUIRY_LEN) {\n> +        buflen = SCSI_MAX_INQUIRY_LEN;\n> +    }\n> +\n> +    outbuf[0] = TYPE_TAPE;      /* 0x01 = Tape */\n> +    outbuf[1] = 0x80;           /* Always removable */\n> +    outbuf[2] = 0x05;           /* SPC-3 */\n> +    outbuf[3] = 0x02 | 0x10;    /* Format 2, HiSup */\n> +\n> +    if (buflen > 36) {\n> +        outbuf[4] = buflen - 5;\n> +    } else {\n> +        outbuf[4] = 36 - 5;\n> +    }\n> +\n> +    outbuf[7] = 0x10 | (req->bus->info->tcq ? 0x02 : 0);\n> +\n> +    strpadcpy((char *)&outbuf[16], 16, s->product, ' ');\n> +    strpadcpy((char *)&outbuf[8], 8, s->vendor, ' ');\n> +\n> +    memset(&outbuf[32], 0, 4);\n> +    memcpy(&outbuf[32], s->version, MIN(4, strlen(s->version)));\n> +\n> +    return buflen;\n> +}\n> +\n> +/*\n> + * > 0 - number of bytes from device to host\n> + * < 0 - number of bytes from host to device\n> + * = 0 - no data transfer, already completed\n> + */\n> +static int32_t scsi_tape_emulate_command(SCSIRequest *req, uint8_t *buf)\n> +{\n> +    SCSITapeReq *r = DO_UPCAST(SCSITapeReq, req, req);\n> +    uint8_t *outbuf;\n> +    int32_t len = 0;\n> +    uint8_t command = buf[0];\n> +\n> +    if (req->cmd.xfer > 65536) {\n> +        scsi_check_condition(r, SENSE_CODE(INVALID_FIELD));\n> +        return 0;\n> +    }\n> +    r->buflen = MAX(4096, req->cmd.xfer);\n> +    scsi_init_iovec(r, r->buflen);\n> +\n> +    outbuf = r->iov.iov_base;\n> +    memset(outbuf, 0, r->buflen);\n> +\n> +    switch (command) {\n> +    case INQUIRY:\n> +        len = scsi_tape_emulate_inquiry(req, outbuf);\n> +        if (len < 0) {\n> +            scsi_check_condition(r, SENSE_CODE(INVALID_FIELD));\n> +            return 0;\n> +        }\n> +        break;\n> +\n> +    case TEST_UNIT_READY:\n> +        if (!blk_is_available(req->dev->conf.blk)) {\n> +            scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));\n> +            return 0;\n> +        }\n> +\n> +        /* TODO: check if tape is really ready */\n> +        scsi_req_complete(&r->req, GOOD);\n> +        return 0;\n> +    case REQUEST_SENSE:\n> +        /* TODO: returning NO SENSE for now handle it later. */\n> +        /* 0x0: 0x70 = current errors, fixed format */\n> +        /* 0x2: sense key (0x00 = NO SENSE) */\n> +        /* 0x7: additional sense length */\n> +        {\n> +            int sense_len = MIN(buf[4], 18);\n> +            memset(outbuf, 0, sense_len);\n> +            outbuf[0] = 0x70;\n> +            outbuf[2] = 0x00;\n> +            outbuf[7] = 10;\n> +            len = sense_len;\n> +        }\n> +        break;\n> +\n> +    case REWIND:\n> +        if (!blk_is_available(req->dev->conf.blk)) {\n> +            scsi_check_condition(r, SENSE_CODE(NO_MEDIUM));\n> +            return 0;\n> +        }\n> +\n> +        /* TODO: reset tape position to beginning of SIMH image */\n> +        scsi_req_complete(&r->req, GOOD);\n> +        return 0;\n> +\n> +    /* Add rest later */\n> +    default:\n> +        scsi_check_condition(r, SENSE_CODE(INVALID_OPCODE));\n> +        return 0;\n> +    }\n> +\n> +    r->iov.iov_len = len;\n> +    return len;\n> +}\n> +\n> +\n> +/* TODO */\n> +static void scsi_tape_emulate_read_data(SCSIRequest *req)\n> +{\n> +    SCSITapeReq *r = DO_UPCAST(SCSITapeReq, req, req);\n> +    int buflen = r->iov.iov_len;\n> +\n> +    if (buflen) {\n> +        r->iov.iov_len = 0;\n> +        scsi_req_data(&r->req, buflen);\n> +        return;\n> +    }\n> +\n> +    scsi_req_complete(&r->req, GOOD);\n> +}\n> +\n> +/* TODO: not implemented yet */\n> +static void scsi_tape_emulate_write_data(SCSIRequest *req)\n> +{\n> +    scsi_req_complete(req, GOOD);\n> +}\n> +\n> +static const SCSIReqOps scsi_tape_reqops = {\n> +    .size         = sizeof(SCSITapeReq),\n> +    .free_req     = scsi_free_request,\n> +    .send_command = scsi_tape_emulate_command,\n> +    .read_data    = scsi_tape_emulate_read_data,\n> +    .write_data   = scsi_tape_emulate_write_data,\n> +    .get_buf      = scsi_get_buf,\n> +};\n> +\n> +static SCSIRequest *scsi_tape_new_request(SCSIDevice *d, uint32_t tag,\n> +                                          uint32_t lun, uint8_t *buf,\n> +                                          void *hba_private)\n> +{\n> +    return scsi_req_alloc(&scsi_tape_reqops, d, tag, lun, hba_private);\n> +}\n> +\n> +static void scsi_tape_realize(SCSIDevice *dev, Error **errp)\n> +{\n> +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, dev);\n> +\n> +    dev->type = TYPE_TAPE;\n> +\n> +    if (!s->qdev.conf.blk) {\n> +        error_setg(errp, \"Drive property not set\");\n> +        return;\n> +    }\n> +\n> +    if (!blk_is_inserted(s->qdev.conf.blk)) {\n> +        error_setg(errp, \"Device needs media, but drive is empty\");\n> +        return;\n> +    }\n> +\n> +    if (!s->vendor) {\n> +        s->vendor = g_strdup(\"QEMU\");\n> +    } else if (strlen(s->vendor) > 8) {\n> +        error_setg(errp, \"Vendor must be 8 characters at most\");\n> +        return;\n> +    }\n> +\n> +    if (!s->product) {\n> +        s->product = g_strdup(\"QEMU TAPE\");\n> +    } else if (strlen(s->product) > 16) {\n> +        error_setg(errp, \"Product must be 16 characters at most\");\n> +        return;\n> +    }\n> +\n> +    if (!s->version) {\n> +        s->version = g_strdup(QEMU_HW_VERSION);\n> +    } else if (strlen(s->version) > 4) {\n> +        error_setg(errp, \"Version must be 4 characters at most\");\n> +        return;\n> +    }\n> +\n> +    if (s->serial && strlen(s->serial) > 36) {\n> +        error_setg(errp, \"Serial must be 36 characters at most\");\n> +        return;\n> +    }\n> +}\n> +\n> +static Property scsi_tape_properties[] = {\n> +    DEFINE_PROP_DRIVE(\"drive\", SCSITapeState, qdev.conf.blk),\n> +    DEFINE_PROP_STRING(\"vendor\", SCSITapeState, vendor),\n> +    DEFINE_PROP_STRING(\"product\", SCSITapeState, product),\n> +    DEFINE_PROP_STRING(\"ver\", SCSITapeState, version),\n> +    DEFINE_PROP_STRING(\"serial\", SCSITapeState, serial),\n> +};\n> +\n> +static void scsi_tape_class_initfn(ObjectClass *klass, const void *data)\n> +{\n> +    DeviceClass *dc = DEVICE_CLASS(klass);\n> +    SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass);\n> +\n> +    sc->realize   = scsi_tape_realize;\n> +    sc->alloc_req = scsi_tape_new_request;\n> +    dc->desc      = \"SCSI Tape\";\n> +    device_class_set_props(dc, scsi_tape_properties);\n> +}\n> +\n> +static const TypeInfo scsi_tape_info = {\n> +    .name          = TYPE_SCSI_TAPE,\n> +    .parent        = TYPE_SCSI_DEVICE,\n> +    .instance_size = sizeof(SCSITapeState),\n> +    .class_init    = scsi_tape_class_initfn,\n> +};\n> +\n> +static void scsi_tape_register_types(void)\n> +{\n> +    type_register_static(&scsi_tape_info);\n> +}\n> +\n> +type_init(scsi_tape_register_types)\n> --\n> 2.47.3\n>\n>","headers":{"Return-Path":"<qemu-devel-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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=IKa4v+b7;\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-devel-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 4fxRqT6ZM7z1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 04:48:36 +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-devel-bounces@nongnu.org>)\n\tid 1wDRkt-0005oZ-9Z; Thu, 16 Apr 2026 14:47:59 -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 <rafettaskindev@gmail.com>)\n id 1wDRkq-0005oL-VK\n for qemu-devel@nongnu.org; Thu, 16 Apr 2026 14:47:57 -0400","from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <rafettaskindev@gmail.com>)\n id 1wDRkn-00021C-2e\n for qemu-devel@nongnu.org; Thu, 16 Apr 2026 14:47:56 -0400","by mail-ot1-x32e.google.com with SMTP id\n 46e09a7af769-7dbff3ea81fso4148855a34.1\n for <qemu-devel@nongnu.org>; Thu, 16 Apr 2026 11:47:52 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; t=1776365271; cv=none;\n d=google.com; s=arc-20240605;\n b=k7Cn9m9RuiWkyCwv2TEK8Dq0JsamqxIxp7j5lb//qRs7hzKQKnmyHPZYh5gGpEcmdO\n 3T9olDg0wS8wjUi+nOgSQ+V0CxcvDJDVpZ1p4X5LAt2Ug8+3yyMhqyWrQM9YCDnPgbeW\n 3yGjV3oVBOlt+MdjJJ4ochLsGGguSUzNm9L5bdeAq3E7HC5/WuexwYXttAzxxaIkaMCU\n 06EGZN/xIggS7hhH3QnDkvJdHeMECIhfmaMd/0rEXUz1UB2UUHEGrSSRiacvbV5nlWsX\n uF2wosjRfivMw/Fn4cy2KF/hghawg39OUWzatn3wLc4veExiSzBD3YLPyOXe7VnDCerG\n xWhg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=sfS9VWZrR2iHoXgMPRV5+qEDclM/LEdfPAkllDQ2vCk=;\n fh=GZZl2e8I1GvW/DYrKgjBPc9AOCDXiU2Fwd8boZaRm4I=;\n b=QUKdiXPeLEXT5iKPaFO1xD8Opi3S45YzSQG6snWcDraVztUZbqvtuY32ytkrjA3Lhv\n 8iVgzzivQ5gPwXdkawDJbrW+a4+tnIlDPrS6JQYQlk2YJsffWjw4KWjDrSgiGO1DddJ/\n 991sVlK82EV9mxMSgSIUAySm9p6L1TfSTNkZy8/eY7yEehi5KCe1zL5X6vrz8bBwI1VE\n oa44olKOWm7XmpjQRY3hoyLfIzrFhSSaCHgMsZQ5Bf77iS3i4rLTDXxVuo0eG87jaOcR\n d6xaVo8G9D7qWVKistrntp9/bp+eSP/bP4QO1M+XynXW4ElboWUODRLdz2AFgGQhloKw\n MlYQ==; darn=nongnu.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776365271; x=1776970071; darn=nongnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=sfS9VWZrR2iHoXgMPRV5+qEDclM/LEdfPAkllDQ2vCk=;\n b=IKa4v+b732SjAue4djV570rHlxvnjDetT3lmmEMh9jaJQd1wyVAk69AIWcDZSuZ2gr\n 6m7HPtcvU0ioEV2MDX2FngOYxkjW3Im10kKlRdtV7Q7s5NdFUM2IkvRwYroduiouFU6u\n 1YHluHoSE80SjT+HJ/iTN1u81ysdT9IGlxxFhKitnEzitzYqdZSU8XaAK+1YKRF71S1j\n pY5qBTUhXyi0e1p2pgkQqDk5rWwB4Oon9wOoiqsnNmWaRCi6Wl/9Jq9ZfZXzZ8EzZGm/\n TDg2ve0ReJckLQggU/xSDWZmh6T5Fm5yrl6MjtSGUk8KfFBXqgTawcECVyLORpPLzU0Q\n YodQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776365271; x=1776970071;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sfS9VWZrR2iHoXgMPRV5+qEDclM/LEdfPAkllDQ2vCk=;\n b=aLktJm5CAWWmkCWwwPQxEG6LA8Ij02kc8+veoL73K3yb/KZ9b3SR3LoDb3dX4Bispq\n dpMFTn6ZYL73fIicbR+0o1/dzCg7zpNxf33SFwF4Tg6NZircn40s43lcN7WCJGkEgCOR\n 3Fy0IICEJ8qe1MrEdia7p3A2mAeWUv14jjx8YMq3Vgr6aoXDHTW+mUurlu3D7Mv1FOcA\n CB80ekshWke8yDHDOEmbDlp+XzJEZiVWJc4C1zGN6IDniwYHypqD7yCQHB9lrs2lPfaz\n h2lrWYWErZRmyKTCyiCuwNCa9Q7rrO4/bf93cUepID7n5vmlTHnrqvH/LyfDAnl9pk1t\n KHfg==","X-Gm-Message-State":"AOJu0YxSWfxK0KAEqipCpu+GJ9cUtwWrreqc0UWACy2G6w+kybHVxSbo\n AUYlrPEbG5gl5VwLC3nInlRFtt976M8ckV327qMMRKzBg0nlNxqcTifRkWCeosAQCKvYxL8oIgR\n TybEcMZ2M8cBCWdpKRxjm+RxfVmfjgpjOGm9SMVE=","X-Gm-Gg":"AeBDietnWbzh9b9xUXr+Q/Ja5rG4ZaqdF07gPRWBhNBE7IqDXVI+KpdUZn7OC8D4Wot\n 5a3vO9G+hrswIMWEtjXe+MCmBrBmWpds47W/Px9UNvtkEl+fo/uWasnOYZgznH7nPYPVnzw98aB\n I5VVdJlftIfTBFhmcQ7wlcIUGWNFu+9QHxN79slBSdyRyWdPDvn1LGQ+rC4d/mNmU8ooYdJLp30\n WysMzAmakEeeTrTrJboRXBQL7Bh9mMNXxVCk+9pr7d/DNwWO/ojkG3VD8WVyu1Lox3IFkoNF5hP\n RAN+OjLhFUnFDNILdQ==","X-Received":"by 2002:a05:6820:c82:b0:684:dd1d:5b8f with SMTP id\n 006d021491bc7-69461894576mr230329eaf.0.1776365271063; Thu, 16 Apr 2026\n 11:47:51 -0700 (PDT)","MIME-Version":"1.0","References":"<20260416183540.142727-1-rafettaskindev@gmail.com>","In-Reply-To":"<20260416183540.142727-1-rafettaskindev@gmail.com>","From":"Rafet T <rafettaskindev@gmail.com>","Date":"Thu, 16 Apr 2026 21:47:40 +0300","X-Gm-Features":"AQROBzCYfJjf4NMa7SxQ3_zvhwiHiuDoFJvcvrLB_MrmwNgMrH-H5cjNRG3YAMw","Message-ID":"\n <CA+JCrau4wmDG_9H8bm4ryu5sXyt602dghZ38UMGSon+aHKj=4Q@mail.gmail.com>","Subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","To":"qemu-devel@nongnu.org","Cc":"berrange@redhat.com, pbonzini@redhat.com, fam@euphon.net","Content-Type":"multipart/alternative; boundary=\"000000000000f92069064f9844c2\"","Received-SPF":"pass client-ip=2607:f8b0:4864:20::32e;\n envelope-from=rafettaskindev@gmail.com; helo=mail-ot1-x32e.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,\n HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3678628,"web_url":"http://patchwork.ozlabs.org/comment/3678628/","msgid":"<aeIED0hn1vC9NpZH@redhat.com>","list_archive_url":null,"date":"2026-04-17T09:57:35","subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Thu, Apr 16, 2026 at 09:35:40PM +0300, rft0 wrote:\n> Add initial emulation of SCSI tape device supporting basic\n> INQUIRY operation for now.\n> \n> Signed-off-by: rft0 <rafettaskindev@gmail.com>\n> ---\n> Second patch:\n>  - Add kconfig entry\n>  - Validate vendor, product, version, serial lengths\n> \n>  hw/scsi/Kconfig     |   5 +\n>  hw/scsi/meson.build |   1 +\n>  hw/scsi/scsi-tape.c | 349 ++++++++++++++++++++++++++++++++++++++++++++\n>  3 files changed, 355 insertions(+)\n>  create mode 100644 hw/scsi/scsi-tape.c\n> \n> diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig\n> index 5743ee9b4d..06e7cab178 100644\n> --- a/hw/scsi/Kconfig\n> +++ b/hw/scsi/Kconfig\n> @@ -1,6 +1,11 @@\n>  config SCSI\n>      bool\n>  \n> +config SCSI_TAPE\n> +    bool\n> +    default y\n> +    depends on SCSI\n> +\n>  config LSI_SCSI_PCI\n>      bool\n>      default y if PCI_DEVICES\n> diff --git a/hw/scsi/meson.build b/hw/scsi/meson.build\n> index 69fde0cf84..1c62115d8e 100644\n> --- a/hw/scsi/meson.build\n> +++ b/hw/scsi/meson.build\n> @@ -8,6 +8,7 @@ scsi_ss.add(files(\n>    'scsi-disk.c',\n>    'scsi-generic.c',\n>  ))\n> +scsi_ss.add(when: 'CONFIG_SCSI_TAPE', if_true: files('scsi-tape.c'))\n>  scsi_ss.add(when: 'CONFIG_ESP', if_true: files('esp.c'))\n>  scsi_ss.add(when: 'CONFIG_ESP_PCI', if_true: files('esp-pci.c'))\n>  scsi_ss.add(when: 'CONFIG_LSI_SCSI_PCI', if_true: files('lsi53c895a.c'))\n> diff --git a/hw/scsi/scsi-tape.c b/hw/scsi/scsi-tape.c\n> new file mode 100644\n> index 0000000000..adbae9b4ad\n> --- /dev/null\n> +++ b/hw/scsi/scsi-tape.c\n> @@ -0,0 +1,349 @@\n> +/*\n> + * SCSI Tape Device emulation\n> + *\n> + * SPDX-License-Identifier: GPL-2.0-or-later\n> + *\n> + * Written by Rafet Taskin <rafettaskindev@gmail.com>\n> + *\n> + * SCSI Tape device emulation.\n> + *\n> + */\n> +\n> +#include \"qemu/hw-version.h\"\n> +#include \"qemu/osdep.h\"\n> +#include \"qapi/error.h\"\n> +#include \"qemu/module.h\"\n> +#include \"qemu/memalign.h\"\n> +#include \"qemu/cutils.h\"\n> +#include \"hw/scsi/scsi.h\"\n> +#include \"scsi/constants.h\"\n> +#include \"system/block-backend.h\"\n> +#include \"hw/block/block.h\"\n> +#include \"hw/core/qdev-properties.h\"\n> +#include \"hw/core/qdev-properties-system.h\"\n> +#include \"qom/object.h\"\n> +\n> +#define SCSI_MAX_INQUIRY_LEN    256\n> +\n> +#define MAX_SERIAL_LEN 36\n\nThis doesn't appear to be used - the value is just\nhardcoded at time of use. Can we use that, and also\nadd constants for the max product, vendor and\nversion fields, since those magic constants are\nused several times over\n\n\n> +static int scsi_disk_emulate_vpd_page(SCSIRequest *req, uint8_t *outbuf)\n> +{\n> +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, req->dev);\n> +    uint8_t page_code = req->cmd.buf[2];\n> +\n> +    outbuf[0] = TYPE_TAPE;\n> +    outbuf[1] = page_code;\n> +    outbuf[2] = 0x00;\n> +    outbuf[3] = 0x00;\n> +\n> +    switch (page_code) {\n> +    case 0x00: /* Supported VPD pages */\n> +        outbuf[4] = 0x00;   /* page 0x00 (this page) */\n> +        if (s->serial) {\n> +            outbuf[5] = 0x80;   /* page 0x80 (serial number) */\n> +            outbuf[3] = 2;      /* page data length */\n> +            return 6;\n> +        }\n> +        outbuf[3] = 1;\n> +        return 5;\n> +\n> +    case 0x80: /* Unit Serial Number */\n> +        if (!s->serial) {\n> +            return -1;   /* not supported, caller sends INVALID_FIELD */\n> +        }\n> +        {\n> +            int l = strlen(s->serial);\n> +            outbuf[3] = l;\n> +            memcpy(&outbuf[4], s->serial, l);\n\nstrpadcpy is probably a better idea, as this leaves the tail of\nthe buffer uninitialized and does not include a NUL terminator.\nEven if the caller has initialized the buffer with nuls, it is\nmore reassuring to reviewers if we explicitly pad here.\n\nUse  MAX_SERIAL_LEN here too with strpadcpy\n\n> +            return 4 + l;\n> +        }\n> +\n> +    default:\n> +        return -1;  /* unsupported VPD page */\n> +    }\n> +}\n> +\n> +static int scsi_tape_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)\n> +{\n> +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, req->dev);\n> +    int buflen;\n> +\n> +    if (req->cmd.buf[1] & 0x1) {\n> +        return scsi_disk_emulate_vpd_page(req, outbuf);\n> +    }\n> +\n> +    /* Standard INQUIRY, not a VPD request */\n> +    if (req->cmd.buf[2] != 0) {\n> +        return -1;\n> +    }\n> +\n> +    /* PAGE_CODE == 0 */\n> +    buflen = req->cmd.xfer;\n> +    if (buflen > SCSI_MAX_INQUIRY_LEN) {\n> +        buflen = SCSI_MAX_INQUIRY_LEN;\n> +    }\n> +\n> +    outbuf[0] = TYPE_TAPE;      /* 0x01 = Tape */\n> +    outbuf[1] = 0x80;           /* Always removable */\n> +    outbuf[2] = 0x05;           /* SPC-3 */\n> +    outbuf[3] = 0x02 | 0x10;    /* Format 2, HiSup */\n> +\n> +    if (buflen > 36) {\n> +        outbuf[4] = buflen - 5;\n> +    } else {\n> +        outbuf[4] = 36 - 5;\n> +    }\n> +\n> +    outbuf[7] = 0x10 | (req->bus->info->tcq ? 0x02 : 0);\n> +\n> +    strpadcpy((char *)&outbuf[16], 16, s->product, ' ');\n> +    strpadcpy((char *)&outbuf[8], 8, s->vendor, ' ');\n\nThe 2nd arg here can use MAX_VENDOR_LEN / MAX_PRODUCT_LEN\n\n> +\n> +    memset(&outbuf[32], 0, 4);\n> +    memcpy(&outbuf[32], s->version, MIN(4, strlen(s->version)));\n\nWhy not use strpadcpy like the two lines above. Also MAX_VERSION_LEN\nconstant would be wise.\n\n> +\n> +    return buflen;\n> +}\n\n> +static void scsi_tape_realize(SCSIDevice *dev, Error **errp)\n> +{\n> +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, dev);\n> +\n> +    dev->type = TYPE_TAPE;\n> +\n> +    if (!s->qdev.conf.blk) {\n> +        error_setg(errp, \"Drive property not set\");\n> +        return;\n> +    }\n> +\n> +    if (!blk_is_inserted(s->qdev.conf.blk)) {\n> +        error_setg(errp, \"Device needs media, but drive is empty\");\n> +        return;\n> +    }\n> +\n> +    if (!s->vendor) {\n> +        s->vendor = g_strdup(\"QEMU\");\n> +    } else if (strlen(s->vendor) > 8) {\n> +        error_setg(errp, \"Vendor must be 8 characters at most\");\n> +        return;\n> +    }\n\nGet rid of the \"else\" here and in the checks below - we want\nto sanity check that the static constant is not oversized too,\nespecially for QEMU_HW_VERSION. Also use the constants for max\nlength and include the string in the error message . IOW more\nlike this code:\n\n    if (!s->vendor) {\n        s->vendor = g_strdup(\"QEMU\");\n    }\n    if (strlen(s->vendor) > MAX_VENDOR_LEN) {\n        error_setg(errp, \"Vendor '%s' must be %d characters at most\",\n\t           s->vendor, MAX_VENDOR_LEN);\n        return;\n    }\n\n\n\n\n> +    if (!s->product) {\n> +        s->product = g_strdup(\"QEMU TAPE\");\n> +    } else if (strlen(s->product) > 16) {\n> +        error_setg(errp, \"Product must be 16 characters at most\");\n> +        return;\n> +    }\n> +\n> +    if (!s->version) {\n> +        s->version = g_strdup(QEMU_HW_VERSION);\n> +    } else if (strlen(s->version) > 4) {\n> +        error_setg(errp, \"Version must be 4 characters at most\");\n> +        return;\n> +    }\n> +\n> +    if (s->serial && strlen(s->serial) > 36) {\n> +        error_setg(errp, \"Serial must be 36 characters at most\");\n> +        return;\n> +    }\n> +}\n\nWith regards,\nDaniel","headers":{"Return-Path":"<qemu-devel-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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=b9xqp6az;\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-devel-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 4fxr2N1nFYz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 19:59:24 +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-devel-bounces@nongnu.org>)\n\tid 1wDfxp-0003k5-D5; Fri, 17 Apr 2026 05:58:17 -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 <berrange@redhat.com>)\n id 1wDfxN-0003CC-3u\n for qemu-devel@nongnu.org; Fri, 17 Apr 2026 05:57:49 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <berrange@redhat.com>)\n id 1wDfxJ-0003KO-Pv\n for qemu-devel@nongnu.org; Fri, 17 Apr 2026 05:57:48 -0400","from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-83-JSjxaL5WMN68yoDJGLJQ8A-1; Fri,\n 17 Apr 2026 05:57:41 -0400","from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id E55931800454; Fri, 17 Apr 2026 09:57:39 +0000 (UTC)","from redhat.com (headnet01.pony-001.prod.iad2.dc.redhat.com\n [10.2.32.101])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 5786718004AD; Fri, 17 Apr 2026 09:57:38 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776419864;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type:in-reply-to:in-reply-to:  references:references;\n bh=7+69OMv8gYeP8zQnWEjVdVgPPFuLj2SH4ocZ4CutaMI=;\n b=b9xqp6azw+tE81NR1Ucj7YI3X2N2Gp4WgzIaoOtr4wJ/gUJfR8zOBEIqPS+P6kD3OzXeic\n iplIqbfl7OB9oPk6wjAfb+z3uzallV8CGFw4O+OlwZVNAVqESfoRMXH2OaQ7L+ZkVsWKLV\n 7q6yt6KdNze3VLkP6bQhonjWaFuoDRQ=","X-MC-Unique":"JSjxaL5WMN68yoDJGLJQ8A-1","X-Mimecast-MFC-AGG-ID":"JSjxaL5WMN68yoDJGLJQ8A_1776419860","Date":"Fri, 17 Apr 2026 10:57:35 +0100","From":"Daniel =?utf-8?b?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>","To":"rft0 <rafettaskindev@gmail.com>","Cc":"qemu-devel@nongnu.org, pbonzini@redhat.com, fam@euphon.net","Subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","Message-ID":"<aeIED0hn1vC9NpZH@redhat.com>","References":"<aeEicSrfbE2sZo8w>\n <20260416183540.142727-1-rafettaskindev@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260416183540.142727-1-rafettaskindev@gmail.com>","User-Agent":"Mutt/2.2.14 (2025-02-20)","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.93","Received-SPF":"pass client-ip=170.10.129.124;\n envelope-from=berrange@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-25","X-Spam_score":"-2.6","X-Spam_bar":"--","X-Spam_report":"(-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"Daniel =?utf-8?b?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3678644,"web_url":"http://patchwork.ozlabs.org/comment/3678644/","msgid":"<CA+JCratnMOAzjXPcHAGUco50WWXSrHHCzZPnnQEUkU7k-m2VDw@mail.gmail.com>","list_archive_url":null,"date":"2026-04-17T10:22:28","subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","submitter":{"id":93170,"url":"http://patchwork.ozlabs.org/api/people/93170/","name":"Rafet T","email":"rafettaskindev@gmail.com"},"content":"Hello Daniel,\n\nI would like to continue but Helge said only choosen applicant should work\non this. (\nhttps://lore.kernel.org/qemu-devel/aeEicSrfbE2sZo8w@redhat.com/T/#t)\n\nWith regards,\nRafet\n\n\nOn Fri, Apr 17, 2026, 12:57 Daniel P. Berrangé <berrange@redhat.com> wrote:\n\n> On Thu, Apr 16, 2026 at 09:35:40PM +0300, rft0 wrote:\n> > Add initial emulation of SCSI tape device supporting basic\n> > INQUIRY operation for now.\n> >\n> > Signed-off-by: rft0 <rafettaskindev@gmail.com>\n> > ---\n> > Second patch:\n> >  - Add kconfig entry\n> >  - Validate vendor, product, version, serial lengths\n> >\n> >  hw/scsi/Kconfig     |   5 +\n> >  hw/scsi/meson.build |   1 +\n> >  hw/scsi/scsi-tape.c | 349 ++++++++++++++++++++++++++++++++++++++++++++\n> >  3 files changed, 355 insertions(+)\n> >  create mode 100644 hw/scsi/scsi-tape.c\n> >\n> > diff --git a/hw/scsi/Kconfig b/hw/scsi/Kconfig\n> > index 5743ee9b4d..06e7cab178 100644\n> > --- a/hw/scsi/Kconfig\n> > +++ b/hw/scsi/Kconfig\n> > @@ -1,6 +1,11 @@\n> >  config SCSI\n> >      bool\n> >\n> > +config SCSI_TAPE\n> > +    bool\n> > +    default y\n> > +    depends on SCSI\n> > +\n> >  config LSI_SCSI_PCI\n> >      bool\n> >      default y if PCI_DEVICES\n> > diff --git a/hw/scsi/meson.build b/hw/scsi/meson.build\n> > index 69fde0cf84..1c62115d8e 100644\n> > --- a/hw/scsi/meson.build\n> > +++ b/hw/scsi/meson.build\n> > @@ -8,6 +8,7 @@ scsi_ss.add(files(\n> >    'scsi-disk.c',\n> >    'scsi-generic.c',\n> >  ))\n> > +scsi_ss.add(when: 'CONFIG_SCSI_TAPE', if_true: files('scsi-tape.c'))\n> >  scsi_ss.add(when: 'CONFIG_ESP', if_true: files('esp.c'))\n> >  scsi_ss.add(when: 'CONFIG_ESP_PCI', if_true: files('esp-pci.c'))\n> >  scsi_ss.add(when: 'CONFIG_LSI_SCSI_PCI', if_true: files('lsi53c895a.c'))\n> > diff --git a/hw/scsi/scsi-tape.c b/hw/scsi/scsi-tape.c\n> > new file mode 100644\n> > index 0000000000..adbae9b4ad\n> > --- /dev/null\n> > +++ b/hw/scsi/scsi-tape.c\n> > @@ -0,0 +1,349 @@\n> > +/*\n> > + * SCSI Tape Device emulation\n> > + *\n> > + * SPDX-License-Identifier: GPL-2.0-or-later\n> > + *\n> > + * Written by Rafet Taskin <rafettaskindev@gmail.com>\n> > + *\n> > + * SCSI Tape device emulation.\n> > + *\n> > + */\n> > +\n> > +#include \"qemu/hw-version.h\"\n> > +#include \"qemu/osdep.h\"\n> > +#include \"qapi/error.h\"\n> > +#include \"qemu/module.h\"\n> > +#include \"qemu/memalign.h\"\n> > +#include \"qemu/cutils.h\"\n> > +#include \"hw/scsi/scsi.h\"\n> > +#include \"scsi/constants.h\"\n> > +#include \"system/block-backend.h\"\n> > +#include \"hw/block/block.h\"\n> > +#include \"hw/core/qdev-properties.h\"\n> > +#include \"hw/core/qdev-properties-system.h\"\n> > +#include \"qom/object.h\"\n> > +\n> > +#define SCSI_MAX_INQUIRY_LEN    256\n> > +\n> > +#define MAX_SERIAL_LEN 36\n>\n> This doesn't appear to be used - the value is just\n> hardcoded at time of use. Can we use that, and also\n> add constants for the max product, vendor and\n> version fields, since those magic constants are\n> used several times over\n>\n>\n> > +static int scsi_disk_emulate_vpd_page(SCSIRequest *req, uint8_t *outbuf)\n> > +{\n> > +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, req->dev);\n> > +    uint8_t page_code = req->cmd.buf[2];\n> > +\n> > +    outbuf[0] = TYPE_TAPE;\n> > +    outbuf[1] = page_code;\n> > +    outbuf[2] = 0x00;\n> > +    outbuf[3] = 0x00;\n> > +\n> > +    switch (page_code) {\n> > +    case 0x00: /* Supported VPD pages */\n> > +        outbuf[4] = 0x00;   /* page 0x00 (this page) */\n> > +        if (s->serial) {\n> > +            outbuf[5] = 0x80;   /* page 0x80 (serial number) */\n> > +            outbuf[3] = 2;      /* page data length */\n> > +            return 6;\n> > +        }\n> > +        outbuf[3] = 1;\n> > +        return 5;\n> > +\n> > +    case 0x80: /* Unit Serial Number */\n> > +        if (!s->serial) {\n> > +            return -1;   /* not supported, caller sends INVALID_FIELD */\n> > +        }\n> > +        {\n> > +            int l = strlen(s->serial);\n> > +            outbuf[3] = l;\n> > +            memcpy(&outbuf[4], s->serial, l);\n>\n> strpadcpy is probably a better idea, as this leaves the tail of\n> the buffer uninitialized and does not include a NUL terminator.\n> Even if the caller has initialized the buffer with nuls, it is\n> more reassuring to reviewers if we explicitly pad here.\n>\n> Use  MAX_SERIAL_LEN here too with strpadcpy\n>\n> > +            return 4 + l;\n> > +        }\n> > +\n> > +    default:\n> > +        return -1;  /* unsupported VPD page */\n> > +    }\n> > +}\n> > +\n> > +static int scsi_tape_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)\n> > +{\n> > +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, req->dev);\n> > +    int buflen;\n> > +\n> > +    if (req->cmd.buf[1] & 0x1) {\n> > +        return scsi_disk_emulate_vpd_page(req, outbuf);\n> > +    }\n> > +\n> > +    /* Standard INQUIRY, not a VPD request */\n> > +    if (req->cmd.buf[2] != 0) {\n> > +        return -1;\n> > +    }\n> > +\n> > +    /* PAGE_CODE == 0 */\n> > +    buflen = req->cmd.xfer;\n> > +    if (buflen > SCSI_MAX_INQUIRY_LEN) {\n> > +        buflen = SCSI_MAX_INQUIRY_LEN;\n> > +    }\n> > +\n> > +    outbuf[0] = TYPE_TAPE;      /* 0x01 = Tape */\n> > +    outbuf[1] = 0x80;           /* Always removable */\n> > +    outbuf[2] = 0x05;           /* SPC-3 */\n> > +    outbuf[3] = 0x02 | 0x10;    /* Format 2, HiSup */\n> > +\n> > +    if (buflen > 36) {\n> > +        outbuf[4] = buflen - 5;\n> > +    } else {\n> > +        outbuf[4] = 36 - 5;\n> > +    }\n> > +\n> > +    outbuf[7] = 0x10 | (req->bus->info->tcq ? 0x02 : 0);\n> > +\n> > +    strpadcpy((char *)&outbuf[16], 16, s->product, ' ');\n> > +    strpadcpy((char *)&outbuf[8], 8, s->vendor, ' ');\n>\n> The 2nd arg here can use MAX_VENDOR_LEN / MAX_PRODUCT_LEN\n>\n> > +\n> > +    memset(&outbuf[32], 0, 4);\n> > +    memcpy(&outbuf[32], s->version, MIN(4, strlen(s->version)));\n>\n> Why not use strpadcpy like the two lines above. Also MAX_VERSION_LEN\n> constant would be wise.\n>\n> > +\n> > +    return buflen;\n> > +}\n>\n> > +static void scsi_tape_realize(SCSIDevice *dev, Error **errp)\n> > +{\n> > +    SCSITapeState *s = DO_UPCAST(SCSITapeState, qdev, dev);\n> > +\n> > +    dev->type = TYPE_TAPE;\n> > +\n> > +    if (!s->qdev.conf.blk) {\n> > +        error_setg(errp, \"Drive property not set\");\n> > +        return;\n> > +    }\n> > +\n> > +    if (!blk_is_inserted(s->qdev.conf.blk)) {\n> > +        error_setg(errp, \"Device needs media, but drive is empty\");\n> > +        return;\n> > +    }\n> > +\n> > +    if (!s->vendor) {\n> > +        s->vendor = g_strdup(\"QEMU\");\n> > +    } else if (strlen(s->vendor) > 8) {\n> > +        error_setg(errp, \"Vendor must be 8 characters at most\");\n> > +        return;\n> > +    }\n>\n> Get rid of the \"else\" here and in the checks below - we want\n> to sanity check that the static constant is not oversized too,\n> especially for QEMU_HW_VERSION. Also use the constants for max\n> length and include the string in the error message . IOW more\n> like this code:\n>\n>     if (!s->vendor) {\n>         s->vendor = g_strdup(\"QEMU\");\n>     }\n>     if (strlen(s->vendor) > MAX_VENDOR_LEN) {\n>         error_setg(errp, \"Vendor '%s' must be %d characters at most\",\n>                    s->vendor, MAX_VENDOR_LEN);\n>         return;\n>     }\n>\n>\n>\n>\n> > +    if (!s->product) {\n> > +        s->product = g_strdup(\"QEMU TAPE\");\n> > +    } else if (strlen(s->product) > 16) {\n> > +        error_setg(errp, \"Product must be 16 characters at most\");\n> > +        return;\n> > +    }\n> > +\n> > +    if (!s->version) {\n> > +        s->version = g_strdup(QEMU_HW_VERSION);\n> > +    } else if (strlen(s->version) > 4) {\n> > +        error_setg(errp, \"Version must be 4 characters at most\");\n> > +        return;\n> > +    }\n> > +\n> > +    if (s->serial && strlen(s->serial) > 36) {\n> > +        error_setg(errp, \"Serial must be 36 characters at most\");\n> > +        return;\n> > +    }\n> > +}\n>\n> With regards,\n> Daniel\n> --\n> |: https://berrange.com       ~~        https://hachyderm.io/@berrange :|\n> |: https://libvirt.org          ~~          https://entangle-photo.org :|\n> |: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|\n>\n>","headers":{"Return-Path":"<qemu-devel-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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=gJ3AztOO;\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-devel-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 4fxrYn2clnz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 20:23:07 +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-devel-bounces@nongnu.org>)\n\tid 1wDgLV-0001AE-SW; Fri, 17 Apr 2026 06:22:45 -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 <rafettaskindev@gmail.com>)\n id 1wDgLU-0001A4-3V\n for qemu-devel@nongnu.org; Fri, 17 Apr 2026 06:22:44 -0400","from mail-oa1-x31.google.com ([2001:4860:4864:20::31])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <rafettaskindev@gmail.com>)\n id 1wDgLR-0002pk-Aq\n for qemu-devel@nongnu.org; Fri, 17 Apr 2026 06:22:43 -0400","by mail-oa1-x31.google.com with SMTP id\n 586e51a60fabf-408778a8ec4so392620fac.0\n for <qemu-devel@nongnu.org>; Fri, 17 Apr 2026 03:22:40 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; t=1776421360; cv=none;\n d=google.com; s=arc-20240605;\n b=EOULLb9BouDFwXtTmXP8VE8NgCenVMQQ3clnU1I3GmkdLKGjDvNLvomE2sHrnZ5Xro\n 6cafFwh64qMmMhSS3DwuMYxJ5hc9q9RNtW0QEgPnvgB86w3iBxGJQkD9/kHq9ldioDWo\n aLjikp2HJBTo+MM5Al3CXfwi9EUOoKL04qL6QAeoSBDfBDh3LcgYdJcNSicB88AlITAL\n t7xxVXvsyxUR9Sek34WdCJGS+/WLSqOOV5LmgaReRl7f73A1L355+Y7QMs+AnA7EgXOF\n Crn2XyhUuLKOztzj4VD5MZk1DdW6GHAUPaOUiw2AYyNCSGIh8Txa3laL0dimTgI/GZi0\n ldRA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=3Qn45T0k+P9EBe9g4rByzcp1WsAiBtsKt7OEEwOyfKw=;\n fh=hmcxiVGayiYta/WILi0xucvuFOa8fgzSAUgugfqkmgM=;\n b=U3pRDLoysbAx43CXOoYKeB1Brg65CTSi+ttDLgA1Os8gRbuZtY3xPUQecnhSD7uSHs\n 8CU+KJcG+12N4sTwjiCZkPyYZFH4yNiZkQK7GdbNvxR2cizLlqBbvIm8yUmNJThfkIj6\n 9I8Wi+TK5Ng072+cJX4lrAvGzjkvjV/erN9yCXri8Ycx3vQMc/l5ARqc/pnD9ZCMPRuq\n g3FvO9KRYWBKWsAm8OPosmTpFlM7TBC/iOTQn9EQqBSmIiZ2yInKalvKjUGZGp0QhYg7\n L06WYCqOvTJNlsy4qUGVmUOC+IEX5DlvAkNMEfq2lFwI8IRZ5SgvAxHNJVEeQZVKsVNN\n leXg==; darn=nongnu.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776421360; x=1777026160; darn=nongnu.org;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=3Qn45T0k+P9EBe9g4rByzcp1WsAiBtsKt7OEEwOyfKw=;\n b=gJ3AztOOJ2zntYsuES9aCH8RnUx+bjjOa36fNmBbFQMx5KKEOHUBgMMABRJW+ly9ca\n 2bRbT43aCllxTREBGGwC3dVNN0AmUoVNNMhWZCAO5708zpmD5fT/XQo/aMXrMq49QhMM\n 6JGj6Slsp67QxkVUkqF+MlfMzTn6E2RaJp+Ab/7Bhp4tyKqZtISJqyVJs7wkG3OJuYgc\n L1TM/Ay4WseAdEtCGPszt+BK22RsAvIB9asqeZC9QfHsPiZhfZadlWJkpQzZTba1/Ugb\n HGsucNEuVCiu9gAZgJC4SYYvSkXOSptv1TaN6g/kWuukYU+1+yUMUUOlWs7hcTt+JAz/\n OPJA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776421360; x=1777026160;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=3Qn45T0k+P9EBe9g4rByzcp1WsAiBtsKt7OEEwOyfKw=;\n b=Xk2CVdrlOAXz3lLQE9fiIgUaxB42wV+/Ox3nK0U/SbpcmzPB3QQKrMCKoI5xABdMtf\n icTvYPebXN2Dr9IxYC3MbuyS0mqSL0MdaI4TPsDd4psi5lmKicI4KuCplyiT0dyOgR3q\n Pgts4xQDE61IKURtCXv8J1NxxHmMLIbl0w5T7t+xByR7bjVBg8R+JoDttAGQhKHbysYg\n MNJAAXBn8fXYGINXRZvEwU1MTJ1HLR4G6lVVN4foNaoNRkjUGifhviTzQ5L22HyhloEf\n slKNgezo5+deRH1oDgxGNeirSQRCl+4Jc+g8mR70VCMRiq3hBKGMv+GTm1ps6z32TXeA\n /0pQ==","X-Gm-Message-State":"AOJu0Yzu4Sv7VX4bEVxRZmIExt2hOjmA1FJM5k2bVCApWXsXxHSBKemQ\n LDAhOAXG2ahyt3BNhnRG9vXUbkTIwUAiA1H4hsf2sSm2+/0TeNtYUZyk1sVskhOvsMC0fP/+L/h\n ZRdZ6ZytXakzm04SUKs3jLvRr4xpSZFg=","X-Gm-Gg":"AeBDievZ5xIodAfqzQsCOAhfZAgURguARSQje612K/06HKcfpPguLRlACVAV08q1Qbr\n pdKYbNm4Ei/EmLbsXLbW/hNnJrJgB5lXWp2e94aazSo1yoEcfyy+4+31qrnMYXgNQGTtcyXY0Rz\n HcpkXHkjHtsVyY2Yo1T8LcLPdwKEAhHWvPnXQHbCMoLxi1LJHM3PvtWvgP9yCgE9lfpOb0C+Bzu\n ZBvkVxYJN+7ufGDXdMUBQ4qCxMod4QruIxMbb5PNhjAS1tvelzWH0FFD2YlRZ8dQKf4DAT0gr5i\n 7wve7U7vgswq8BJ8tM49","X-Received":"by 2002:a05:6871:d216:b0:417:22c9:a311 with SMTP id\n 586e51a60fabf-42abf220077mr1089589fac.6.1776421359880; Fri, 17 Apr 2026\n 03:22:39 -0700 (PDT)","MIME-Version":"1.0","References":"<20260416183540.142727-1-rafettaskindev@gmail.com>\n <aeIED0hn1vC9NpZH@redhat.com>","In-Reply-To":"<aeIED0hn1vC9NpZH@redhat.com>","From":"Rafet T <rafettaskindev@gmail.com>","Date":"Fri, 17 Apr 2026 13:22:28 +0300","X-Gm-Features":"AQROBzAx0M4qc5HPZo3W9OT_vc6DJBdLprCHHpNCQEqbCFhz1ffeV-Uqpzt64iY","Message-ID":"\n <CA+JCratnMOAzjXPcHAGUco50WWXSrHHCzZPnnQEUkU7k-m2VDw@mail.gmail.com>","Subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","To":"=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>","Cc":"qemu-devel@nongnu.org, pbonzini@redhat.com, fam@euphon.net","Content-Type":"multipart/alternative; boundary=\"000000000000208eb0064fa554ae\"","Received-SPF":"pass client-ip=2001:4860:4864:20::31;\n envelope-from=rafettaskindev@gmail.com; helo=mail-oa1-x31.google.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,\n HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3678646,"web_url":"http://patchwork.ozlabs.org/comment/3678646/","msgid":"<aeILAeLLG1rOpWnf@redhat.com>","list_archive_url":null,"date":"2026-04-17T10:27:13","subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Fri, Apr 17, 2026 at 01:22:28PM +0300, Rafet T wrote:\n> Hello Daniel,\n> \n> I would like to continue but Helge said only choosen applicant should work\n> on this. (\n> https://lore.kernel.org/qemu-devel/aeEicSrfbE2sZo8w@redhat.com/T/#t)\n\nSorry, I missed that other message. Please follow Helge's request.\n\nWith regards,\nDaniel","headers":{"Return-Path":"<qemu-devel-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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=FL4UA5e4;\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-devel-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 4fxrfy066Wz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 Apr 2026 20:27:38 +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-devel-bounces@nongnu.org>)\n\tid 1wDgPz-0002yo-VQ; Fri, 17 Apr 2026 06:27:23 -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 <berrange@redhat.com>)\n id 1wDgPy-0002wo-Sl\n for qemu-devel@nongnu.org; Fri, 17 Apr 2026 06:27:22 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <berrange@redhat.com>)\n id 1wDgPx-0003hY-8H\n for qemu-devel@nongnu.org; Fri, 17 Apr 2026 06:27:22 -0400","from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-278-TIhGqxqOOCqp1Dn99C_bWQ-1; Fri,\n 17 Apr 2026 06:27:19 -0400","from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id B3EC31800345; Fri, 17 Apr 2026 10:27:17 +0000 (UTC)","from redhat.com (headnet01.pony-001.prod.iad2.dc.redhat.com\n [10.2.32.101])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 48EA9195608E; Fri, 17 Apr 2026 10:27:16 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776421640;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type:in-reply-to:in-reply-to:  references:references;\n bh=Ne2gxA3Uj3VynjXq9/cvbycTErqd1xPvuK8XfLpjSi8=;\n b=FL4UA5e4PF6dPkgr+1r6qz7yl+Ar3ia2qso4uFYuoR8GOuMexzVmxU1/z0dxTDotlskWE0\n 4lzhjKlShgnTd+ltwYILQH1wK93p0KKtgFJ08MEOJEjsh9jjUBz85i1EI2bGrEDri7vIug\n uwv5JwNMd2j825LGX/IELPQYYfQf/jg=","X-MC-Unique":"TIhGqxqOOCqp1Dn99C_bWQ-1","X-Mimecast-MFC-AGG-ID":"TIhGqxqOOCqp1Dn99C_bWQ_1776421638","Date":"Fri, 17 Apr 2026 11:27:13 +0100","From":"Daniel =?utf-8?b?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>","To":"Rafet T <rafettaskindev@gmail.com>","Cc":"qemu-devel@nongnu.org, pbonzini@redhat.com, fam@euphon.net","Subject":"Re: [PATCH v2] hw/scsi: Add SCSI tape device emulation","Message-ID":"<aeILAeLLG1rOpWnf@redhat.com>","References":"<20260416183540.142727-1-rafettaskindev@gmail.com>\n <aeIED0hn1vC9NpZH@redhat.com>\n <CA+JCratnMOAzjXPcHAGUco50WWXSrHHCzZPnnQEUkU7k-m2VDw@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"\n <CA+JCratnMOAzjXPcHAGUco50WWXSrHHCzZPnnQEUkU7k-m2VDw@mail.gmail.com>","User-Agent":"Mutt/2.2.14 (2025-02-20)","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.17","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=berrange@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-25","X-Spam_score":"-2.6","X-Spam_bar":"--","X-Spam_report":"(-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"Daniel =?utf-8?b?UC4gQmVycmFuZ8Op?= <berrange@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]