mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: command: make qemuBuildVirtioOptionsStr void
Now that qemuBuildVirtioOptionsStr can not fail anymore, remove its return value and make it void. Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
e058a72c77
commit
c1165f70c2
@ -586,12 +586,12 @@ qemuBuildVirtioDevStr(virBufferPtr buf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
qemuBuildVirtioOptionsStr(virBufferPtr buf,
|
||||
virDomainVirtioOptionsPtr virtio)
|
||||
{
|
||||
if (!virtio)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
if (virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||
virBufferAsprintf(buf, ",iommu_platform=%s",
|
||||
@ -605,8 +605,6 @@ qemuBuildVirtioOptionsStr(virBufferPtr buf,
|
||||
virBufferAsprintf(buf, ",packed=%s",
|
||||
virTristateSwitchTypeToString(virtio->packed));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -2139,8 +2137,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
|
||||
virBufferAsprintf(&opt, ",num-queues=%u", disk->queues);
|
||||
}
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&opt, disk->virtio) < 0)
|
||||
return NULL;
|
||||
qemuBuildVirtioOptionsStr(&opt, disk->virtio);
|
||||
|
||||
if (qemuBuildDeviceAddressStr(&opt, def, &disk->info, qemuCaps) < 0)
|
||||
return NULL;
|
||||
@ -2604,8 +2601,7 @@ qemuBuildVHostUserFsCommandLine(virCommandPtr cmd,
|
||||
virBufferAsprintf(&opt, ",queue-size=%llu", fs->queue_size);
|
||||
virBufferAddLit(&opt, ",tag=");
|
||||
virQEMUBuildBufferEscapeComma(&opt, fs->dst);
|
||||
if (qemuBuildVirtioOptionsStr(&opt, fs->virtio) < 0)
|
||||
return -1;
|
||||
qemuBuildVirtioOptionsStr(&opt, fs->virtio);
|
||||
|
||||
if (qemuBuildDeviceAddressStr(&opt, def, &fs->info, priv->qemuCaps) < 0)
|
||||
return -1;
|
||||
@ -2674,8 +2670,7 @@ qemuBuildFSDevStr(const virDomainDef *def,
|
||||
virBufferAddLit(&opt, ",mount_tag=");
|
||||
virQEMUBuildBufferEscapeComma(&opt, fs->dst);
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&opt, fs->virtio) < 0)
|
||||
return NULL;
|
||||
qemuBuildVirtioOptionsStr(&opt, fs->virtio);
|
||||
|
||||
if (qemuBuildDeviceAddressStr(&opt, def, &fs->info, qemuCaps) < 0)
|
||||
return NULL;
|
||||
@ -2906,8 +2901,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
|
||||
def->iothread);
|
||||
}
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&buf, def->virtio) < 0)
|
||||
return -1;
|
||||
qemuBuildVirtioOptionsStr(&buf, def->virtio);
|
||||
break;
|
||||
case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC:
|
||||
virBufferAddLit(&buf, "lsi");
|
||||
@ -2953,8 +2947,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
|
||||
virBufferAsprintf(&buf, ",vectors=%d",
|
||||
def->opts.vioserial.vectors);
|
||||
}
|
||||
if (qemuBuildVirtioOptionsStr(&buf, def->virtio) < 0)
|
||||
return -1;
|
||||
qemuBuildVirtioOptionsStr(&buf, def->virtio);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
|
||||
@ -3904,9 +3897,8 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
return NULL;
|
||||
if (bootindex)
|
||||
virBufferAsprintf(&buf, ",bootindex=%u", bootindex);
|
||||
if (usingVirtio &&
|
||||
qemuBuildVirtioOptionsStr(&buf, net->virtio) < 0)
|
||||
return NULL;
|
||||
if (usingVirtio)
|
||||
qemuBuildVirtioOptionsStr(&buf, net->virtio);
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
}
|
||||
@ -4147,8 +4139,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd,
|
||||
virTristateSwitchTypeToString(def->memballoon->autodeflate));
|
||||
}
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&buf, def->memballoon->virtio) < 0)
|
||||
return -1;
|
||||
qemuBuildVirtioOptionsStr(&buf, def->memballoon->virtio);
|
||||
|
||||
if (qemuCommandAddExtDevice(cmd, &def->memballoon->info) < 0)
|
||||
return -1;
|
||||
@ -4239,8 +4230,7 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def,
|
||||
if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
|
||||
return NULL;
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&buf, dev->virtio) < 0)
|
||||
return NULL;
|
||||
qemuBuildVirtioOptionsStr(&buf, dev->virtio);
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
}
|
||||
@ -4550,8 +4540,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def,
|
||||
if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0)
|
||||
return NULL;
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&buf, video->virtio) < 0)
|
||||
return NULL;
|
||||
qemuBuildVirtioOptionsStr(&buf, video->virtio);
|
||||
|
||||
return virBufferContentAndReset(&buf);
|
||||
}
|
||||
@ -5766,8 +5755,7 @@ qemuBuildRNGDevStr(const virDomainDef *def,
|
||||
virBufferAddLit(&buf, ",period=1000");
|
||||
}
|
||||
|
||||
if (qemuBuildVirtioOptionsStr(&buf, dev->virtio) < 0)
|
||||
return NULL;
|
||||
qemuBuildVirtioOptionsStr(&buf, dev->virtio);
|
||||
|
||||
if (qemuBuildDeviceAddressStr(&buf, def, &dev->info, qemuCaps) < 0)
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user