[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 11/21] virtio-pci: Proxy for virtio-mem
From: |
David Hildenbrand |
Subject: |
Re: [PATCH v5 11/21] virtio-pci: Proxy for virtio-mem |
Date: |
Mon, 6 Jul 2020 18:39:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 06.07.20 17:28, Cornelia Huck wrote:
> On Fri, 26 Jun 2020 09:22:38 +0200
> David Hildenbrand <david@redhat.com> wrote:
>
>> Let's add a proxy for virtio-mem, make it a memory device, and
>> pass-through the properties.
>>
>> Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>> hw/virtio/Makefile.objs | 1 +
>> hw/virtio/virtio-mem-pci.c | 129 +++++++++++++++++++++++++++++++++++++
>> hw/virtio/virtio-mem-pci.h | 33 ++++++++++
>> include/hw/pci/pci.h | 1 +
>> 4 files changed, 164 insertions(+)
>> create mode 100644 hw/virtio/virtio-mem-pci.c
>> create mode 100644 hw/virtio/virtio-mem-pci.h
>
> (...)
>
>> diff --git a/hw/virtio/virtio-mem-pci.c b/hw/virtio/virtio-mem-pci.c
>> new file mode 100644
>> index 0000000000..b325303b32
>> --- /dev/null
>> +++ b/hw/virtio/virtio-mem-pci.c
>> @@ -0,0 +1,129 @@
>> +/*
>> + * Virtio MEM PCI device
>> + *
>> + * Copyright (C) 2020 Red Hat, Inc.
>> + *
>> + * Authors:
>> + * David Hildenbrand <david@redhat.com>
>> + *
>> + * This work is licensed under the terms of the GNU GPL, version 2.
>> + * See the COPYING file in the top-level directory.
>> + */
>> +
>> +#include "qemu/osdep.h"
>> +#include "virtio-mem-pci.h"
>> +#include "hw/mem/memory-device.h"
>> +#include "qapi/error.h"
>> +
>> +static void virtio_mem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
>> +{
>> + VirtIOMEMPCI *mem_pci = VIRTIO_MEM_PCI(vpci_dev);
>> + DeviceState *vdev = DEVICE(&mem_pci->vdev);
>> +
>
> As we were having that discussion for other devices recently: I think
> you want to use
>
> virtio_pci_force_virtio_1(vpci_dev);
>
> here. (Or do it via the names in the type, as virtio-fs does, but I
> think I like forcing it better.)
Interesting. There is a PULL request pending which includes virtio-mem,
so I'll send that as an addon. Thanks!
--
Thanks,
David / dhildenb