qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Jie Deng <jie.deng@intel.com>, Bill Mills <bill.mills@linaro.org>,
	qemu-devel@nongnu.org, Arnd Bergmann <arnd.bergmann@linaro.com>,
	Mike Holmes <mike.holmes@linaro.org>,
	stratos-dev@op-lists.linaro.org
Subject: Re: [PATCH 2/5] hw/virtio: add vhost-user-i2c-pci boilerplate
Date: Mon, 29 Mar 2021 16:19:13 +0100	[thread overview]
Message-ID: <87im5ax9x3.fsf@linaro.org> (raw)
In-Reply-To: <9fbb332cc66aa1df562ac0dd1f54166d68671681.1616570702.git.viresh.kumar@linaro.org>


Viresh Kumar <viresh.kumar@linaro.org> writes:

> This allows is to instantiate a vhost-user-i2c device as part of a PCI
> bus. It is mostly boilerplate which looks pretty similar to the
> vhost-user-fs-pci device.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  hw/virtio/meson.build          |  1 +
>  hw/virtio/vhost-user-i2c-pci.c | 79 ++++++++++++++++++++++++++++++++++
>  2 files changed, 80 insertions(+)
>  create mode 100644 hw/virtio/vhost-user-i2c-pci.c
>
> diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> index 1a0d736a0db5..bc352a600911 100644
> --- a/hw/virtio/meson.build
> +++ b/hw/virtio/meson.build
> @@ -26,6 +26,7 @@ virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
>  virtio_ss.add(when: 'CONFIG_VIRTIO_IOMMU', if_true: files('virtio-iommu.c'))
>  virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-mem.c'))
>  virtio_ss.add(when: 'CONFIG_VHOST_USER_I2C', if_true: files('vhost-user-i2c.c'))
> +virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_I2C'], if_true: files('vhost-user-i2c-pci.c'))
>  
>  virtio_pci_ss = ss.source_set()
>  virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-pci.c'))
> diff --git a/hw/virtio/vhost-user-i2c-pci.c b/hw/virtio/vhost-user-i2c-pci.c
> new file mode 100644
> index 000000000000..4bcfeafcb632
> --- /dev/null
> +++ b/hw/virtio/vhost-user-i2c-pci.c
> @@ -0,0 +1,79 @@
> +/*
> + * Vhost-user i2c virtio device PCI glue
> + *
> + * Copyright (c) 2021 Viresh Kumar <viresh.kumar@linaro.org>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "hw/qdev-properties.h"
> +#include "hw/virtio/vhost-user-i2c.h"
> +#include "virtio-pci.h"
> +
> +struct VHostUserI2CPCI {
> +    VirtIOPCIProxy parent_obj;
> +    VHostUserI2C vdev;
> +};
> +
> +typedef struct VHostUserI2CPCI VHostUserI2CPCI;
> +
> +#define TYPE_VHOST_USER_I2C_PCI "vhost-user-i2c-pci-base"
> +
> +DECLARE_INSTANCE_CHECKER(VHostUserI2CPCI, VHOST_USER_I2C_PCI,
> +                         TYPE_VHOST_USER_I2C_PCI)
> +
> +static Property vhost_user_i2c_pci_properties[] = {
> +    DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
> +                       DEV_NVECTORS_UNSPECIFIED),

I suspect we can drop the property if there is nothing useful the user
can specify here. We can just default to 1 on device realization.

Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


  reply	other threads:[~2021-03-29 15:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  7:33 [PATCH 0/5] virtio: Implement generic vhost-user-i2c backend Viresh Kumar
2021-03-24  7:33 ` [PATCH 1/5] hw/virtio: add boilerplate for vhost-user-i2c device Viresh Kumar
2021-03-29 15:13   ` Alex Bennée
2021-03-24  7:33 ` [PATCH 2/5] hw/virtio: add vhost-user-i2c-pci boilerplate Viresh Kumar
2021-03-29 15:19   ` Alex Bennée [this message]
2021-03-24  7:33 ` [PATCH 3/5] tools/vhost-user-i2c: Add backend driver Viresh Kumar
2021-03-25  5:09   ` Jie Deng
2021-03-25  5:22     ` Viresh Kumar
2021-03-25 12:22       ` Alex Bennée
2021-03-30 12:49       ` Alex Bennée
2021-03-25  6:17   ` Jie Deng
2021-03-25  6:36     ` Viresh Kumar
2021-03-25 16:16   ` Arnd Bergmann
2021-03-26  6:01     ` Viresh Kumar
2021-03-26  8:33       ` Arnd Bergmann
2021-03-26  7:14     ` Viresh Kumar
2021-03-26  8:24       ` Arnd Bergmann
2021-03-24  7:33 ` [PATCH 4/5] docs: add a man page for vhost-user-i2c Viresh Kumar
2021-03-24  7:33 ` [PATCH 5/5] MAINTAINERS: Add entry for virtio-i2c Viresh Kumar
2021-03-24  7:42 ` [PATCH 0/5] virtio: Implement generic vhost-user-i2c backend no-reply
2021-03-24 11:05   ` Viresh Kumar

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=87im5ax9x3.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=arnd.bergmann@linaro.com \
    --cc=bill.mills@linaro.org \
    --cc=jie.deng@intel.com \
    --cc=mike.holmes@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stratos-dev@op-lists.linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.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).