All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Pradeep Jagadeesh <pradeep.jagadeesh@huawei.com>
Cc: Alberto Garcia <berto@igalia.com>,
	Pradeep Jagadeesh <pradeepkiruvale@gmail.com>,
	eric blake <eblake@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	jani kokkonen <jani.kokkonen@huawei.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v10 6/6] fsdev: hmp interface for throttling
Date: Tue, 5 Sep 2017 10:57:37 +0200	[thread overview]
Message-ID: <20170905105737.6c1df601@bahia> (raw)
In-Reply-To: <75f2f6f9-7d23-dced-6920-4b0be04876b9@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]

On Tue, 5 Sep 2017 10:28:02 +0200
Pradeep Jagadeesh <pradeep.jagadeesh@huawei.com> wrote:

> On 9/5/2017 9:53 AM, Alberto Garcia wrote:
> > On Mon 04 Sep 2017 06:07:47 PM CEST, Pradeep Jagadeesh wrote:
> >  
> >> +void hmp_info_fsdev_iothrottle(Monitor *mon, const QDict *qdict)
> >> +{
> >> +    Error *err = NULL;
> >> +    IOThrottleList *fsdev_list, *info;
> >> +    fsdev_list = qmp_query_fsdev_io_throttle(&err);
> >> +
> >> +    for (info = fsdev_list; info; info = info->next) {
> >> +        print_fsdev_throttle_config(mon, info->value);
> >> +    }
> >> +    qapi_free_IOThrottleList(fsdev_list);
> >> +}  
> >
> > You're passing an Error to qmp_query_fsdev_io_throttle() but then you
> > don't handle it. Use hmp_handle_error() as I said in my previous e-mail.  
> OK I will handle it.
> >
> > I know that with the current code qmp_query_fsdev_io_throttle() is never
> > going to fail, but that's no reason to declare an Error and then ignore
> > it.  
> I need to pass err because the function 
> qmp_query_fsdev_io_throttle(Error *) is created by the scripts. So, I 

It isn't created by the scripts, it is introduced by patch 5 of this series.
But yes, the generated code expects this function to have an Error ** (not
Error *) argument.

> have to declare and pass it. I do not is there any way to avoid this.
> 

If you don't care for errors (because you know that the function can't
fail), then you just need to pass NULL. But as Berto is saying, if you
do pass an non-null Error ** then you should handle it.

Cheers,

--
Greg

> -Pradeep
> >
> > Berto
> >  
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2017-09-05  8:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04 16:07 [Qemu-devel] [PATCH v10 0/6] fsdev: qmp interface for io throttling Pradeep Jagadeesh
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 1/6] throttle: factor out duplicate code Pradeep Jagadeesh
2017-09-06  9:49   ` Greg Kurz
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 2/6] qmp: Create IOThrottle structure Pradeep Jagadeesh
2017-09-08  9:37   ` Markus Armbruster
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 3/6] throttle: move out function to reuse the code Pradeep Jagadeesh
2017-09-08 12:27   ` Greg Kurz
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 4/6] hmp: create a throttle initialization function for code reusability Pradeep Jagadeesh
2017-09-05 12:03   ` Alberto Garcia
2017-09-08 12:31   ` Greg Kurz
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 5/6] fsdev: QMP interface for throttling Pradeep Jagadeesh
2017-09-08 10:02   ` Markus Armbruster
2017-09-08 11:33     ` Alberto Garcia
2017-09-08 12:51       ` Markus Armbruster
2017-09-08 12:19     ` Pradeep Jagadeesh
2017-09-08 12:34       ` Markus Armbruster
2017-09-08 12:49         ` Pradeep Jagadeesh
2017-09-11  9:23         ` Pradeep Jagadeesh
2017-09-04 16:07 ` [Qemu-devel] [PATCH v10 6/6] fsdev: hmp " Pradeep Jagadeesh
2017-09-05  7:53   ` Alberto Garcia
2017-09-05  8:28     ` Pradeep Jagadeesh
2017-09-05  8:57       ` Greg Kurz [this message]
2017-09-05  9:07       ` Alberto Garcia
2017-09-05  9:13         ` Pradeep Jagadeesh
2017-09-05  9:34           ` Alberto Garcia
2017-09-05  9:36             ` Pradeep Jagadeesh
2017-09-05 17:57   ` Dr. David Alan Gilbert
2017-09-05 21:19 ` [Qemu-devel] [PATCH v10 0/6] fsdev: qmp interface for io throttling Eric Blake
2017-09-06 10:12   ` Pradeep Jagadeesh

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=20170905105737.6c1df601@bahia \
    --to=groug@kaod.org \
    --cc=berto@igalia.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jani.kokkonen@huawei.com \
    --cc=pradeep.jagadeesh@huawei.com \
    --cc=pradeepkiruvale@gmail.com \
    --cc=qemu-devel@nongnu.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 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.