提交 16520d65 编写于 作者: L Laine Stump

qemu: use virDomainNetRemove instead of inline code

The code being replaced is exactly identical to the newly global
function, right down to the comment.
上级 ac9ca01c
......@@ -2158,19 +2158,7 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
detach->ifname));
networkReleaseActualDevice(detach);
if (vm->def->nnets > 1) {
memmove(vm->def->nets + i,
vm->def->nets + i + 1,
sizeof(*vm->def->nets) *
(vm->def->nnets - (i + 1)));
vm->def->nnets--;
if (VIR_REALLOC_N(vm->def->nets, vm->def->nnets) < 0) {
/* ignore, harmless */
}
} else {
VIR_FREE(vm->def->nets);
vm->def->nnets = 0;
}
virDomainNetRemove(vm->def, i);
virDomainNetDefFree(detach);
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册