virBlkioDevicePtr dev = &vm->def->blkio.devices[i];
if (dev->weight &&
(virCgroupSetBlkioDeviceWeight(priv->cgroup, dev->path,
- dev->weight) < 0))
+ dev->weight) < 0 ||
+ virCgroupGetBlkioDeviceWeight(priv->cgroup, dev->path,
+ &dev->weight) < 0))
return -1;
if (dev->riops &&
(virCgroupSetBlkioDeviceReadIops(priv->cgroup, dev->path,
- dev->riops) < 0))
+ dev->riops) < 0 ||
+ virCgroupGetBlkioDeviceReadIops(priv->cgroup, dev->path,
+ &dev->riops) < 0))
return -1;
if (dev->wiops &&
(virCgroupSetBlkioDeviceWriteIops(priv->cgroup, dev->path,
- dev->wiops) < 0))
+ dev->wiops) < 0 ||
+ virCgroupGetBlkioDeviceWriteIops(priv->cgroup, dev->path,
+ &dev->wiops) < 0))
return -1;
if (dev->rbps &&
(virCgroupSetBlkioDeviceReadBps(priv->cgroup, dev->path,
- dev->rbps) < 0))
+ dev->rbps) < 0 ||
+ virCgroupGetBlkioDeviceReadBps(priv->cgroup, dev->path,
+ &dev->rbps) < 0))
return -1;
if (dev->wbps &&
(virCgroupSetBlkioDeviceWriteBps(priv->cgroup, dev->path,
- dev->wbps) < 0))
+ dev->wbps) < 0 ||
+ virCgroupGetBlkioDeviceWriteBps(priv->cgroup, dev->path,
+ &dev->wbps) < 0))
return -1;
}
}
for (j = 0; j < ndevices; j++) {
if (virCgroupSetBlkioDeviceWeight(priv->cgroup,
devices[j].path,
- devices[j].weight) < 0) {
+ devices[j].weight) < 0 ||
+ virCgroupGetBlkioDeviceWeight(priv->cgroup,
+ devices[j].path,
+ &devices[j].weight) < 0) {
ret = -1;
break;
}
for (j = 0; j < ndevices; j++) {
if (virCgroupSetBlkioDeviceReadIops(priv->cgroup,
devices[j].path,
- devices[j].riops) < 0) {
+ devices[j].riops) < 0 ||
+ virCgroupGetBlkioDeviceReadIops(priv->cgroup,
+ devices[j].path,
+ &devices[j].riops) < 0) {
ret = -1;
break;
}
for (j = 0; j < ndevices; j++) {
if (virCgroupSetBlkioDeviceWriteIops(priv->cgroup,
devices[j].path,
- devices[j].wiops) < 0) {
+ devices[j].wiops) < 0 ||
+ virCgroupGetBlkioDeviceWriteIops(priv->cgroup,
+ devices[j].path,
+ &devices[j].wiops) < 0) {
ret = -1;
break;
}
for (j = 0; j < ndevices; j++) {
if (virCgroupSetBlkioDeviceReadBps(priv->cgroup,
devices[j].path,
- devices[j].rbps) < 0) {
+ devices[j].rbps) < 0 ||
+ virCgroupGetBlkioDeviceReadBps(priv->cgroup,
+ devices[j].path,
+ &devices[j].rbps) < 0) {
ret = -1;
break;
}
for (j = 0; j < ndevices; j++) {
if (virCgroupSetBlkioDeviceWriteBps(priv->cgroup,
devices[j].path,
- devices[j].wbps) < 0) {
+ devices[j].wbps) < 0 ||
+ virCgroupGetBlkioDeviceWriteBps(priv->cgroup,
+ devices[j].path,
+ &devices[j].wbps) < 0) {
ret = -1;
break;
}