qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/12] hw/virtio: Add support for apple virtio-blk


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 05/12] hw/virtio: Add support for apple virtio-blk
Date: Fri, 16 Jun 2023 16:22:34 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2

On 16/6/23 13:48, Kevin Wolf wrote:
Am 15.06.2023 um 00:56 hat Alexander Graf geschrieben:
Apple has its own virtio-blk PCI device ID where it deviates from the
official virtio-pci spec slightly: It puts a new "apple type"
field at a static offset in config space and introduces a new discard
command.

In other words, it's a different device. We shouldn't try to
differentiate only with a property, but actually model it as a separate
device.

I was thinking of qdev inheritance:

#define TYPE_VIRTIO_BLK_PCI_APPLE "virtio-blk-pci-apple"
OBJECT_DECLARE_SIMPLE_TYPE(VirtIOBlkPCIApple, TYPE_VIRTIO_BLK_PCI_APPLE)

struct VirtIOBlkPCIApple {
    VirtIOBlkPCI parent_obj;
};

and add an optional custom handler in VirtioDeviceClass to handle the
VIRTIO_BLK_T_APPLE1 case.

This patch adds a new qdev property called "apple-type" to virtio-blk-pci.
When that property is set, we assume the virtio-blk device is an Apple one
of the specific type and act accordingly.

Do we have any information on what the number in "apple-type" actually
means or do we have to treat it as a black box?

Signed-off-by: Alexander Graf <graf@amazon.com>
---
  hw/block/virtio-blk.c                       | 23 +++++++++++++++++++++
  hw/virtio/virtio-blk-pci.c                  |  7 +++++++
  include/hw/pci/pci_ids.h                    |  1 +
  include/hw/virtio/virtio-blk.h              |  1 +
  include/standard-headers/linux/virtio_blk.h |  3 +++
  5 files changed, 35 insertions(+)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]