Author: dexuan
Date: Wed Jun 14 13:23:40 2017
New Revision: 319941
URL: https://svnweb.freebsd.org/changeset/base/319941

Log:
  MFC: 319690
  
  r319690
        hyperv/pcib: use the device serial number as PCI domain
  
        Currently the PCI domain is initialized with the instance GUID in
        vmbus_pcib_attach(). It turns out the GUID can change across VM reboot,
        while some users want a persistent value for PCI domain. The solution is
        that we can change to use the device serial number, which starts with 1
        and is unique within a VM.
  
        Obtained from:  Haiyang Zhang
        Sponsored by:   Microsoft

Modified:
  stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c
==============================================================================
--- stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c  Wed Jun 14 08:01:53 2017        
(r319940)
+++ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c  Wed Jun 14 13:23:40 2017        
(r319941)
@@ -574,6 +574,8 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci
        hpdev->desc = *desc;
 
        mtx_lock(&hbus->device_list_lock);
+       if (TAILQ_EMPTY(&hbus->children))
+               hbus->pci_domain = desc->ser & 0xFFFF;
        TAILQ_INSERT_TAIL(&hbus->children, hpdev, link);
        mtx_unlock(&hbus->device_list_lock);
        return (hpdev);
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to