>>> On 16.10.17 at 15:46, <chao....@intel.com> wrote: > On Mon, Oct 16, 2017 at 08:26:09AM -0600, Jan Beulich wrote: >>>>> On 16.10.17 at 15:13, <chao....@intel.com> wrote: >>> On Mon, Oct 16, 2017 at 07:15:16AM -0600, Jan Beulich wrote: >>>>>>> On 13.10.17 at 07:10, <chao....@intel.com> wrote: >>>>> --- a/xen/arch/x86/hvm/irq.c >>>>> +++ b/xen/arch/x86/hvm/irq.c >>>>> @@ -168,11 +168,13 @@ void hvm_gsi_deassert(struct domain *d, unsigned >>>>> int > gsi) >>>>> spin_unlock(&d->arch.hvm_domain.irq_lock); >>>>> } >>>>> >>>>> -void hvm_isa_irq_assert( >>>>> - struct domain *d, unsigned int isa_irq) >>>>> +int hvm_isa_irq_assert(struct domain *d, unsigned int isa_irq, >>>>> + int (*get_vector)(const struct domain *d, >>>>> + unsigned int gsi)) >>>>> { >>>>> struct hvm_irq *hvm_irq = hvm_domain_irq(d); >>>>> unsigned int gsi = hvm_isa_irq_to_gsi(isa_irq); >>>>> + int vector = 0; >>>> >>>>Why zero (which is valid aiui) instead of e.g. -1? >>> >>> vector also serves as the return value. I want to return 0 if no >>> callback is set. And the callback, get_vector, can override the return >>> value. Do you think it is reasonable? >> >>Why "also" - being the return value is the only purpose of "vector". >>And as said - zero is a valid vector, and I wouldn't like to see the >>function return a valid but meaningless vector number. > > But if no callback is set, would it be a little weird to return -1 which > always means failure?
To me, -1 doesn't mean "failure" here, but "no valid vector". Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel