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

Re: [Xen-devel] [PATCH v10 14/20] xen: introduce xenpv bus and a dummy pvcpu device



On 14/01/14 16:41, Julien Grall wrote:
> On 01/14/2014 02:59 PM, Roger Pau Monne wrote:
>> +static int
>> +xenpv_attach(device_t dev)
>> +{
>> +    device_t child;
>> +
>> +    if (xen_hvm_domain()) {
>> +            device_t xenpci;
>> +            devclass_t dc;
>> +
>> +            /* Make sure xenpci has been attached */
>> +            dc = devclass_find("xenpci");
>> +            if (dc == NULL)
>> +                    panic("unable to find xenpci devclass");
>> +
>> +            xenpci = devclass_get_device(dc, 0);
>> +            if (xenpci == NULL)
>> +                    panic("unable to find xenpci device");
>> +
>> +            if (!device_is_attached(xenpci))
>> +                    panic("trying to attach xenpv before xenpci");
>> +    }
> 
> Can you use the identify method to add the xenpci device?

I don't think so, xenpci is a pci device, it is detected and plugged by
the pci bus code.

> As I said earlier, I will reuse this code for ARM guest and this device
> is not used on this architecture.

You could move this chunk of code (the check for xenpci) to a static
inline function and make it a noop for ARM.


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


 


Rackspace

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