From nobody Mon Feb 9 08:10:31 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604516150; cv=none; d=zohomail.com; s=zohoarc; b=ZhfGhfMxbVhZHXaB2rhzfeDe010fNSd6rODlO4HnurPCPU2Ci4uCN4htNN+eKOQVCXuOcqNiSOVJMcf3TRnugJXGrs7+YdPXIIFDITrvnRMrw/kx5h3fyTXujwP1+VG9pzmvAMdIkXk2YrUByNMzWdK5MHYinntQYO0PtOcL4gY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604516150; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Try6I8+Gzp362j90+uCp08fdMyiL5wC2Bsqj8twh+n4=; b=PbOWlP6Ut0YZyvrIM9w7DJYcy9ELuh7xOgqUx32LKr6TqcZQ3d3OwWHraYjzcVhcwEb5dj998TW3RbVRB03AJJRVX+aUGKCLlOhKZ60nvKG3iIJraBLJVxISN8IUDf1+jD0caLJIrFFl6PV/1hBBECr5QHKRGZitnxSLBKeGuxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604516150891470.5525838700165; Wed, 4 Nov 2020 10:55:50 -0800 (PST) Received: from localhost ([::1]:45296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaNwj-0007HH-Qf for importer@patchew.org; Wed, 04 Nov 2020 13:55:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaNjq-0001hf-Oz for qemu-devel@nongnu.org; Wed, 04 Nov 2020 13:42:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kaNjp-00026S-3Y for qemu-devel@nongnu.org; Wed, 04 Nov 2020 13:42:30 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-qbCEMJWQOXSge5r4EDebng-1; Wed, 04 Nov 2020 13:42:26 -0500 Received: by mail-wr1-f72.google.com with SMTP id i1so9580359wrb.18 for ; Wed, 04 Nov 2020 10:42:26 -0800 (PST) Received: from redhat.com (bzq-79-176-118-93.red.bezeqint.net. [79.176.118.93]) by smtp.gmail.com with ESMTPSA id v6sm3269330wmj.6.2020.11.04.10.42.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 10:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604515348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Try6I8+Gzp362j90+uCp08fdMyiL5wC2Bsqj8twh+n4=; b=hzvxE2e4dL+i1++2dLycdR9lpW5vv84F+2QkQjjSw5DKVnih4TU3DJ0YP6uYv/umIaJu+F dTuJMIpSFzrUx8TJD75xaBD11ECf8wZaWZsn1y50HVn8TlJXwnknufeHAr6PV9uWs6R5B9 6LrtRl75Hfv84KeE4E7WWUL9OhDLaxk= X-MC-Unique: qbCEMJWQOXSge5r4EDebng-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Try6I8+Gzp362j90+uCp08fdMyiL5wC2Bsqj8twh+n4=; b=t2v14mCS0rDTTQzCSB7leCNEZ54GJsE8bNOgCARJQUvjEGX9RppeJ4YzrA0smGR5Hr kWR1Zr6JdFxYINpJOubov53dNxr3ng8wImasAAxzsLT2L+ZUukF4PFXCHIE/I4xrlttC mc3daZ19bMPvQHxluCWexB4UnsFsFWAsKCzhQagcRG3mYVFWpaGgH5+ZFNuZ1IRh6sT3 3NDN09fwxVGPxgwvNjQaBtUIDWEd6B8+ajLMMcwKuvyhE1vrrwL9VpfRKEqhv7y4EytL EwRiAX6e3EkhVZ0mBtoCKi3kzwZc5cfqNGaBvUOgpbslo1/Kqi3yoYfl+FG1Cr6cWlkM oSXg== X-Gm-Message-State: AOAM53072nwCN8tOzn9k+b8A0KNpNtpmhcOVYr62ZXLkGTeoQr0037c7 AvyvnOCZ3jU4RpBR0FOlleDbiUJdjxXkgkuyX1x/vO3JDbby6w/tIjEy7feW7XornfF28mUNBu5 D9zXYoDYoB0SSMJY= X-Received: by 2002:adf:dd09:: with SMTP id a9mr34051242wrm.208.1604515344947; Wed, 04 Nov 2020 10:42:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkTfKeUmM+P7f/sQQduJMEEgzCrQvVQedNk9WCw2hBBLx+hy3QpsT0oBP0sYUWKulR5KSQZA== X-Received: by 2002:adf:dd09:: with SMTP id a9mr34051224wrm.208.1604515344810; Wed, 04 Nov 2020 10:42:24 -0800 (PST) Date: Wed, 4 Nov 2020 13:42:22 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v3 23/31] vhost-vdpa: Add qemu_close in vhost_vdpa_cleanup Message-ID: <20201104184040.285057-24-mst@redhat.com> References: <20201104184040.285057-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201104184040.285057-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/03 00:03:41 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Jason Wang , Cindy Lu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Cindy Lu fix the bug that fd will still open after the cleanup Signed-off-by: Cindy Lu Message-Id: <20201016030909.9522-1-lulu@redhat.com> Acked-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- net/vhost-vdpa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 99c476db8c..fe659ec9e2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -145,6 +145,10 @@ static void vhost_vdpa_cleanup(NetClientState *nc) g_free(s->vhost_net); s->vhost_net =3D NULL; } + if (s->vhost_vdpa.device_fd >=3D 0) { + qemu_close(s->vhost_vdpa.device_fd); + s->vhost_vdpa.device_fd =3D -1; + } } =20 static bool vhost_vdpa_has_vnet_hdr(NetClientState *nc) --=20 MST