vm->def->nets[changeidx] can never be NULL for changeidx returned by
virDomainNetFindIdx.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 87cf578acc..e0a5300f08 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3061,12 +3061,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
if ((changeidx = virDomainNetFindIdx(vm->def, newdev)) < 0)
goto cleanup;
devslot = &vm->def->nets[changeidx];
-
- if (!(olddev = *devslot)) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("cannot find existing network device to modify"));
- goto cleanup;
- }
+ olddev = *devslot;
oldType = virDomainNetGetActualType(olddev);
if (oldType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
--
2.16.2