mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
nodedev: capture and report stderror from mdevctl
When an mdevctl command fails, there is not much information available to the user about why it failed. This is partly because we were not making use of the error message that mdevctl itself prints upon failure. Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
@@ -58,6 +58,7 @@ testMdevctlStart(const char *virt_type,
|
||||
const char *actualCmdline = NULL;
|
||||
int ret = -1;
|
||||
g_autofree char *uuid = NULL;
|
||||
g_autofree char *errmsg = NULL;
|
||||
g_autofree char *stdinbuf = NULL;
|
||||
g_autoptr(virCommand) cmd = NULL;
|
||||
|
||||
@@ -66,7 +67,7 @@ testMdevctlStart(const char *virt_type,
|
||||
|
||||
/* this function will set a stdin buffer containing the json configuration
|
||||
* of the device. The json value is captured in the callback above */
|
||||
cmd = nodeDeviceGetMdevctlStartCommand(def, &uuid);
|
||||
cmd = nodeDeviceGetMdevctlStartCommand(def, &uuid, &errmsg);
|
||||
|
||||
if (!cmd)
|
||||
goto cleanup;
|
||||
@@ -117,11 +118,12 @@ testMdevctlStop(const void *data)
|
||||
const char *actualCmdline = NULL;
|
||||
int ret = -1;
|
||||
g_autoptr(virCommand) cmd = NULL;
|
||||
g_autofree char *errmsg = NULL;
|
||||
g_autofree char *cmdlinefile =
|
||||
g_strdup_printf("%s/nodedevmdevctldata/mdevctl-stop.argv",
|
||||
abs_srcdir);
|
||||
|
||||
cmd = nodeDeviceGetMdevctlStopCommand(uuid);
|
||||
cmd = nodeDeviceGetMdevctlStopCommand(uuid, &errmsg);
|
||||
|
||||
if (!cmd)
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user