[libvirt] [PATCH v2 17/23] conf: convert over to use GRegex for regular expressions

Daniel P. Berrangé berrange at redhat.com
Thu Oct 10 10:48:23 UTC 2019


On Wed, Oct 09, 2019 at 10:08:32AM +0200, Bjoern Walk wrote:
> Daniel P. Berrangé <berrange at redhat.com> [2019-10-07, 06:14PM +0100]:
> > @@ -2306,20 +2304,17 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn,
> >          return -1;
> >      data->flags = flags;
> >      if (event && flags != -1) {
> > -        int rflags = REG_NOSUB;
> > -
> > -        if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE)
> > -            rflags |= REG_ICASE;
> >          if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX) {
> > -            int err = regcomp(&data->regex, event, rflags);
> > +            int cflags = 0;
> 
> Do we want to use G_REGEX_OPTIMIZE here?

Yes, makes sense for this one as we compile it once and then us it
to match every single event emitted on every guest. So the optimization
cost will be mitigated by improved matching performance.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list