int exitstatus = 0;
g_autofree char *error = NULL;
- g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM, "--mode",
- "session", NULL);
+ g_autoptr(virCommand) cmd = virCommandNewArgList("iscsiadm", "--mode",
+ "session", NULL);
virCommandSetErrorBuffer(cmd, &error);
if (virCommandRunRegex(cmd,
g_autofree char *outbuf = NULL;
g_autofree char *iface = NULL;
g_autofree char *iqn = NULL;
- g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM,
- "--mode", "iface", NULL);
+ g_autoptr(virCommand) cmd = virCommandNewArgList("iscsiadm",
+ "--mode", "iface", NULL);
*ifacename = NULL;
error:
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("malformed output of %1$s: %2$s"),
- ISCSIADM, line);
+ _("malformed output of 'iscsiadm': %1$s"),
+ line);
goto cleanup;
}
VIR_DEBUG("Attempting to create interface '%s' with IQN '%s'",
temp_ifacename, initiatoriqn);
- newcmd = virCommandNewArgList(ISCSIADM,
+ newcmd = virCommandNewArgList("iscsiadm",
"--mode", "iface",
"--interface", temp_ifacename,
"--op", "new",
* We will just rely on whether the interface got created
* properly. */
if (virCommandRun(newcmd, &exitstatus) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to run command '%1$s' to create new iscsi interface"),
- ISCSIADM);
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Failed to run command 'iscsiadm' to create new iscsi interface"));
return -1;
}
- updatecmd = virCommandNewArgList(ISCSIADM,
+ updatecmd = virCommandNewArgList("iscsiadm",
"--mode", "iface",
"--interface", temp_ifacename,
"--op", "update",
* rely on whether iface file got updated properly. */
if (virCommandRun(updatecmd, &exitstatus) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to run command '%1$s' to update iscsi interface with IQN '%2$s'"),
- ISCSIADM, initiatoriqn);
+ _("Failed to run command 'iscsiadm' to update iscsi interface with IQN '%1$s'"),
+ initiatoriqn);
return -1;
}
const char **extraargv)
{
const char *const baseargv[] = {
- ISCSIADM,
+ "iscsiadm",
"--mode", "node",
"--portal", portal,
"--targetname", target,
int
virISCSIRescanLUNs(const char *session)
{
- g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM,
- "--mode", "session",
- "-r", session,
- "-R",
- NULL);
+ g_autoptr(virCommand) cmd = virCommandNewArgList("iscsiadm",
+ "--mode", "session",
+ "-r", session,
+ "-R",
+ NULL);
return virCommandRun(cmd, NULL);
}
int vars[] = { 2 };
struct virISCSITargetList list = { 0 };
size_t i;
- g_autoptr(virCommand) cmd = virCommandNewArgList(ISCSIADM,
- "--mode", "discovery",
- "--type", "sendtargets",
- "--portal", portal,
- NULL);
+ g_autoptr(virCommand) cmd = virCommandNewArgList("iscsiadm",
+ "--mode", "discovery",
+ "--type", "sendtargets",
+ "--portal", portal,
+ NULL);
if (!persist) {
virCommandAddArgList(cmd,
g_autoptr(virCommand) cmd = NULL;
int status;
- cmd = virCommandNewArgList(ISCSIADM,
+ cmd = virCommandNewArgList("iscsiadm",
"--mode", "node",
"--portal", portal,
"--targetname", target,
if (status != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("%1$s failed new mode for target '%2$s' with status '%3$d'"),
- ISCSIADM, target, status);
+ _("'iscsiadm': failed new mode for target '%1$s' with status '%2$d'"),
+ target, status);
return -1;
}
g_autoptr(virCommand) cmd = NULL;
int status;
- cmd = virCommandNewArgList(ISCSIADM,
+ cmd = virCommandNewArgList("iscsiadm",
"--mode", "node",
"--portal", portal,
"--target", target,
{
struct testIscsiadmCbData *data = opaque;
- if (args[0] && STREQ(args[0], ISCSIADM) &&
+ if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "session") &&
args[3] == NULL) {
*output = g_strdup(iscsiadmSessionOutputNonFlash);
else
*output = g_strdup(iscsiadmSessionOutput);
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "discovery") &&
args[3] && STREQ(args[3], "--type") &&
args[8] && STREQ(args[8], "nonpersistent") &&
args[9] == NULL) {
*output = g_strdup(iscsiadmSendtargetsOutput);
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "node") &&
args[3] && STREQ(args[3], "--portal") &&
* target: iqn.2004-06.example:example1:iscsi.test, \
* portal: 10.20.30.40:3260,1] successful.
*/
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "iface") &&
args[3] == NULL) {
*output = g_strdup(iscsiadmIfaceIfaceOutput);
else
*output = g_strdup(iscsiadmIfaceDefaultOutput);
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "iface") &&
args[3] && STREQ(args[3], "--interface") &&
* New interface libvirt-iface-03020100 added
*/
data->iface_created = true;
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "iface") &&
args[3] && STREQ(args[3], "--interface") &&
*
* libvirt-iface-03020100 updated.
*/
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "discovery") &&
args[3] && STREQ(args[3], "--type") &&
args[9] == NULL &&
data->iface_created) {
*output = g_strdup(iscsiadmSendtargetsOutput);
- } else if (args[0] && STREQ(args[0], ISCSIADM) &&
+ } else if (args[0] && STREQ(args[0], "iscsiadm") &&
args[1] && STREQ(args[1], "--mode") &&
args[2] && STREQ(args[2], "node") &&
args[3] && STREQ(args[3], "--portal") &&