[libvirt] [PATCH 2/4] qemu: command: Don't bother reporting errors in smbios formatters

Peter Krempa pkrempa at redhat.com
Fri Oct 14 01:59:42 UTC 2016


On Thu, Oct 13, 2016 at 17:11:54 -0400, John Ferlan wrote:
> 
> 
> On 10/10/2016 11:51 AM, Peter Krempa wrote:
> > qemuBuildSmbiosBiosStr and qemuBuildSmbiosSystemStr return NULL if
> > there's noting to format on the commandline. Reporting errors from
> 
> nothing
> 
> > buffer creation doesn't make sense since it would be ignored.
> 
> Introduced by 54c0237ccb, so it's been this way a long time...
> 
> > ---
> >  src/qemu/qemu_command.c | 14 --------------
> >  1 file changed, 14 deletions(-)
> > 
> 
> I suppose since it seems the only legitimate error you'll hit is ENOMEM
> and if you ignore it here, some shortly to be run code is sure to run
> into it, then no big deal...
> 
> Although, one could argue the callers should check/return on error, but
> they'd probably lose that argument.

Not really :). I thought the same when writing the patch as it's fully
possible although extremely unlikely that we'd start a VM with invalid
configuration. Given that we were doing it like this for quite some
while and it would require a more invasive refactoring of the code I
just decided to drop the code altogether.

> ACK for what's here

Thanks, I'll go with this version currently, since it keeps the
semantics present for a rather long time.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161014/5e3967fc/attachment-0001.sig>


More information about the libvir-list mailing list