qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v10 6/6] fsdev: hmp interface for throttling


From: Greg Kurz
Subject: Re: [Qemu-devel] [PATCH v10 6/6] fsdev: hmp interface for throttling
Date: Tue, 5 Sep 2017 10:57:37 +0200

On Tue, 5 Sep 2017 10:28:02 +0200
Pradeep Jagadeesh <address@hidden> 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: pgp5LcoG0DTJb.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]