mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
api: add virNodeDeviceCreate()
This new API function provides a way to start a persistently-defined mediate device that was defined by virNodeDeviceDefineXML() (or one that was defined externally via mdevctl) Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
@@ -14,7 +14,8 @@ typedef enum {
|
||||
MDEVCTL_CMD_START,
|
||||
MDEVCTL_CMD_STOP,
|
||||
MDEVCTL_CMD_DEFINE,
|
||||
MDEVCTL_CMD_UNDEFINE
|
||||
MDEVCTL_CMD_UNDEFINE,
|
||||
MDEVCTL_CMD_CREATE,
|
||||
} MdevctlCmd;
|
||||
|
||||
struct startTestInfo {
|
||||
@@ -188,6 +189,9 @@ testMdevctlUuidCommandHelper(const void *data)
|
||||
} else if (info->command == MDEVCTL_CMD_UNDEFINE) {
|
||||
cmd = "undefine";
|
||||
func = nodeDeviceGetMdevctlUndefineCommand;
|
||||
}else if (info->command == MDEVCTL_CMD_CREATE) {
|
||||
cmd = "create";
|
||||
func = nodeDeviceGetMdevctlCreateCommand;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
@@ -429,6 +433,9 @@ mymain(void)
|
||||
#define DO_TEST_UNDEFINE(uuid) \
|
||||
DO_TEST_UUID_COMMAND_FULL("mdevctl undefine " uuid, uuid, MDEVCTL_CMD_UNDEFINE)
|
||||
|
||||
#define DO_TEST_CREATE(uuid) \
|
||||
DO_TEST_UUID_COMMAND_FULL("mdevctl create " uuid, uuid, MDEVCTL_CMD_CREATE)
|
||||
|
||||
#define DO_TEST_LIST_DEFINED() \
|
||||
DO_TEST_FULL("mdevctl list --defined", testMdevctlListDefined, NULL)
|
||||
|
||||
@@ -453,6 +460,8 @@ mymain(void)
|
||||
|
||||
DO_TEST_UNDEFINE("d76a6b78-45ed-4149-a325-005f9abc5281");
|
||||
|
||||
DO_TEST_CREATE("8a05ad83-3472-497d-8631-8142f31460e8");
|
||||
|
||||
done:
|
||||
nodedevTestDriverFree(driver);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user