WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH v2] pv-ops: register xen pci notifier

To: Weidong Han <weidong.han@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH v2] pv-ops: register xen pci notifier
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 29 Jul 2009 10:02:35 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Keir.Fraser@xxxxxxxxxxxxx, jbarnes@xxxxxxxxxxxxxxxx
Delivery-date: Wed, 29 Jul 2009 10:03:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1248835104-5875-1-git-send-email-weidong.han@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1248835104-5875-1-git-send-email-weidong.han@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2
On 07/28/09 19:38, Weidong Han wrote:
> Register the notifier to handle hot-plug devices and SR-IOV devices
> for Xen hypervisor. When a device is hot added or removed, it adds
> or removes it to Xen via hypercalls.
>
> Changes in v2:
> Remove inline #ifdef and the awkward dangling else/#endif construction,
> and rather than using memset, use variable declaration and initializer
> to assign the elements in xen_add_device.
>   

That looks much better.  Just one tiny nit:

> +
> +     if (HANDLE_PCI_IOV && pci_dev->is_virtfn) {
> +             struct physdev_manage_pci_ext manage_pci_ext = {
> +                     .bus            = pci_dev->bus->number,
> +                     .devfn          = pci_dev->devfn,
> +                     .is_extfn       = 0,
> +                     .is_virtfn      = 1,
> +                     .physfn.bus     = pci_dev->physfn->bus->number,
> +                     .physfn.devfn   = pci_dev->physfn->devfn,
> +             };
> +
> +             r = HYPERVISOR_physdev_op(PHYSDEVOP_manage_pci_add_ext,
> +                     &manage_pci_ext);
> +     } else if (pci_ari_enabled(pci_dev->bus) && PCI_SLOT(pci_dev->devfn)) {
> +             struct physdev_manage_pci_ext manage_pci_ext = {
> +                     .bus            = pci_dev->bus->number,
> +                     .devfn          = pci_dev->devfn,
> +                     .is_extfn       = 1,
> +                     .is_virtfn      = 0,
> +                     .physfn.bus     = 0,
> +                     .physfn.devfn   = 0,
>   

It isn't necessarily to explicitly initialize elements to 0; that will
happen implicitly as a result of using an initializer.

Thanks,
    J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>