Message ID | 20180702105019.10345-23-jkbs@redhat.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <ovs-dev-bounces@openvswitch.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41K475177pz9s29 for <incoming@patchwork.ozlabs.org>; Mon, 2 Jul 2018 21:01:04 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EB3F7D3E; Mon, 2 Jul 2018 10:51:16 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9E4A2D36 for <dev@openvswitch.org>; Mon, 2 Jul 2018 10:51:15 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0053F691 for <dev@openvswitch.org>; Mon, 2 Jul 2018 10:51:14 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id k7-v6so11554196wrq.0 for <dev@openvswitch.org>; Mon, 02 Jul 2018 03:51:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=DG24iJq1k+KT3Q9wRM3PqtdRfuielTPAWe24qyG61qI=; b=sXdbK+2CkoT01D5urNmlOjHpwNWuM3OendrbyuV1dIVkAYykOUFkNw9Gbk0Y2i8hnF uxG5BDbCE1R3mwJdm7aFQFi8hPpIfhsHZNbrrVMEEHdZLJ2rkAdQ4NDZElaFux3dFrD/ Ao5R8B4t8/u0Stm849eaS9UYJm2O6Wl7FA8l/A3ry4QwVqGnSSrcjKs5N5djh+SikjMY PdOB7iR7cqK456W5FGwR3gxbZwvT/dJLWSq874vqE3662OrBKPWFs2g5UEpHb0+Ts7sJ cIH631Lvd8BdpRzkkSc4wUtqjTUnAXQ/2YgpVSnq2uLd/R1zIbLDwafsc6h4hXLdLM1s PNow== X-Gm-Message-State: APt69E0i3iC3lNU8jbUFt34IJd3Ah4/ZKt5GkO0kZhhlvkm9Bwvm9JLP bsu9z+CYq+rbYtQ5iT1tbWqEwG7Inrg= X-Google-Smtp-Source: AAOMgpeF8D9s6qTeSaaf773MvnjZ0CW1mYr8t6QUAnJFA0MbSGHX9zXZEvOsC/QuZc+HxoXsugOD6w== X-Received: by 2002:adf:dd8e:: with SMTP id x14-v6mr16286662wrl.212.1530528673451; Mon, 02 Jul 2018 03:51:13 -0700 (PDT) Received: from redhat.com (218.red-2-136-166.dynamicip.rima-tde.net. [2.136.166.218]) by smtp.gmail.com with ESMTPSA id n16-v6sm4893263wrg.58.2018.07.02.03.51.12 for <dev@openvswitch.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 03:51:12 -0700 (PDT) From: Jakub Sitnicki <jkbs@redhat.com> To: dev@openvswitch.org Date: Mon, 2 Jul 2018 12:50:18 +0200 Message-Id: <20180702105019.10345-23-jkbs@redhat.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180702105019.10345-1-jkbs@redhat.com> References: <20180702105019.10345-1-jkbs@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 22/23] db-ctl-base: Don't die in cmd_clear() on error. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: <ovs-dev.openvswitch.org> List-Unsubscribe: <https://mail.openvswitch.org/mailman/options/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe> List-Archive: <http://mail.openvswitch.org/pipermail/ovs-dev/> List-Post: <mailto:ovs-dev@openvswitch.org> List-Help: <mailto:ovs-dev-request@openvswitch.org?subject=help> List-Subscribe: <https://mail.openvswitch.org/mailman/listinfo/ovs-dev>, <mailto:ovs-dev-request@openvswitch.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org |
Series |
Don't use ctl_fatal() in command handlers from db-ctl-base
|
expand
|
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c index 585cf67a0..f5492aadb 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -1661,9 +1661,10 @@ cmd_clear(struct ctl_context *ctx) type = &column->type; if (type->n_min > 0) { - ctl_fatal("\"clear\" operation cannot be applied to column %s " - "of table %s, which is not allowed to be empty", + ctl_error(ctx, "\"clear\" operation cannot be applied to column " + "%s of table %s, which is not allowed to be empty", column->name, table->name); + return; } ovsdb_datum_init_empty(&datum);
Return the error via the context instead of calling ctl_fatal() so that the caller can decide how to handle it. Signed-off-by: Jakub Sitnicki <jkbs@redhat.com> --- lib/db-ctl-base.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)