vm->def->nets[changeidx] can never be NULL for changeidx returned by virDomainNetFindIdx. Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- 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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list