Drop the SET designation, so that we can reuse these states for
OPT_LIST_META_CONTEXT in the next patch.
---
generator/Makefile.am | 4 +--
generator/state_machine.ml | 6 ++---
...t.c => states-newstyle-opt-meta-context.c} | 26 +++++++++----------
.../states-newstyle-opt-structured-reply.c | 4 +--
generator/states-newstyle.c | 2 +-
5 files changed, 21 insertions(+), 21 deletions(-)
rename generator/{states-newstyle-opt-set-meta-context.c =>
states-newstyle-opt-meta-context.c} (90%)
diff --git a/generator/Makefile.am b/generator/Makefile.am
index d64a953..61f27f4 100644
--- a/generator/Makefile.am
+++ b/generator/Makefile.am
@@ -1,5 +1,5 @@
# nbd client library in userspace
-# Copyright (C) 2013-2019 Red Hat Inc.
+# Copyright (C) 2013-2020 Red Hat Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,7 @@ states_code = \
states-newstyle-opt-export-name.c \
states-newstyle-opt-list.c \
states-newstyle-opt-go.c \
- states-newstyle-opt-set-meta-context.c \
+ states-newstyle-opt-meta-context.c \
states-newstyle-opt-starttls.c \
states-newstyle-opt-structured-reply.c \
states-newstyle.c \
diff --git a/generator/state_machine.ml b/generator/state_machine.ml
index c1fb073..10b6983 100644
--- a/generator/state_machine.ml
+++ b/generator/state_machine.ml
@@ -283,7 +283,7 @@ and newstyle_state_machine = [
*)
Group ("OPT_STARTTLS", newstyle_opt_starttls_state_machine);
Group ("OPT_STRUCTURED_REPLY", newstyle_opt_structured_reply_state_machine);
- Group ("OPT_SET_META_CONTEXT", newstyle_opt_set_meta_context_state_machine);
+ Group ("OPT_META_CONTEXT", newstyle_opt_meta_context_state_machine);
Group ("OPT_GO", newstyle_opt_go_state_machine);
Group ("OPT_EXPORT_NAME", newstyle_opt_export_name_state_machine);
@@ -453,8 +453,8 @@ and newstyle_opt_structured_reply_state_machine = [
};
]
-(* Fixed newstyle NBD_OPT_SET_META_CONTEXT option. *)
-and newstyle_opt_set_meta_context_state_machine = [
+(* Fixed newstyle NBD_OPT_SET/LIST_META_CONTEXT option. *)
+and newstyle_opt_meta_context_state_machine = [
State {
default_state with
name = "START";
diff --git a/generator/states-newstyle-opt-set-meta-context.c
b/generator/states-newstyle-opt-meta-context.c
similarity index 90%
rename from generator/states-newstyle-opt-set-meta-context.c
rename to generator/states-newstyle-opt-meta-context.c
index e2541fa..0dc48af 100644
--- a/generator/states-newstyle-opt-set-meta-context.c
+++ b/generator/states-newstyle-opt-meta-context.c
@@ -16,10 +16,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/* State machine for negotiating NBD_OPT_SET_META_CONTEXT. */
+/* State machine for negotiating NBD_OPT_SET/LIST_META_CONTEXT. */
STATE_MACHINE {
- NEWSTYLE.OPT_SET_META_CONTEXT.START:
+ NEWSTYLE.OPT_META_CONTEXT.START:
size_t i, nr_queries;
uint32_t len;
@@ -52,7 +52,7 @@ STATE_MACHINE {
SET_NEXT_STATE (%SEND);
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND:
+ NEWSTYLE.OPT_META_CONTEXT.SEND:
switch (send_from_wbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -64,7 +64,7 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND_EXPORTNAMELEN:
+ NEWSTYLE.OPT_META_CONTEXT.SEND_EXPORTNAMELEN:
switch (send_from_wbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -75,7 +75,7 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND_EXPORTNAME:
+ NEWSTYLE.OPT_META_CONTEXT.SEND_EXPORTNAME:
switch (send_from_wbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -88,7 +88,7 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND_NRQUERIES:
+ NEWSTYLE.OPT_META_CONTEXT.SEND_NRQUERIES:
switch (send_from_wbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -97,7 +97,7 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.PREPARE_NEXT_QUERY:
+ NEWSTYLE.OPT_META_CONTEXT.PREPARE_NEXT_QUERY:
const char *query = h->request_meta_contexts[h->querynum];
if (query == NULL) { /* end of list of requested meta contexts */
@@ -112,7 +112,7 @@ STATE_MACHINE {
SET_NEXT_STATE (%SEND_QUERYLEN);
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND_QUERYLEN:
+ NEWSTYLE.OPT_META_CONTEXT.SEND_QUERYLEN:
const char *query = h->request_meta_contexts[h->querynum];
switch (send_from_wbuf (h)) {
@@ -124,7 +124,7 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.SEND_QUERY:
+ NEWSTYLE.OPT_META_CONTEXT.SEND_QUERY:
switch (send_from_wbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -133,13 +133,13 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.PREPARE_FOR_REPLY:
+ NEWSTYLE.OPT_META_CONTEXT.PREPARE_FOR_REPLY:
h->rbuf = &h->sbuf.or.option_reply;
h->rlen = sizeof h->sbuf.or.option_reply;
SET_NEXT_STATE (%RECV_REPLY);
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.RECV_REPLY:
+ NEWSTYLE.OPT_META_CONTEXT.RECV_REPLY:
switch (recv_into_rbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0:
@@ -151,14 +151,14 @@ STATE_MACHINE {
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.RECV_REPLY_PAYLOAD:
+ NEWSTYLE.OPT_META_CONTEXT.RECV_REPLY_PAYLOAD:
switch (recv_into_rbuf (h)) {
case -1: SET_NEXT_STATE (%.DEAD); return 0;
case 0: SET_NEXT_STATE (%CHECK_REPLY);
}
return 0;
- NEWSTYLE.OPT_SET_META_CONTEXT.CHECK_REPLY:
+ NEWSTYLE.OPT_META_CONTEXT.CHECK_REPLY:
uint32_t reply;
uint32_t len;
const size_t maxpayload = sizeof h->sbuf.or.payload.context;
diff --git a/generator/states-newstyle-opt-structured-reply.c
b/generator/states-newstyle-opt-structured-reply.c
index 71a4952..8b689a6 100644
--- a/generator/states-newstyle-opt-structured-reply.c
+++ b/generator/states-newstyle-opt-structured-reply.c
@@ -22,7 +22,7 @@ STATE_MACHINE {
NEWSTYLE.OPT_STRUCTURED_REPLY.START:
assert (h->gflags & LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE);
if (!h->request_sr) {
- SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
+ SET_NEXT_STATE (%^OPT_META_CONTEXT.START);
return 0;
}
@@ -87,7 +87,7 @@ STATE_MACHINE {
if (h->opt_mode)
SET_NEXT_STATE (%.NEGOTIATING);
else
- SET_NEXT_STATE (%^OPT_SET_META_CONTEXT.START);
+ SET_NEXT_STATE (%^OPT_META_CONTEXT.START);
return 0;
} /* END STATE MACHINE */
diff --git a/generator/states-newstyle.c b/generator/states-newstyle.c
index 92cf5c9..a0a5928 100644
--- a/generator/states-newstyle.c
+++ b/generator/states-newstyle.c
@@ -123,7 +123,7 @@ STATE_MACHINE {
if ((h->gflags & LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE) == 0)
SET_NEXT_STATE (%OPT_EXPORT_NAME.START);
else
- SET_NEXT_STATE (%OPT_SET_META_CONTEXT.START);
+ SET_NEXT_STATE (%OPT_META_CONTEXT.START);
return 0;
case NBD_OPT_LIST:
SET_NEXT_STATE (%OPT_LIST.START);
--
2.28.0