From nobody Mon Apr 29 16:23:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590767446; cv=none; d=zohomail.com; s=zohoarc; b=KN2iJQS2LZnp+L/55RxMgoaVk2bLgBpjPrDm1t/ttUzm8kCff+937FtgJA2MfjafeldS/+OL+uFrP+TRPis+FHp8z9k9TPm8TgiEvPZjYUAvm3wfgncyBKjUP420oaK8KrveQnX9NkZ3CpCiilq6LuszPpRfCyzYjMkgQYO0G1g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590767446; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=0nW4TAXGErqta9FDcYqEkMxnSGrS2hggxneUMTY5lI0=; b=nQ/q7fmlLDyT5M3RUBV3151cBPuB47Hyz9QN9iYiGeLNurjAJ8pvxC9UGQNv+tSkURd0EQjWOTh1lm5XKePgUdRVRoeg6fZky9uyvBGlZNWfURR07cepQ3yu0RK2Hepubxvc6xGQQG0Jn7zEXuQFvM3c8jA9T8On0kZtI9TRuuU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1590767446744233.60604813583484; Fri, 29 May 2020 08:50:46 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-XuewVYS8O_Wc8bIKaWggVA-1; Fri, 29 May 2020 11:50:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 587961B18BCB; Fri, 29 May 2020 15:50:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2E44A1888; Fri, 29 May 2020 15:50:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B27DF6EF47; Fri, 29 May 2020 15:50:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04TFoSwG024223 for ; Fri, 29 May 2020 11:50:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 05455F5AC5; Fri, 29 May 2020 15:50:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E44FBF5692 for ; Fri, 29 May 2020 15:50:25 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 738CF1801230 for ; Fri, 29 May 2020 15:50:25 +0000 (UTC) Received: from mxct.zte.com.cn (mx7.zte.com.cn [202.103.147.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-pMSQqOH0NIu0IB9MUYCj4w-1; Fri, 29 May 2020 11:50:22 -0400 Received: from mse-fl2.zte.com.cn (unknown [10.30.14.239]) by Forcepoint Email with ESMTPS id EF10B1B03A9E17DA6FB1 for ; Fri, 29 May 2020 23:50:17 +0800 (CST) Received: from notes_smtp.zte.com.cn (notes_smtp.zte.com.cn [10.30.1.239]) by mse-fl2.zte.com.cn with ESMTP id 04TFoGbf017543 for ; Fri, 29 May 2020 23:50:16 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2020052923505601-3745466 ; Fri, 29 May 2020 23:50:56 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590767445; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type:list-id: list-help:list-unsubscribe:list-subscribe:list-post; bh=0nW4TAXGErqta9FDcYqEkMxnSGrS2hggxneUMTY5lI0=; b=L3u4URC3hY/M8zcYx5iNI69bxeN5cevrfXcBnojK0OVsl0+ocukV9ZpeCPCdvNtorkXBHJ 4S7TwXQKVKluN6VZTfxZ36bxviL5uQsmRbGz7zK0LTEjhy6kwFA4iVV/dgr8hX+BQ/vfps WweA18nT4L+f0FDO8C5iuj1SHHR5LY4= X-MC-Unique: XuewVYS8O_Wc8bIKaWggVA-1 X-MC-Unique: pMSQqOH0NIu0IB9MUYCj4w-1 From: Yi Wang To: libvir-list@redhat.com Subject: [PATCH] qemu: hotplug: Fix the condition check for net->downscript Date: Fri, 29 May 2020 23:52:24 +0800 Message-Id: <1590767544-11378-1-git-send-email-wang.yi59@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2020-05-29 23:50:56, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2020-05-29 23:50:22, Serialize complete at 2020-05-29 23:50:22 X-MAIL: mse-fl2.zte.com.cn 04TFoGbf017543 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: wang.yi59@zte.com.cn, Liao Pingfang , wang.liang82@zte.com.cn, xue.zhihong@zte.com.cn X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Liao Pingfang According to the context, here we are checking net->downscript's validity, Signed-off-by: Liao Pingfang Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d1a2be1..8c99dfc 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4672,9 +4672,8 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, virDomainNetReleaseActualDevice(conn, vm->def, net); else VIR_WARN("Unable to release network device '%s'", NULLSTR(net-= >ifname)); - } else if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET) { - if (net->script) - virNetDevRunEthernetScript(net->ifname, net->downscript); + } else if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET && net->downs= cript) { + virNetDevRunEthernetScript(net->ifname, net->downscript); } virDomainNetDefFree(net); return 0; --=20 2.9.5