From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Namhyung Kim <namhyung@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Cc: "Namhyung Kim" <namhyung@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Anthony Liguori" <aliguori@amazon.com>,
"Anton Vorontsov" <anton@enomsg.org>,
"Colin Cross" <ccross@android.com>,
"Kees Cook" <keescook@chromium.org>,
"Tony Luck" <tony.luck@intel.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Minchan Kim" <minchan@kernel.org>,
kvm@vger.kernel.org, qemu-devel@nongnu.org,
virtualization@lists.linux-foundation.org
Subject: Re: [Qemu-devel] [PATCH 2/3] qemu: Implement virtio-pstore device
Date: Mon, 18 Jul 2016 09:28:42 +0200 [thread overview]
Message-ID: <578C852A.1030502@de.ibm.com> (raw)
In-Reply-To: <1468816661-6345-3-git-send-email-namhyung@kernel.org>
On 07/18/2016 06:37 AM, Namhyung Kim wrote:
Can you do the virtio-mmio and virtio-ccw plumbing as well, or
do you need help with that?
[...]
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 2b34b43..8281b80 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -2416,6 +2416,55 @@ static const TypeInfo virtio_host_pci_info = {
> };
> #endif
>
> +/* virtio-pstore-pci */
> +
> +static void virtio_pstore_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
> +{
> + VirtIOPstorePCI *vps = VIRTIO_PSTORE_PCI(vpci_dev);
> + DeviceState *vdev = DEVICE(&vps->vdev);
> + Error *err = NULL;
> +
> + qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
> + object_property_set_bool(OBJECT(vdev), true, "realized", &err);
> + if (err) {
> + error_propagate(errp, err);
> + return;
> + }
> +}
> +
> +static void virtio_pstore_pci_class_init(ObjectClass *klass, void *data)
> +{
> + DeviceClass *dc = DEVICE_CLASS(klass);
> + VirtioPCIClass *k = VIRTIO_PCI_CLASS(klass);
> + PCIDeviceClass *pcidev_k = PCI_DEVICE_CLASS(klass);
> +
> + k->realize = virtio_pstore_pci_realize;
> + set_bit(DEVICE_CATEGORY_MISC, dc->categories);
> +
> + pcidev_k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
> + pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_PSTORE;
> + pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
> + pcidev_k->class_id = PCI_CLASS_OTHERS;
> +}
> +
> +static void virtio_pstore_pci_instance_init(Object *obj)
> +{
> + VirtIOPstorePCI *dev = VIRTIO_PSTORE_PCI(obj);
> +
> + virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
> + TYPE_VIRTIO_PSTORE);
> + object_property_add_alias(obj, "directory", OBJECT(&dev->vdev),
> + "directory", &error_abort);
> +}
> +
> +static const TypeInfo virtio_pstore_pci_info = {
> + .name = TYPE_VIRTIO_PSTORE_PCI,
> + .parent = TYPE_VIRTIO_PCI,
> + .instance_size = sizeof(VirtIOPstorePCI),
> + .instance_init = virtio_pstore_pci_instance_init,
> + .class_init = virtio_pstore_pci_class_init,
> +};
> +
> /* virtio-pci-bus */
>
> static void virtio_pci_bus_new(VirtioBusState *bus, size_t bus_size,
> @@ -2485,6 +2534,7 @@ static void virtio_pci_register_types(void)
> #ifdef CONFIG_VHOST_SCSI
> type_register_static(&vhost_scsi_pci_info);
> #endif
> + type_register_static(&virtio_pstore_pci_info);
> }
>
> type_init(virtio_pci_register_types)
> diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
> index e4548c2..b4c039f 100644
> --- a/hw/virtio/virtio-pci.h
> +++ b/hw/virtio/virtio-pci.h
> @@ -31,6 +31,7 @@
> #ifdef CONFIG_VHOST_SCSI
> #include "hw/virtio/vhost-scsi.h"
> #endif
> +#include "hw/virtio/virtio-pstore.h"
>
> typedef struct VirtIOPCIProxy VirtIOPCIProxy;
> typedef struct VirtIOBlkPCI VirtIOBlkPCI;
> @@ -44,6 +45,7 @@ typedef struct VirtIOInputPCI VirtIOInputPCI;
> typedef struct VirtIOInputHIDPCI VirtIOInputHIDPCI;
> typedef struct VirtIOInputHostPCI VirtIOInputHostPCI;
> typedef struct VirtIOGPUPCI VirtIOGPUPCI;
> +typedef struct VirtIOPstorePCI VirtIOPstorePCI;
>
> /* virtio-pci-bus */
>
> @@ -311,6 +313,18 @@ struct VirtIOGPUPCI {
> VirtIOGPU vdev;
> };
>
> +/*
> + * virtio-pstore-pci: This extends VirtioPCIProxy.
> + */
> +#define TYPE_VIRTIO_PSTORE_PCI "virtio-pstore-pci"
> +#define VIRTIO_PSTORE_PCI(obj) \
> + OBJECT_CHECK(VirtIOPstorePCI, (obj), TYPE_VIRTIO_PSTORE_PCI)
> +
> +struct VirtIOPstorePCI {
> + VirtIOPCIProxy parent_obj;
> + VirtIOPstore vdev;
> +};
> +
> /* Virtio ABI version, if we increment this, we break the guest driver. */
> #define VIRTIO_PCI_ABI_VERSION 0
>
[...]
next prev parent reply other threads:[~2016-07-18 7:28 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-18 4:37 [Qemu-devel] [RFC/PATCHSET 0/3] virtio-pstore: Implement virtio pstore device Namhyung Kim
2016-07-18 4:37 ` [Qemu-devel] [PATCH 1/3] virtio: Basic implementation of virtio pstore driver Namhyung Kim
2016-07-18 5:12 ` Kees Cook
2016-07-18 5:50 ` Namhyung Kim
2016-07-18 17:50 ` Kees Cook
2016-07-19 13:43 ` Namhyung Kim
2016-07-19 15:32 ` Namhyung Kim
2016-07-20 12:56 ` Namhyung Kim
2016-07-18 7:54 ` Cornelia Huck
2016-07-18 8:29 ` Namhyung Kim
2016-07-18 9:02 ` Cornelia Huck
2016-07-18 4:37 ` [Qemu-devel] [PATCH 2/3] qemu: Implement virtio-pstore device Namhyung Kim
2016-07-18 7:28 ` Christian Borntraeger [this message]
2016-07-18 8:33 ` Namhyung Kim
2016-07-18 10:03 ` Stefan Hajnoczi
2016-07-18 14:21 ` Namhyung Kim
2016-07-20 8:29 ` Stefan Hajnoczi
2016-07-20 12:46 ` Namhyung Kim
2016-07-19 15:48 ` Namhyung Kim
2016-07-20 8:21 ` Stefan Hajnoczi
2016-07-20 12:30 ` Namhyung Kim
-- strict thread matches above, loose matches on Subject: below --
2016-08-20 8:07 [Qemu-devel] [RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v3) Namhyung Kim
2016-08-20 8:07 ` [Qemu-devel] [PATCH 2/3] qemu: Implement virtio-pstore device Namhyung Kim
2016-08-24 22:00 ` Daniel P. Berrange
2016-08-26 4:48 ` Namhyung Kim
2016-08-26 12:27 ` Daniel P. Berrange
2016-09-13 15:57 ` Michael S. Tsirkin
2016-09-16 10:05 ` Namhyung Kim
2016-11-10 22:50 ` Michael S. Tsirkin
2016-11-15 6:23 ` Namhyung Kim
2016-11-15 14:38 ` Michael S. Tsirkin
2016-08-31 8:07 [Qemu-devel] [RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v4) Namhyung Kim
2016-08-31 8:08 ` [Qemu-devel] [PATCH 2/3] qemu: Implement virtio-pstore device Namhyung Kim
2016-09-04 14:38 [Qemu-devel] [RFC/PATCHSET 0/3] virtio: Implement virtio pstore device (v5) Namhyung Kim
2016-09-04 14:38 ` [Qemu-devel] [PATCH 2/3] qemu: Implement virtio-pstore device Namhyung Kim
2016-09-22 12:23 ` Stefan Hajnoczi
2016-09-23 5:52 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=578C852A.1030502@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=aliguori@amazon.com \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=keescook@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
--cc=mst@redhat.com \
--cc=namhyung@gmail.com \
--cc=namhyung@kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tony.luck@intel.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).