From patchwork Fri Jun 19 12:00:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 280001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FD2AC433E0 for ; Fri, 19 Jun 2020 12:05:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2FE5206D7 for ; Fri, 19 Jun 2020 12:05:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VX3VDxyi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2FE5206D7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmFlr-00027t-89 for qemu-devel@archiver.kernel.org; Fri, 19 Jun 2020 08:05:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmFhx-0004i1-Ep for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:01:21 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:21675 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jmFhr-0006bb-PS for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:01:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592568075; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1X0SaLnFosWQMILbJjlT+5LzCR5g7SXKjLHbsNPSwkA=; b=VX3VDxyiz31fRBgY/x4SG9N9Sc1AipLCVyYWAoRrtXko+VM9o9kUZ1DjQ4KGKM6pEPYixl C9DUl5RUmlF9+S6N+QFiKB6fyN+f61xkAy2Mx88vGOCTC99xJjpto7zHDKdClhoKBB+oah waSQf5aWSzSk6Fx1XrPGescjpV8Ik8c= 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-485-J7nP85P4O9GsDqYrtl5g0w-1; Fri, 19 Jun 2020 08:01:11 -0400 X-MC-Unique: J7nP85P4O9GsDqYrtl5g0w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E362107ACCA; Fri, 19 Jun 2020 12:01:10 +0000 (UTC) Received: from localhost (ovpn-113-212.ams2.redhat.com [10.36.113.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB2435D9CA; Fri, 19 Jun 2020 12:01:09 +0000 (UTC) From: Stefan Hajnoczi To: Coiby Xu Subject: [PATCH 2/6] vhost-user-server: drop unused #include Date: Fri, 19 Jun 2020 13:00:42 +0100 Message-Id: <20200619120046.2422205-2-stefanha@redhat.com> In-Reply-To: <20200619120046.2422205-1-stefanha@redhat.com> References: <20200614183907.514282-3-coiby.xu@gmail.com> <20200619120046.2422205-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 01:50:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.c | 1 - 1 file changed, 1 deletion(-) diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index e94a8d8a83..49ada8bc78 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -7,7 +7,6 @@ * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" -#include #include "qemu/main-loop.h" #include "vhost-user-server.h" From patchwork Fri Jun 19 12:00:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 280003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41DB6C433E0 for ; Fri, 19 Jun 2020 12:02:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 108ED2083B for ; Fri, 19 Jun 2020 12:02:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Lx4KVXW4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 108ED2083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmFjE-0006Fa-7e for qemu-devel@archiver.kernel.org; Fri, 19 Jun 2020 08:02:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmFhv-0004gv-S9 for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:01:19 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:37495 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jmFht-0006bl-VI for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:01:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592568075; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q2og2OIyjHIRuCRdAmqyFENbqMqlgU8vgLl7XV+/RAo=; b=Lx4KVXW4FwsxiXVFJvYhl5K+J1hc3NOjnhN9uu+fSgB8YDIfnPUuyxGjJAkUJQwdRmKkWu NG8Ccrh4qrRguSj1xhrDqZi4hkR0Xl8BM54zLyJHLUuj2tZcFvjwtApd+efeujRfvfMBb0 JiWGRjR1SeG2mKoC+ZTBw7DbTyyRkjg= 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-285-obAmtjI3PrCmhvNpkA8sSg-1; Fri, 19 Jun 2020 08:01:13 -0400 X-MC-Unique: obAmtjI3PrCmhvNpkA8sSg-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 24206464; Fri, 19 Jun 2020 12:01:12 +0000 (UTC) Received: from localhost (ovpn-113-212.ams2.redhat.com [10.36.113.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id A71E819D61; Fri, 19 Jun 2020 12:01:11 +0000 (UTC) From: Stefan Hajnoczi To: Coiby Xu Subject: [PATCH 3/6] vhost-user-server: adjust vhost_user_server_set_aio_context() arguments Date: Fri, 19 Jun 2020 13:00:43 +0100 Message-Id: <20200619120046.2422205-3-stefanha@redhat.com> In-Reply-To: <20200619120046.2422205-1-stefanha@redhat.com> References: <20200614183907.514282-3-coiby.xu@gmail.com> <20200619120046.2422205-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 01:50:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" vhost_user_server_set_aio_context() operates on a VuServer object. Make that the first argument of the function since it is conventional to define functions with the object they act on as the first argument. In other words, obj_action(obj, args...) is commonly used and not obj_action(arg1, ..., obj, ...). Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.h | 2 +- util/vhost-user-server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/vhost-user-server.h b/util/vhost-user-server.h index 5baf58f96a..584aab3da5 100644 --- a/util/vhost-user-server.h +++ b/util/vhost-user-server.h @@ -56,6 +56,6 @@ bool vhost_user_server_start(VuServer *server, void vhost_user_server_stop(VuServer *server); -void vhost_user_server_set_aio_context(AioContext *ctx, VuServer *server); +void vhost_user_server_set_aio_context(VuServer *server, AioContext *ctx); #endif /* VHOST_USER_SERVER_H */ diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index 49ada8bc78..5230ba3883 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -356,7 +356,7 @@ static void attach_context(VuServer *server, AioContext *ctx) } } -void vhost_user_server_set_aio_context(AioContext *ctx, VuServer *server) +void vhost_user_server_set_aio_context(VuServer *server, AioContext *ctx) { server->ctx = ctx ? ctx : qemu_get_aio_context(); if (!server->sioc) { From patchwork Fri Jun 19 12:01:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 280000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ED33C433E1 for ; Fri, 19 Jun 2020 12:07:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E4E2207FC for ; Fri, 19 Jun 2020 12:07:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="biQYEVTh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E4E2207FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmFnS-00055D-Dg for qemu-devel@archiver.kernel.org; Fri, 19 Jun 2020 08:07:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmFj0-0006Tz-Vl for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:02:26 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:25964 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jmFiz-0006iJ-AJ for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:02:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592568144; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=56JOwKR/P0lQLHwY/SoohBFH+hJsKtQ2Z3JzQYThtgI=; b=biQYEVThkjvmVKChM4a+3H3wjOgYB6E6By5oupihYyKOyTstiCj5ETc0Bj8LYbghjCWjgv wIhqqA/Ti9x3p2OhUzUF8CxANI6TU5znOpvrppFRUWS17NsynK1bZZFuB6gqN6dEMNg2QO de24g2ZLhUmgWqLtAkRBK9JgOo72Wsk= 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-231-pObxXxAlMwuBbptuzeNibA-1; Fri, 19 Jun 2020 08:02:23 -0400 X-MC-Unique: pObxXxAlMwuBbptuzeNibA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8C92105250A; Fri, 19 Jun 2020 12:02:21 +0000 (UTC) Received: from localhost (ovpn-113-212.ams2.redhat.com [10.36.113.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F9AB60BF4; Fri, 19 Jun 2020 12:02:18 +0000 (UTC) From: Stefan Hajnoczi To: Coiby Xu Subject: [PATCH 4/6] block-helpers: use local_err in case errp is NULL Date: Fri, 19 Jun 2020 13:01:55 +0100 Message-Id: <20200619120157.2422429-4-stefanha@redhat.com> In-Reply-To: <20200619120157.2422429-1-stefanha@redhat.com> References: <20200614183907.514282-4-coiby.xu@gmail.com> <20200619120157.2422429-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.120; envelope-from=stefanha@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 03:15:03 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" If we use errp then we won't know when check_block_size() fails when errp is NULL. The purpose of local_err is to detect an error has occurred even if the caller doesn't care about the specific error and has passed a NULL errp. Signed-off-by: Stefan Hajnoczi --- hw/core/qdev-properties.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 28a6d8b2ee..0a651c7d32 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -800,8 +800,9 @@ static void set_blocksize(Object *obj, Visitor *v, const char *name, error_propagate(errp, local_err); return; } - check_block_size(dev->id ? : "", name, value, errp); - if (errp) { + check_block_size(dev->id ? : "", name, value, &local_err); + if (local_err) { + error_propagate(errp, local_err); return; } *ptr = value; From patchwork Fri Jun 19 12:01:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 279998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CCA5C433E0 for ; Fri, 19 Jun 2020 12:11:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A64E207DD for ; Fri, 19 Jun 2020 12:11:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O31z4MYl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A64E207DD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:44070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmFrV-0002Pq-9g for qemu-devel@archiver.kernel.org; Fri, 19 Jun 2020 08:11:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmFj6-0006hh-Ar for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:02:32 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:21458 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jmFj1-0006iS-Dp for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:02:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592568146; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SPgrR4R9Oo9/YK4V8AYXaJYDMLtJ1EvUmM3yk6JzvC0=; b=O31z4MYloWWrgUpGnakrIgFpMN/BvsJxBoHX2F1EY/gBUemjnvPEAH8J4ulYmLUpoeSte5 lqCQ1tnu13ADN3q5vTXFPkhpEuPNkhuZcA/nANsd9skl6yJQJABAK9WaiyFwXdXhkciNN4 TDSvifAzDyNKrISBKzEhKpDp2k19/mg= 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-470-zQKLk9gzNlCluKMkOsxbkg-1; Fri, 19 Jun 2020 08:02:24 -0400 X-MC-Unique: zQKLk9gzNlCluKMkOsxbkg-1 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 C2ECE1005512; Fri, 19 Jun 2020 12:02:23 +0000 (UTC) Received: from localhost (ovpn-113-212.ams2.redhat.com [10.36.113.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58EF27C1EC; Fri, 19 Jun 2020 12:02:23 +0000 (UTC) From: Stefan Hajnoczi To: Coiby Xu Subject: [PATCH 5/6] block-helpers: keep the copyright line from the original file Date: Fri, 19 Jun 2020 13:01:56 +0100 Message-Id: <20200619120157.2422429-5-stefanha@redhat.com> In-Reply-To: <20200619120157.2422429-1-stefanha@redhat.com> References: <20200614183907.514282-4-coiby.xu@gmail.com> <20200619120157.2422429-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=205.139.110.120; envelope-from=stefanha@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 05:19:18 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The check_block_size() code comes from hw/core/qdev-properties.c. Keep the copyright. Signed-off-by: Stefan Hajnoczi --- util/block-helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/block-helpers.c b/util/block-helpers.c index 51d9d02c43..9d12368032 100644 --- a/util/block-helpers.c +++ b/util/block-helpers.c @@ -1,6 +1,7 @@ /* * Block utility functions * + * Copyright IBM, Corp. 2011 * Copyright (c) 2020 Coiby Xu * * This work is licensed under the terms of the GNU GPL, version 2 or later. From patchwork Fri Jun 19 12:01:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 280002 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C1B4C433E0 for ; Fri, 19 Jun 2020 12:04:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02EC62083B for ; Fri, 19 Jun 2020 12:04:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="X1takkdP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02EC62083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmFkq-0000ij-4M for qemu-devel@archiver.kernel.org; Fri, 19 Jun 2020 08:04:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmFj8-0006ng-4y for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:02:34 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:26484 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jmFj6-0006ij-Cf for qemu-devel@nongnu.org; Fri, 19 Jun 2020 08:02:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592568151; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mh585U2B/M9NmLNmH8i/bQ2gYzD5lB7pAuJmwaEMtsE=; b=X1takkdP2Tlr1h9gW7cCy/TZBjpMdfZ1SRYAAFp+zz71xHP58MSZIQ2rbUh3YEsYWgLe0K vFdnspK2JCoBbzqCMUcbp2wzEiYzuJjt1x4YFC9Wrt1xpGHHxAo0l8emBVh4dEcTzgP/5E iBA/ApD3++wlyOuacanU/KyixPOiLv0= 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-271-1qUVzBdaPOif51qCrZ322A-1; Fri, 19 Jun 2020 08:02:29 -0400 X-MC-Unique: 1qUVzBdaPOif51qCrZ322A-1 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 AE90018FE861; Fri, 19 Jun 2020 12:02:28 +0000 (UTC) Received: from localhost (ovpn-113-212.ams2.redhat.com [10.36.113.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id 670707C1EC; Fri, 19 Jun 2020 12:02:25 +0000 (UTC) From: Stefan Hajnoczi To: Coiby Xu Subject: [PATCH 6/6] block-helpers: update doc comment in gtkdoc style Date: Fri, 19 Jun 2020 13:01:57 +0100 Message-Id: <20200619120157.2422429-6-stefanha@redhat.com> In-Reply-To: <20200619120157.2422429-1-stefanha@redhat.com> References: <20200614183907.514282-4-coiby.xu@gmail.com> <20200619120157.2422429-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 01:50:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MIME_BASE64_TEXT=1.741, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: kwolf@redhat.com, bharatlkmlkvm@gmail.com, qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" QEMU uses the gtkdoc style for API doc comments. For examples, see include/qom/object.h. Fully document the function with up-to-date information (the min/max values were outdated). Signed-off-by: Stefan Hajnoczi --- util/block-helpers.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/util/block-helpers.c b/util/block-helpers.c index 9d12368032..c4851432f5 100644 --- a/util/block-helpers.c +++ b/util/block-helpers.c @@ -13,15 +13,17 @@ #include "qapi/qmp/qerror.h" #include "block-helpers.h" -/* - * Logical block size input validation +/** + * check_block_size: + * @id: The unique ID of the object + * @name: The name of the property being validated + * @value: The block size in bytes + * @errp: A pointer to an area to store an error * - * The size should meet the following conditions: - * 1. min=512 - * 2. max=32768 - * 3. a power of 2 - * - * Moved from hw/core/qdev-properties.c:set_blocksize() + * This function checks that the block size meets the following conditions: + * 1. At least MIN_BLOCK_SIZE + * 2. No larger than MAX_BLOCK_SIZE + * 3. A power of 2 */ void check_block_size(const char *id, const char *name, int64_t value, Error **errp)