Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2790839rdh; Wed, 27 Sep 2023 12:46:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpHwbnDHXoxkSwVBS7DNiUTkBJV3tiGkEazLqUsBagoQqA1ySBx3+g9cvAj9mt+JET3JxB X-Received: by 2002:a05:6a00:1404:b0:690:d413:ee13 with SMTP id l4-20020a056a00140400b00690d413ee13mr3199295pfu.23.1695843998151; Wed, 27 Sep 2023 12:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695843998; cv=none; d=google.com; s=arc-20160816; b=LzlShVypbJUlRehW7gNkbOG+napdUUfroqlgwF44AS1xlwJAmVI/xc1z36zykKTqVk r3yZRCjHQg+WM13c9XyAJl4r+vjUJyTxWfNt9Wp6x8Qo2Q136glaFIRqsROUjcicdhS1 NU/CE69VeKW/cJGpBCN6TeAqXMS2WCiGXT9hvm1Qbefw3YmtrYg5mJj0irMNM7SV+XE+ ZxrG/Uvrora7G8+2rxWitwdvQpd4EMBvvRmfyhkcXow4ypsHkk66tjaI8KNNmVMkll65 PdHJHzfkrei51Ga957uU2Z0XocxWGGGBtKMwrUjqKPtSVK7RYnbitMujSejy6m360G8X p59A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/EIbBjpy9O83n9qhTihg7QeV6q2TpAQGQwYAPKsUVIA=; fh=eJPkN3tFFGyOjhZcgwUfJhFQ03vZc7D0oMT4HH0heJE=; b=PgpgVlfiB6xEP5fnrrVhK/1v2eO2DjZK3mHALtvqntkgy1z43QyXVpdcLBdt0Zti9o zBrHeUMdOLwNp7m8qbRPdY2Ei0BBxSwqztJl/tphsE+bBzfBtXaAXY3FusTkF6pe4HKQ Ir3H6M928LOIU+G6RcHENatXkPV4LdquKxNAFnkcwOzHKbHK4RdUp84oUkd7Ln7cOvw/ Kjt6WOctrZMJaSpkJyX0sOB1jlkaSBSbL19OEJs/WtNLGvJD6tqaKU+mItsBz8Heds7x HqQTgtSweF5AbneegZ36Xuu/ws4aubj/FVOKfUZCVxWefTErttk7MoiyWyjfwIELnZeR uJTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K01LKSae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s22-20020a056a00179600b00690d4b91636si18053840pfg.229.2023.09.27.12.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 12:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K01LKSae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 28EAE80A8B9B; Wed, 27 Sep 2023 08:21:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbjI0PVG (ORCPT + 99 others); Wed, 27 Sep 2023 11:21:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232289AbjI0PVF (ORCPT ); Wed, 27 Sep 2023 11:21:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A73CC121 for ; Wed, 27 Sep 2023 08:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695828014; 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=/EIbBjpy9O83n9qhTihg7QeV6q2TpAQGQwYAPKsUVIA=; b=K01LKSaed/MPl3hSmA3N+Lf9sYM61H5LPVjm1mNY3xkbyV6+Q6fQzyuUKDSh+86RQFkFC5 V5G37yO+9cXOeTE+u+6D9qksfH0mh9M0CN+7uJ3w4gBpBynwqJX8au8LRB1vVuQZ86Vdup 0YR8MK31Vw/xyyFEJAmM9nMclGFdOx8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-VRfhcXSfOWONNqhEXd4YJA-1; Wed, 27 Sep 2023 11:20:12 -0400 X-MC-Unique: VRfhcXSfOWONNqhEXd4YJA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-320004980a2so9290598f8f.1 for ; Wed, 27 Sep 2023 08:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695828011; x=1696432811; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/EIbBjpy9O83n9qhTihg7QeV6q2TpAQGQwYAPKsUVIA=; b=GPffq/OHj/jXUH9rWKG6OsdzwSgdW+c5o1Ab8Z340PiDwLOsJlcdoqXAqYsSfbvqRa xU1KRu9xrCN4Cfq2qVIt4p7Fx9hZ0G+4hSsUFumENs4dzPmXXO9BQjLesQca1r+/Rqbb MtxLqXb7M56hGHPv4BIgyrdmO39Sds06sV+kpufLdWJgEAK/MZAc3RzJvlvGfKYx//KB 8ZgKk9ZWyw0ZjEHpz7lCQcLcwRLUhcO7eiqlKsEn9EO47qBCI9XVoOn+JIV3M85Txfg9 g1P3f5Y6bN8ZB5MxpzC1yEOFxvGkmn8+p/KybQY6/2Yi6e9TFHvYmPN+WJBYi0+jpkfY SNxA== X-Gm-Message-State: AOJu0Yz6pdZOJp2wildxtr3jZsXzf5MLCOOamDSO6+caYerKnsSoDL/D k/fXirYaEHpxzaxKEXwFqiZKz2mcU1H3e1hxy6n55nHpDppkjqVO5g2q9O/kazflIwbf/gxJDlF IpxStwB8RJTQkKUTQabw8LdbR X-Received: by 2002:a5d:4cc7:0:b0:314:a3f:9c08 with SMTP id c7-20020a5d4cc7000000b003140a3f9c08mr1876007wrt.39.1695828011761; Wed, 27 Sep 2023 08:20:11 -0700 (PDT) X-Received: by 2002:a5d:4cc7:0:b0:314:a3f:9c08 with SMTP id c7-20020a5d4cc7000000b003140a3f9c08mr1875993wrt.39.1695828011418; Wed, 27 Sep 2023 08:20:11 -0700 (PDT) Received: from redhat.com ([2a02:14f:16e:b9f6:556e:c001:fe18:7e0a]) by smtp.gmail.com with ESMTPSA id x17-20020a5d6511000000b0031fd849e797sm17324370wru.105.2023.09.27.08.20.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 08:20:10 -0700 (PDT) Date: Wed, 27 Sep 2023 11:20:05 -0400 From: "Michael S. Tsirkin" To: liming.wu@jaguarmicro.com Cc: Jason Wang , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 398776277@qq.com Subject: Re: [PATCH 2/2] tools/virtio: Add hints when module is not installed Message-ID: <20230927111904-mutt-send-email-mst@kernel.org> References: <20230926050021.717-1-liming.wu@jaguarmicro.com> <20230926050021.717-2-liming.wu@jaguarmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230926050021.717-2-liming.wu@jaguarmicro.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:21:20 -0700 (PDT) On Tue, Sep 26, 2023 at 01:00:20PM +0800, liming.wu@jaguarmicro.com wrote: > From: Liming Wu > > Need to insmod vhost_test.ko before run virtio_test. > Give some hints to users. > > Signed-off-by: Liming Wu > --- > tools/virtio/virtio_test.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c > index 028f54e6854a..ce2c4d93d735 100644 > --- a/tools/virtio/virtio_test.c > +++ b/tools/virtio/virtio_test.c > @@ -135,6 +135,10 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features) > dev->buf = malloc(dev->buf_size); > assert(dev->buf); > dev->control = open("/dev/vhost-test", O_RDWR); > + > + if (dev->control < 0) > + fprintf(stderr, "Install vhost_test module" \ > + "(./vhost_test/vhost_test.ko) firstly\n"); Thanks! things to improve: firstly -> first add space before ( End sentence with a dot align "" on the two lines > assert(dev->control >= 0); > r = ioctl(dev->control, VHOST_SET_OWNER, NULL); > assert(r >= 0); > -- > 2.34.1