> > + if (VIR_CLOSE(vpdFileFd) < 0) {
> > + virReportSystemError(errno, _("Unable to close the VPD file, fd:
> > %d"), vpdFileFd);
> > + return NULL;
> > + }
>
> This is closing an FD that is owned & passed in by the caller. I'd
> consider that an undesirable pattern. Whomever opens an FD should
> generally take responsiiblity for closing it too, as that gives
> clear semantics on state of the FD, when this method returns an
> error state.
Makes sense, I'll rework it to have the FD closed in caller functions.