All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	jasowang@redhat.com, qemu-devel@nongnu.org,
	zhangchen.fnst@cn.fujitsu.com, hongyang.yang@easystack.cn
Subject: Re: [Qemu-devel] [PATCH RFC v2 2/5] vl: Make object_create() public
Date: Mon, 1 Feb 2016 10:41:05 +0000	[thread overview]
Message-ID: <20160201104105.GC1622@redhat.com> (raw)
In-Reply-To: <1453883380-10532-3-git-send-email-zhang.zhanghailiang@huawei.com>

On Wed, Jan 27, 2016 at 04:29:37PM +0800, zhanghailiang wrote:
> Make the helper object_create() public and fix its first
> parameter to accept NULL value.
> 
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> ---
> v2:
>  - New patch
> ---
>  include/qemu-common.h | 2 ++
>  vl.c                  | 4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index 22b010c..52cf4fd 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -500,4 +500,6 @@ int parse_debug_env(const char *name, int max, int initial);
>  const char *qemu_ether_ntoa(const MACAddr *mac);
>  void page_size_init(void);
>  
> +int object_create(void *opaque, QemuOpts *opts, Error **errp);
> +
>  #endif
> diff --git a/vl.c b/vl.c
> index f043009..b21335e 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2819,7 +2819,7 @@ static bool object_create_delayed(const char *type)
>  }
>  
>  
> -static int object_create(void *opaque, QemuOpts *opts, Error **errp)
> +int object_create(void *opaque, QemuOpts *opts, Error **errp)
>  {
>      Error *err = NULL;
>      char *type = NULL;
> @@ -2842,7 +2842,7 @@ static int object_create(void *opaque, QemuOpts *opts, Error **errp)
>      if (err) {
>          goto out;
>      }
> -    if (!type_predicate(type)) {
> +    if (type_predicate && !type_predicate(type)) {
>          goto out;
>      }

No, please don't do this - your later patch should *not* be using
object_create, it should use object_new_with_props.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  parent reply	other threads:[~2016-02-01 10:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27  8:29 [Qemu-devel] [PATCH RFC v2 0/5] Netfilter: Add each netdev a default filter zhanghailiang
2016-01-27  8:29 ` [Qemu-devel] [PATCH RFC v2 1/5] net/filter: Add a 'status' property for filter object zhanghailiang
2016-01-27  8:29 ` [Qemu-devel] [PATCH RFC v2 2/5] vl: Make object_create() public zhanghailiang
2016-02-01  3:05   ` Jason Wang
2016-02-01  6:19     ` Hailiang Zhang
2016-02-01  7:27       ` Jason Wang
2016-02-01  7:34         ` Hailiang Zhang
2016-02-01 10:41   ` Daniel P. Berrange [this message]
2016-02-01 10:44     ` Hailiang Zhang
2016-01-27  8:29 ` [Qemu-devel] [PATCH RFC v2 3/5] net/filter: Introduce a helper to add a filter to the netdev zhanghailiang
2016-02-01  3:14   ` Jason Wang
2016-02-01  6:13     ` Hailiang Zhang
2016-02-01  7:46       ` Jason Wang
2016-02-01  7:56         ` Hailiang Zhang
2016-02-01  8:05           ` Yang Hongyang
2016-02-01  8:21             ` Hailiang Zhang
2016-02-01  9:18               ` Jason Wang
2016-02-01  9:39                 ` Hailiang Zhang
2016-02-01  9:49                   ` Jason Wang
2016-02-01 10:41                     ` Hailiang Zhang
2016-02-01  9:04           ` Jason Wang
2016-02-01  9:22             ` Hailiang Zhang
2016-02-01  9:42               ` Jason Wang
2016-02-01 10:40                 ` Hailiang Zhang
2016-02-05  6:19                   ` Jason Wang
2016-02-05  7:01                     ` Hailiang Zhang
2016-02-05  7:40                       ` Jason Wang
2016-02-05  8:29                         ` Hailiang Zhang
2016-02-01 12:21                 ` Hailiang Zhang
2016-02-01 10:43   ` Daniel P. Berrange
2016-02-01 10:57     ` Hailiang Zhang
2016-01-27  8:29 ` [Qemu-devel] [PATCH RFC v2 4/5] filter-buffer: Accept zero interval zhanghailiang
2016-01-27  8:29 ` [Qemu-devel] [PATCH RFC v2 5/5] net/filter: Add a default filter to each netdev zhanghailiang

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=20160201104105.GC1622@redhat.com \
    --to=berrange@redhat.com \
    --cc=hongyang.yang@easystack.cn \
    --cc=jasowang@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhangchen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.