提交 416814e6 编写于 作者: G Guannan Ren 提交者: Eric Blake

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()
上级 0c97dc41
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册