Re: [PATCH RESEND kvmtool 2/4] Replace printf/fprintf with pr_* macros

Jean-Philippe Brucker
2023-07-07T14:21:08Z

On Fri, Jul 07, 2023 at 02:29:12PM +0100, Alexandru Elisei wrote:
> > > - if (current_kvm_cpu->kvm_run->exit_reason == KVM_EXIT_UNKNOWN)
> > > - fprintf(stderr, "KVM exit code: 0x%llu\n",
> > > +
> > > + if (current_kvm_cpu->kvm_run->exit_reason == KVM_EXIT_UNKNOWN) {
> > > + pr_err("KVM exit code: 0x%llu",
> >
> > Not your change but 0x%llu is wrong, it could be fixed here
>
> Not sure what you mean, hardware_exit_reason is an u64, and it's cast to an
> unsigned long long to avoid printf format specifier warnings.
>
> And as far as I know, unsigned long long is at least 64bits according to
> C99 (the only reference I was able to quickly find is LLONG_MIN being
> defined as -(2^63 - 1)).

Sorry I meant the 0x prefix is wrong because we're printing a decimal
number, not hexadecimal

Thanks,
Jean