Re: [PATCH v2] qemu_tpm: Check for qemuTPMSetupEncryption() errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 22, 2022 at 16:45:58 +0100, Michal Privoznik wrote:
> Inside of qemuTPMEmulatorBuildCommand() there are two calls to
> qemuTPMSetupEncryption() which simply ignore returned error. This
> is suboptimal because then we rely on swtpm binary reporting a
> generic error (something among invalid command line arguments)
> while an error reported by qemuTPMSetupEncryption() is more
> specific.
> 
> However, since virCommandSetSendBuffer() only sets an error
> inside of virCommand structure (the error is then reported in
> virCommandRun()), we need to exempt its retval from error
> checking. Thus, the signature of qemuTPMSetupEncryption() is
> changed a bit so that -1/0 can be returned to indicate error.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
> 
> v2 of:
> 
> https://listman.redhat.com/archives/libvir-list/2022-November/235866.html
> 
> diff to v1:
> - Ignore error from virCommandSetSendBuffer() as it'll be reported
>   later. Don't actually jump onto error label as it would defeat the
>   purpose.
> 
>  src/qemu/qemu_tpm.c | 29 ++++++++++++++++++++---------
>  1 file changed, 20 insertions(+), 9 deletions(-)

Reviewed-by: Jiri Denemark <jdenemar@xxxxxxxxxx>




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux