On Wednesday, December 11th, 2024 at 7:19 AM, Roger Pau Monné 
<roger....@citrix.com> wrote:

>
>
> On Thu, Dec 05, 2024 at 08:41:39PM -0800, Denis Mukhin via B4 Relay wrote:
>
> > From: Denis Mukhin dmuk...@ford.com
> >
> > Print d->arch.emulation_flags on the console for better traceability while
> > debugging in-hypervisor hardware emulators.
> >
> > Signed-off-by: Denis Mukhin dmuk...@ford.com
> > ---
> > xen/arch/x86/domain.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> > index 
> > 78a13e6812c9120901d0a70fb3bc1bd6a8b6917d..c88d422a64544531c1e1058fa484364bb4277d1e
> >  100644
> > --- a/xen/arch/x86/domain.c
> > +++ b/xen/arch/x86/domain.c
> > @@ -818,11 +818,15 @@ int arch_domain_create(struct domain *d,
> >
> > if ( !emulation_flags_ok(d, emflags) )
> > {
> > - printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation "
> > + printk(XENLOG_G_ERR "d%d: Xen does not allow %s %sdomain creation "
>
>
> gprintk(XENLOG_ERR, "...
>
> Might be more natural now that we have the macro (together with Jan's
> suggestion to use %pd (same below).
>
> > "with the current selection of emulators: %#x\n",
> > - d->domain_id, is_hvm_domain(d) ? "HVM" : "PV", emflags);
> > + d->domain_id,
> > + is_hvm_domain(d) ? "HVM" : "PV",
> > + is_hardware_domain(d) ? "(hardware) " : "",
> > + emflags);
> > return -EOPNOTSUPP;
> > }
> > + printk(XENLOG_G_INFO "d%d: emulation_flags %#x\n", d->domain_id, emflags);
>
>
> This would need to be a dprintk at least, and the log level should be
> XENLOG_DEBUG.

I moved emulation_flags printout to 'q' handler.

>
> Maybe it would be better if you could print this information as part
> of some debug key, for not having to print it for every guest
> creation. Maybe as part of the 'q' debug key?

Thank you for suggestion!
Fixed.

>
> Thanks, Roger.



Reply via email to