[PATCH 3/8] hyperv: break out common lookups into separate functions

Pino Toscano ptoscano at redhat.com
Mon Oct 5 05:39:04 UTC 2020

On Friday, 2 October 2020 23:50:22 CEST Matt Coleman wrote:
> On Oct 2, 2020, at 2:25 AM, Pino Toscano <ptoscano at redhat.com> wrote:
> > Note that now hypervGetVirtualSystemByID() issues VIR_ERR_INTERNAL_ERROR
> > in case &computerSystem / *computerSystemList is null, instead of
> > VIR_ERR_NO_DOMAIN. Shouldn't this still be able to explicitly report
> > when the requested domain does not exist?
> I’ll split it up into two conditionals. Would you prefer to see the NULL 
> check that produces the VIR_ERR_NO_DOMAIN error in the new helper 
> function (hypervGetVirtualSystemByID) or its caller 
> (hypervDomainLookupByID)?

This depends on the callers: if the logic for checking whether a domain
is considered "not already existing" makes sense for all the callers of
hypervGetVirtualSystemByID, then I'd say to add it there.

Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20201005/ca0953be/attachment-0001.sig>

More information about the libvir-list mailing list