mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
nodedev: driver: Create a generic mdevctl command translator
Currently there are dedicated wrappers to construct mdevctl command. These are mostly fine except for the one that translates both "start" and "define" commands, only because mdevctl takes the same set of arguments. Instead, keep the wrappers, but let them call a single global translator that handles all the mdevctl command differences and commonalities. Signed-off-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
committed by
Jonathon Jongsma
parent
92fdc1f0cb
commit
87b31fe8a2
@@ -115,7 +115,7 @@ testMdevctlCreateOrDefineHelper(const void *data)
|
||||
mdevxml, cmdlinefile, jsonfile);
|
||||
}
|
||||
|
||||
typedef virCommand* (*GetStopUndefineCmdFunc)(const char *uuid, char **errbuf);
|
||||
typedef virCommand* (*GetStopUndefineCmdFunc)(virNodeDeviceDef *def, char **errbuf);
|
||||
struct UuidCommandTestInfo {
|
||||
const char *filename;
|
||||
virMdevctlCommand command;
|
||||
@@ -136,7 +136,7 @@ testMdevctlUuidCommand(GetStopUndefineCmdFunc func,
|
||||
if (!(def = virNodeDeviceDefParseFile(mdevxml, EXISTING_DEVICE, "QEMU")))
|
||||
goto cleanup;
|
||||
|
||||
cmd = func(def->caps->data.mdev.uuid, &errmsg);
|
||||
cmd = func(def, &errmsg);
|
||||
|
||||
if (!cmd)
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user