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

Re: [Xen-devel] [PATCH] xen: use vMSI related #define-s from public interface



On Thu, 21 Sep 2017, Jan Beulich wrote:
> >>> On 21.09.17 at 03:12, <sstabellini@xxxxxxxxxx> wrote:
> > On Fri, 1 Sep 2017, Jan Beulich wrote:
> >> --- a/hw/xen/xen_pt_msi.c
> >> +++ b/hw/xen/xen_pt_msi.c
> >> @@ -18,6 +18,11 @@
> >>  
> >>  #define XEN_PT_AUTO_ASSIGN -1
> >>  
> >> +#ifndef XEN_DOMCTL_VMSI_X86_DEST_ID_MASK
> >> +#if XEN_DOMCTL_INTERFACE_VERSION >= 0x0000000e
> >> +#error vMSI defines missing from domctl.h
> >> +#endif
> > 
> > All the version compatibility stuff goes to
> > include/hw/xen/xen_common.h. Please move it there.
> 
> I know there's a central place, but moving there stuff that's
> needed only in this file seemed rather counterproductive to
> me - why would you want all files including that shared one
> have to see these definitions? If there was a remote chance
> that some other file may need to make use of it, I might
> agree, but I don't see any such chance at all.

Basically, xen_common.h is meant to supply all definitions and
declarations that should already be part of the Xen interface, but
because of versioning, they are not.

Xen headers + xen_common.h = all declarations and definitions

So far, we haven't distinguished based on how many users of a given
missing functions exist in QEMU. Simply, xen_common.h fills all gaps.
One day, xen_common.h could become a set of header files, so that in
cases such as this, one can only import the compat header file that she
needs. But today we only have one compat header in QEMU.


> > We usually assume that the Xen version we are building against is
> > "sane", so we don't do #error's typically.
> 
> Hmm, I can drop the #error, but to be honest I'm hesitant to do
> so - I've put it there intentionally.

It is difficult to draw the line when an #error is needed and when it is
not. I am just trying to be consistent. Why do you think we should have
it in this specific case? Do you think we cannot make correct
assumptions based on the XEN_DOMCTL_INTERFACE_VERSION only or the Xen
version? If so, please explain.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.