[libvirt] [PATCH] test_driver: virDomainGetPerfEvents
Ilias Stamatis
stamatis.iliass at gmail.com
Mon Jul 1 13:58:25 UTC 2019
On Mon, Jul 1, 2019 at 3:55 PM Erik Skultety <eskultet at redhat.com> wrote:
>
> On Fri, Jun 28, 2019 at 09:38:30PM +0200, Ilias Stamatis wrote:
> > On Fri, Jun 28, 2019 at 6:15 PM Ilias Stamatis
> > <stamatis.iliass at gmail.com> wrote:
>
> the subject should say "Implement <function>"
Right. I do that always, just this time it slipped.
>
> > >
> > > Signed-off-by: Ilias Stamatis <stamatis.iliass at gmail.com>
> > > ---
> > > src/test/test_driver.c | 48 ++++++++++++++++++++++++++++++++++++++++++
> > > 1 file changed, 48 insertions(+)
> > >
> > > diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> > > index 4b1f2724a0..215171839c 100755
> > > --- a/src/test/test_driver.c
> > > +++ b/src/test/test_driver.c
> > > @@ -3293,6 +3293,53 @@ static int testDomainGetDiskErrors(virDomainPtr dom,
> > > return ret;
> > > }
> > >
> > > +
> > > +static int
> > > +testDomainGetPerfEvents(virDomainPtr dom,
> > > + virTypedParameterPtr *params,
> > > + int *nparams,
> > > + unsigned int flags)
> > > +{
> > > + virDomainObjPtr vm = NULL;
> > > + virDomainDefPtr def = NULL;
> > > + virTypedParameterPtr par = NULL;
> > > + size_t i;
> > > + int maxpar = 0;
> > > + int npar = 0;
> > > + int ret = -1;
> > > +
> > > + virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
> > > + VIR_DOMAIN_AFFECT_CONFIG |
> > > + VIR_TYPED_PARAM_STRING_OKAY, -1);
> > > +
> > > + if (!(vm = testDomObjFromDomain(dom)))
> > > + goto cleanup;
> > > +
> > > + if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
> > > + goto cleanup;
> >
> > Actually calling this function here is redundant since it is called
> > also by virDomainObjGetOneDef just in the next line. So it can be
> > removed before merging.
>
> Hmm, good catch, looking at the code I don't see a reason for it either. I'll
> drop the call before merging.
>
> Reviewed-by: Erik Skultety <eskultet at redhat.com>
>
> >
> > This redundant call is also done in the implementation of the same API
> > from the QEMU driver, so it could probably be safely removed from
> > there as well.
>
> Care to send a patch for QEMU as well?
>
Sure, I will. I just wanted to see if you agreed.
Thanks,
Ilias
> Erik
More information about the libvir-list
mailing list