mirror of https://gitee.com/openkylin/libvirt.git
test: Implement virNodeDeviceIsActive
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
66e4b56016
commit
aa819be57f
|
@ -7779,6 +7779,21 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
testNodeDeviceIsActive(virNodeDevicePtr dev)
|
||||
{
|
||||
testDriver *privconn = dev->conn->privateData;
|
||||
virNodeDeviceObj *obj = NULL;
|
||||
int ret = -1;
|
||||
|
||||
if (!(obj = testNodeDeviceObjFindByName(privconn, dev->name)))
|
||||
return -1;
|
||||
|
||||
ret = virNodeDeviceObjIsActive(obj);
|
||||
virNodeDeviceObjEndAPI(&obj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* Domain event implementations */
|
||||
static int
|
||||
|
@ -10657,6 +10672,7 @@ static virNodeDeviceDriver testNodeDeviceDriver = {
|
|||
.nodeDeviceListCaps = testNodeDeviceListCaps, /* 0.7.2 */
|
||||
.nodeDeviceCreateXML = testNodeDeviceCreateXML, /* 0.7.3 */
|
||||
.nodeDeviceDestroy = testNodeDeviceDestroy, /* 0.7.3 */
|
||||
.nodeDeviceIsActive = testNodeDeviceIsActive, /* 10.3.0 */
|
||||
};
|
||||
|
||||
static virConnectDriver testConnectDriver = {
|
||||
|
|
Loading…
Reference in New Issue