mirror of https://gitee.com/openkylin/libvirt.git
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>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Scott Moser <smoser@ubuntu.com>
|
||||
Guannan Ren <gren@redhat.com>
|
||||
|
||||
[....send patches to get your name here....]
|
||||
|
||||
|
|
|
@ -801,6 +801,7 @@ pciDeviceListFree;
|
|||
pciDeviceListGet;
|
||||
pciDeviceListNew;
|
||||
pciDeviceListSteal;
|
||||
pciDeviceReAttachInit;
|
||||
pciDeviceSetManaged;
|
||||
pciFreeDevice;
|
||||
pciGetDevice;
|
||||
|
|
|
@ -7197,6 +7197,8 @@ qemudNodeDeviceReAttach (virNodeDevicePtr dev)
|
|||
if (!pci)
|
||||
return -1;
|
||||
|
||||
pciDeviceReAttachInit(pci);
|
||||
|
||||
qemuDriverLock(driver);
|
||||
if (pciReAttachDevice(pci, driver->activePciHostdevs) < 0)
|
||||
goto out;
|
||||
|
|
|
@ -1382,6 +1382,14 @@ unsigned pciDeviceGetManaged(pciDevice *dev)
|
|||
return dev->managed;
|
||||
}
|
||||
|
||||
void pciDeviceReAttachInit(pciDevice *pci)
|
||||
{
|
||||
pci->unbind_from_stub = 1;
|
||||
pci->remove_slot = 1;
|
||||
pci->reprobe = 1;
|
||||
}
|
||||
|
||||
|
||||
pciDeviceList *
|
||||
pciDeviceListNew(void)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@ int pciResetDevice (pciDevice *dev,
|
|||
void pciDeviceSetManaged(pciDevice *dev,
|
||||
unsigned managed);
|
||||
unsigned pciDeviceGetManaged(pciDevice *dev);
|
||||
void pciDeviceReAttachInit(pciDevice *dev);
|
||||
|
||||
pciDeviceList *pciDeviceListNew (void);
|
||||
void pciDeviceListFree (pciDeviceList *list);
|
||||
|
|
Loading…
Reference in New Issue