[--source-protocol protocol] [--source-host-name hostname:port]
[--source-host-transport transport] [--source-host-socket socket]
[--serial serial] [--wwn wwn] [--rawio] [--address address]
- [--multifunction] [--print-xml]
+ [--multifunction] [--print-xml] [--throttle-groups groups]
Attach a new disk device to the domain.
*source* is path for the files and devices unless *--source-protocol*
ccw:cssid.ssid.devno. Virtio-ccw devices must have their cssid set to 0xfe.
*multifunction* indicates specified pci address is a multifunction pci device
address.
+*throttle-groups* is comma separated list of throttle groups to be applied.
There is also support for using a network disk. As specified, the user can
provide a *--source-protocol* in which case the *source* parameter will
}
+char **
+virshDomainThrottleGroupsCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int completeflags G_GNUC_UNUSED)
+{
+ const char *curval = NULL;
+ g_auto(GStrv) groups = virshDomainThrottleGroupCompleter(ctl, cmd, 0);
+
+ if (vshCommandOptStringQuiet(ctl, cmd, "throttle-groups", &curval) < 0)
+ return NULL;
+
+ if (!groups)
+ return NULL;
+
+ return virshCommaStringListComplete(curval, (const char **) groups);
+}
+
+
char **
virshDomainUndefineStorageDisksCompleter(vshControl *ctl,
const vshCmd *cmd,
.type = VSH_OT_STRING,
.help = N_("host socket for source of disk device")
},
+ {.name = "throttle-groups",
+ .type = VSH_OT_STRING,
+ .completer = virshDomainThrottleGroupsCompleter,
+ .help = N_("comma separated list of throttle groups to be applied")
+ },
VIRSH_COMMON_OPT_DOMAIN_PERSISTENT,
VIRSH_COMMON_OPT_DOMAIN_CONFIG,
VIRSH_COMMON_OPT_DOMAIN_LIVE,
const char *host_name = NULL;
const char *host_transport = NULL;
const char *host_socket = NULL;
+ const char *throttle_groups_str = NULL;
int ret;
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
const char *stype = NULL;
vshCommandOptString(ctl, cmd, "source-protocol", &source_protocol) < 0 ||
vshCommandOptString(ctl, cmd, "source-host-name", &host_name) < 0 ||
vshCommandOptString(ctl, cmd, "source-host-transport", &host_transport) < 0 ||
- vshCommandOptString(ctl, cmd, "source-host-socket", &host_socket) < 0)
+ vshCommandOptString(ctl, cmd, "source-host-socket", &host_socket) < 0 ||
+ vshCommandOptString(ctl, cmd, "throttle-groups", &throttle_groups_str) < 0)
return false;
if (stype &&
virBufferAsprintf(&diskChildBuf, " bus='%s'", targetbus);
virBufferAddLit(&diskChildBuf, "/>\n");
+ if (throttle_groups_str) {
+ g_auto(GStrv) throttle_groups = g_strsplit(throttle_groups_str, ",", 0);
+ g_auto(virBuffer) throttleChildBuf = VIR_BUFFER_INIT_CHILD(&diskChildBuf);
+ char **iter;
+ for (iter = throttle_groups; *iter != NULL; iter++) {
+ g_auto(virBuffer) throttleAttrBuf = VIR_BUFFER_INITIALIZER;
+ virBufferAsprintf(&throttleAttrBuf, " group='%s'", *iter);
+ virXMLFormatElement(&throttleChildBuf, "throttlefilter", &throttleAttrBuf, NULL);
+ }
+ virXMLFormatElement(&diskChildBuf, "throttlefilters", NULL, &throttleChildBuf);
+ }
+
if (mode)
virBufferAsprintf(&diskChildBuf, "<%s/>\n", mode);