提交 74ba039f 编写于 作者: P Peter Krempa

qemu: Clean up network device CLI generator

With the default model assigned in the parse callback, this code is now obsolete.
上级 d8ddf522
...@@ -3708,27 +3708,22 @@ qemuBuildNicDevStr(virDomainNetDefPtr net, ...@@ -3708,27 +3708,22 @@ qemuBuildNicDevStr(virDomainNetDefPtr net,
virQEMUCapsPtr qemuCaps) virQEMUCapsPtr qemuCaps)
{ {
virBuffer buf = VIR_BUFFER_INITIALIZER; virBuffer buf = VIR_BUFFER_INITIALIZER;
const char *nic; const char *nic = net->model;
bool usingVirtio = false; bool usingVirtio = false;
char macaddr[VIR_MAC_STRING_BUFLEN]; char macaddr[VIR_MAC_STRING_BUFLEN];
if (!net->model) { if (STREQ(net->model, "virtio")) {
nic = "rtl8139"; if (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
} else if (STREQ(net->model, "virtio")) {
if (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
nic = "virtio-net-ccw"; nic = "virtio-net-ccw";
} else if (net->info.type == else if (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390)
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390) {
nic = "virtio-net-s390"; nic = "virtio-net-s390";
} else { else
nic = "virtio-net-pci"; nic = "virtio-net-pci";
}
usingVirtio = true; usingVirtio = true;
} else {
nic = net->model;
} }
virBufferAdd(&buf, nic, strlen(nic)); virBufferAdd(&buf, nic, -1);
if (usingVirtio && net->driver.virtio.txmode) { if (usingVirtio && net->driver.virtio.txmode) {
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_TX_ALG)) { if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_TX_ALG)) {
virBufferAddLit(&buf, ",tx="); virBufferAddLit(&buf, ",tx=");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册