qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Cc: peter.crosthwaite@xilinx.com, mst@redhat.com,
	hutao@cn.fujitsu.com, armbru@redhat.com, qemu-devel@nongnu.org,
	isimatu.yasuaki@jp.fujitsu.com, kroosec@gmail.com,
	tangchen@cn.fujitsu.com, pbonzini@redhat.com,
	lcapitulino@redhat.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v2 1/2] qdev: add list built for devices
Date: Tue, 30 Sep 2014 14:08:37 +0200	[thread overview]
Message-ID: <20140930140837.74791c64@nial.usersys.redhat.com> (raw)
In-Reply-To: <10d53bf553d243380f0355024a1cb300b04060a9.1412067797.git.zhugh.fnst@cn.fujitsu.com>

On Tue, 30 Sep 2014 17:40:34 +0800
Zhu Guihua <zhugh.fnst@cn.fujitsu.com> wrote:

rephrase subj to
 qdev: func_name() helper


> For peripheral device del completion, add a function to build a list for
> devices.
> 
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> ---
>  hw/core/qdev.c         | 13 +++++++++++++
>  include/hw/qdev-core.h |  2 ++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index fcb1638..041ac38 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -1074,6 +1074,19 @@ void device_reset(DeviceState *dev)
>      }
>  }
>  
> +int device_built_list(Object *obj, void *opaque)
qdev_build_hotpluggable_device_list()
might describe better what function does

You can put object_child_foreach(peripheral, device_built_list, &list)
inside if this callback, see for example qmp_pc_dimm_device_list()

Also function would return ALL devices regardless of
whether they are hotpluggable or not.
"hotpluggable" property can be used to discard non hotpluggable devices.


> +{
> +    GSList **list = opaque;
> +    DeviceState *dev = DEVICE(obj);
> +
> +    if (dev->realized) {
> +        *list = g_slist_append(*list, dev);
> +    }
> +
> +    return 0;
> +
> +}
> +
>  Object *qdev_get_machine(void)
>  {
>      static Object *dev;
> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> index 178fee2..3c30837 100644
> --- a/include/hw/qdev-core.h
> +++ b/include/hw/qdev-core.h
> @@ -348,6 +348,8 @@ void qdev_machine_init(void);
>   */
>  void device_reset(DeviceState *dev);
>  
> +int device_built_list(Object *obj, void *opaque);
> +
>  const struct VMStateDescription *qdev_get_vmsd(DeviceState *dev);
>  
>  const char *qdev_fw_name(DeviceState *dev);

  reply	other threads:[~2014-09-30 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30  9:40 [Qemu-devel] [PATCH v2 0/2] monitor: add peripheral device del completion support Zhu Guihua
2014-09-30  9:40 ` [Qemu-devel] [PATCH v2 1/2] qdev: add list built for devices Zhu Guihua
2014-09-30 12:08   ` Igor Mammedov [this message]
2014-09-30  9:40 ` [Qemu-devel] [PATCH v2 2/2] monitor: add del completion for peripheral device Zhu Guihua

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=20140930140837.74791c64@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=isimatu.yasuaki@jp.fujitsu.com \
    --cc=kroosec@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tangchen@cn.fujitsu.com \
    --cc=zhugh.fnst@cn.fujitsu.com \
    /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).