Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2823076ybb; Mon, 30 Mar 2020 13:45:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvTONw6UTjBjkmzB+/pj87Ks7i8giPiVMvGBCOZTFHdyFeJLgpBzASFrYeJxXIhIbLBXT06 X-Received: by 2002:a4a:41ce:: with SMTP id x197mr11025024ooa.77.1585601126593; Mon, 30 Mar 2020 13:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585601126; cv=none; d=google.com; s=arc-20160816; b=zy+LG1ewxHnXZftu6YkrUUrU3vaNK2uXvCNQqD4Z2LQvEyXxkEHqXNxaHfECQpPwJE vBdZIkP56IPHdMXQt5cRJX9Dt+cf70qX5ZEG3T89seeag5I+2o3f7LbVkvf1kD7ljdPt gJOFn0ecZ4I+bmuYr5+y2oYKm6TMecyo7Hwal+HaBwtVD2pNM/s/mWEZ420Dt65d4jRS rWZDy/aFtnaaZhoYq7Z4F5o+uKn2Ys9IpeqYf9Y3BfAto7qAXr6/kDV/rnh651CJEzXK 0T5oR2xmk3+1tnkNUAZWQCekzaMaX8MREv408Hejb9INCYDTiHnFCkU8t1UeeoZm4rkR esdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8WcGc/uVHG7ylmz9BTpf5JgzJOmoF9uEr8u6eJ8H6Dk=; b=awZkcI2NSbi+jHf7FC/5iItqQ4TFNPnfzeTw02ea0gA8EjuADloCssa7kkv4KvqIFl wErUKMp+ey5LMDC+BMPetsNFn7b1aEQgPxnh4wTLAR+HVHPQ01x7Gu+OPmTSdzNWMg42 LZtSQlKY5133ONCHvQQlpurRs02JQl/PmwRENAU8uAJ0ppfffpUC5hjqsoEVM4Nn10Gd PFdB6JBw1kyvRctBTw02pnkfH3FeEyczEMta9ePOzZe/a9vxZ79pH5fDudZvEt8fCTSl eqbXiZC/SEA2CimfrqN3K2H7uEXQ3q47A9eLmLIzXkM1GkE2+zcSYTknCWwXyvW2Yl+J DsLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EK25I1nU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18si5806849otq.286.2020.03.30.13.45.14; Mon, 30 Mar 2020 13:45:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EK25I1nU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728643AbgC3Unt (ORCPT + 99 others); Mon, 30 Mar 2020 16:43:49 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:57894 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbgC3Unt (ORCPT ); Mon, 30 Mar 2020 16:43:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585601028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=8WcGc/uVHG7ylmz9BTpf5JgzJOmoF9uEr8u6eJ8H6Dk=; b=EK25I1nU+ShRY/cYSxSUsYu4Iy2aWNQMHx5h8FWev6tLZFDICBXLyB34LkW+2+86NcjoTK bVc1P61/0lIAgGyfXAR1tjhW94/GjI+i3dBF7oiGENquIpo59kpx7Hw5w85Atdi1XS2/W2 tqm24OJsJUlUpikobEkGPDDeor1liJI= 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-378-28sXCqmINh-LnPyBKYXAsw-1; Mon, 30 Mar 2020 16:43:43 -0400 X-MC-Unique: 28sXCqmINh-LnPyBKYXAsw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C969E1922960; Mon, 30 Mar 2020 20:43:42 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-15.gru2.redhat.com [10.97.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC74519C58; Mon, 30 Mar 2020 20:43:26 +0000 (UTC) From: Wainer dos Santos Moschetta To: kvm@vger.kernel.org, pbonzini@redhat.com Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, david@redhat.com, drjones@redhat.com Subject: [PATCH 1/2] selftests: kvm: Add vm_get_fd() in kvm_util Date: Mon, 30 Mar 2020 17:43:09 -0300 Message-Id: <20200330204310.21736-2-wainersm@redhat.com> In-Reply-To: <20200330204310.21736-1-wainersm@redhat.com> References: <20200330204310.21736-1-wainersm@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduces the vm_get_fd() function in kvm_util which returns the VM file descriptor. Signed-off-by: Wainer dos Santos Moschetta --- tools/testing/selftests/kvm/include/kvm_util.h | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h index ae0d14c2540a..aa4a70f969ed 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -163,6 +163,7 @@ bool vm_is_unrestricted_guest(struct kvm_vm *vm); unsigned int vm_get_page_size(struct kvm_vm *vm); unsigned int vm_get_page_shift(struct kvm_vm *vm); unsigned int vm_get_max_gfn(struct kvm_vm *vm); +unsigned int vm_get_fd(struct kvm_vm *vm); struct kvm_userspace_memory_region * kvm_userspace_memory_region_find(struct kvm_vm *vm, uint64_t start, diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index a6dd0401eb50..0961986c0d74 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -1703,3 +1703,8 @@ unsigned int vm_get_max_gfn(struct kvm_vm *vm) { return vm->max_gfn; } + +unsigned int vm_get_fd(struct kvm_vm *vm) +{ + return vm->fd; +} -- 2.17.2