mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 12:35:20 +00:00
pci: initialize state values on reattach
add a new API pciDeviceReAttachInit() in pci.c to initialize state values for nodedev reattach Initialize three state value of device driver to 1. This is just for a new call to qemudNodeDeviceReAttach()
This commit is contained in:
parent
0c97dc4159
commit
416814e66a
1
AUTHORS
1
AUTHORS
@ -180,6 +180,7 @@ Patches have also been contributed by:
|
|||||||
David S. Wang <dwang2@cisco.com>
|
David S. Wang <dwang2@cisco.com>
|
||||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||||
Scott Moser <smoser@ubuntu.com>
|
Scott Moser <smoser@ubuntu.com>
|
||||||
|
Guannan Ren <gren@redhat.com>
|
||||||
|
|
||||||
[....send patches to get your name here....]
|
[....send patches to get your name here....]
|
||||||
|
|
||||||
|
@ -801,6 +801,7 @@ pciDeviceListFree;
|
|||||||
pciDeviceListGet;
|
pciDeviceListGet;
|
||||||
pciDeviceListNew;
|
pciDeviceListNew;
|
||||||
pciDeviceListSteal;
|
pciDeviceListSteal;
|
||||||
|
pciDeviceReAttachInit;
|
||||||
pciDeviceSetManaged;
|
pciDeviceSetManaged;
|
||||||
pciFreeDevice;
|
pciFreeDevice;
|
||||||
pciGetDevice;
|
pciGetDevice;
|
||||||
|
@ -7197,6 +7197,8 @@ qemudNodeDeviceReAttach (virNodeDevicePtr dev)
|
|||||||
if (!pci)
|
if (!pci)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
pciDeviceReAttachInit(pci);
|
||||||
|
|
||||||
qemuDriverLock(driver);
|
qemuDriverLock(driver);
|
||||||
if (pciReAttachDevice(pci, driver->activePciHostdevs) < 0)
|
if (pciReAttachDevice(pci, driver->activePciHostdevs) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1382,6 +1382,14 @@ unsigned pciDeviceGetManaged(pciDevice *dev)
|
|||||||
return dev->managed;
|
return dev->managed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pciDeviceReAttachInit(pciDevice *pci)
|
||||||
|
{
|
||||||
|
pci->unbind_from_stub = 1;
|
||||||
|
pci->remove_slot = 1;
|
||||||
|
pci->reprobe = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pciDeviceList *
|
pciDeviceList *
|
||||||
pciDeviceListNew(void)
|
pciDeviceListNew(void)
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@ int pciResetDevice (pciDevice *dev,
|
|||||||
void pciDeviceSetManaged(pciDevice *dev,
|
void pciDeviceSetManaged(pciDevice *dev,
|
||||||
unsigned managed);
|
unsigned managed);
|
||||||
unsigned pciDeviceGetManaged(pciDevice *dev);
|
unsigned pciDeviceGetManaged(pciDevice *dev);
|
||||||
|
void pciDeviceReAttachInit(pciDevice *dev);
|
||||||
|
|
||||||
pciDeviceList *pciDeviceListNew (void);
|
pciDeviceList *pciDeviceListNew (void);
|
||||||
void pciDeviceListFree (pciDeviceList *list);
|
void pciDeviceListFree (pciDeviceList *list);
|
||||||
|
Loading…
Reference in New Issue
Block a user