[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] libxl: fix handling of returns in libxl_get_version_info()
On Fri, 2016-02-12 at 12:31 +0000, Wei Liu wrote: > On Fri, Feb 12, 2016 at 05:00:40PM +0530, Harmandeep Kaur wrote: > >Â > > +ÂÂÂÂinfo->xen_version_major = r >> 16; > > +ÂÂÂÂinfo->xen_version_minor = r & 0xFF; > > Â > > -ÂÂÂÂxc_version(ctx->xch, XENVER_extraversion, &u.xen_extra); > > +ÂÂÂÂr = xc_version(ctx->xch, XENVER_extraversion, &u.xen_extra); > > +ÂÂÂÂif ( r < 0 ) goto out; > > ÂÂÂÂÂinfo->xen_version_extra = libxl__strdup(NOGC, u.xen_extra); > > Â > > -ÂÂÂÂxc_version(ctx->xch, XENVER_compile_info, &u.xen_cc); > > +ÂÂÂÂr = xc_version(ctx->xch, XENVER_compile_info, &u.xen_cc); > > +ÂÂÂÂif ( r < 0 ) goto out; > > At the beginning of this function it checks if info- > >xen_version_extra > is not NULL. > > You can now get into a state where partial information is cached. > This > is buggy. > Yep, I saw this, and figured out it is not ideal. I thought that, as you say, original code was bad in this respect already, and that we should fix that independently. However... > Not that the original implementation is any better, but if you're > going > to fix it, try not to introduce new bug with your fix. :-) > > I think you can rollback the caching by freeing up any resources > before > returning. > ...you're right, it's probably simple enough to fix both issues, that we should just take the chance. So, Harmandeep, can you take care of this issue Wei is rising as well? Thanks and Regards, Dario -- <<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |