diff mbox series

[ovs-dev,v2,1/2] lib/db-ctl-base.c: Check that --all option or records argument provided

Message ID 20210328215056.3727457-2-aroytman@gmail.com
State Accepted
Headers show
Series OVSDB CLI destroy command, check that --all or records argument provided | expand

Commit Message

Alexey Roytman March 28, 2021, 9:50 p.m. UTC
From: Alexey Roytman <roytman@il.ibm.com>

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
---
 lib/db-ctl-base.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index e95c77da2..77cc76a9f 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -1823,6 +1823,11 @@  cmd_destroy(struct ctl_context *ctx)
         return;
     }
 
+    if (!delete_all && ctx->argc == 2) {
+        VLOG_WARN("either --all or records argument should be specified");
+        return;
+    }
+
     if (delete_all) {
         const struct ovsdb_idl_row *row;
         const struct ovsdb_idl_row *next_row;