From patchwork Wed May 13 02:03:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: taoyunxiang X-Patchwork-Id: 1288912 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49MHzh0JF5z9sPF for ; Wed, 13 May 2020 12:04:31 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 31E0D20528; Wed, 13 May 2020 02:04:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZVw5oJMFdKxH; Wed, 13 May 2020 02:04:27 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id BEF15204E8; Wed, 13 May 2020 02:04:26 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 869D6C088A; Wed, 13 May 2020 02:04:26 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id DF3F7C016F for ; Wed, 13 May 2020 02:04:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id C9B35204E8 for ; Wed, 13 May 2020 02:04:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7LGa03T3zz5B for ; Wed, 13 May 2020 02:04:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by silver.osuosl.org (Postfix) with ESMTP id 7A50C204E1 for ; Wed, 13 May 2020 02:04:19 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.7]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15ebb5587a52-bfd60; Wed, 13 May 2020 10:03:51 +0800 (CST) X-RM-TRANSID: 2ee15ebb5587a52-bfd60 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from yun.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee45ebb5586683-d3aed; Wed, 13 May 2020 10:03:50 +0800 (CST) X-RM-TRANSID: 2ee45ebb5586683-d3aed From: Tao YunXiang To: dev@openvswitch.org Date: Wed, 13 May 2020 10:03:39 +0800 Message-Id: <20200513020339.29965-1-taoyunxiang@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <7> References: <7> Cc: Tao YunXiang Subject: [ovs-dev] [PATCH OVN] ovn-nbctl.c: Fix lr-policy-del command X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This change will check the existence of lr-policy uuid. If not, it will print "uuid is not found". Fixes: 1b030874c32("ovn-nbctl.c: Add an optional way to delete router policy by uuid") Author: Tao YunXiang Signed-off-by: Tao YunXiang --- utilities/ovn-nbctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 67b23108f..2dabd27de 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -3642,6 +3642,10 @@ nbctl_lr_policy_del(struct ctl_context *ctx) new_policies[n_policies++] = lr->policies[i]; } } + if (n_policies == lr->n_policies) { + ctl_error(ctx, "uuid is not found"); + } + /* If match is not specified, delete all routing policies with the * specified priority. */ } else {