[PATCH 2/2] qemu: Validate TPM TIS device

Jim Fehlig jfehlig at suse.com
Thu Feb 11 15:44:33 UTC 2021


On 2/11/21 3:37 AM, Andrea Bolognani wrote:
> On Wed, 2021-02-10 at 10:34 -0700, Jim Fehlig wrote:
>> I aslo worry about future architectures gaining support
>> for emulated TPM TIS devices.
> 
> It's okay to be conservative - we can always relax the check later.
> 
>> +        if (!ARCH_IS_X86(def->os.arch) && (def->os.arch != VIR_ARCH_AARCH64)) {
>> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>> +                           _("TPM model %s is only available for "
>> +                             "x86 and aarch64 guests"),
> 
> Please don't split the error message into two separate lines

I'm surprised that slipped through my copy and paste since I've always preferred 
errors on one line for easy searching. We have a lot of split error messages 
throughout the code. This file is particularly bad. Is there any desire to fix 
existing cases, or just avoid new ones?

> and sprinkle some quotes around '%s' while you're at it.

Will do.

> https://libvirt.org/coding-style.html#error-message-format

The entire page is worth a re-read on occasion :-)

Regards,
Jim




More information about the libvir-list mailing list