* The port status bit OFPPS_LIVE now reflects link aliveness.
- Fedora Packaging:
* OVN services are no longer restarted automatically after upgrade.
+ - Add --cleanup option to command 'ovs-appctl exit' (see ovs-vswitchd(8)).
v2.7.0 - 21 Feb 2017
---------------------
}
static void
-close_dpif_backer(struct dpif_backer *backer)
+close_dpif_backer(struct dpif_backer *backer, bool del)
{
ovs_assert(backer->refcount > 0);
shash_find_and_delete(&all_dpif_backers, backer->type);
free(backer->type);
free(backer->dp_version_string);
+ if (del) {
+ dpif_delete(backer->dpif);
+ }
dpif_close(backer->dpif);
id_pool_destroy(backer->meter_ids);
free(backer);
if (error) {
VLOG_ERR("failed to listen on datapath of type %s: %s",
type, ovs_strerror(error));
- close_dpif_backer(backer);
+ close_dpif_backer(backer, false);
return error;
}
}
static void
-destruct(struct ofproto *ofproto_)
+destruct(struct ofproto *ofproto_, bool del)
{
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
struct ofproto_async_msg *am;
seq_destroy(ofproto->ams_seq);
- close_dpif_backer(ofproto->backer);
+ close_dpif_backer(ofproto->backer, del);
}
static int
*/
struct ofproto *(*alloc)(void);
int (*construct)(struct ofproto *ofproto);
- void (*destruct)(struct ofproto *ofproto);
+ void (*destruct)(struct ofproto *ofproto, bool del);
void (*dealloc)(struct ofproto *ofproto);
/* Performs any periodic activity required by 'ofproto'. It should:
free(usage);
}
- p->ofproto_class->destruct(p);
+ p->ofproto_class->destruct(p, del);
/* We should not postpone this because it involves deleting a listening
* socket which we may want to reopen soon. 'connmgr' may be used by other
}
void
-bridge_exit(void)
+bridge_exit(bool delete_datapath)
{
struct bridge *br, *next_br;
if_notifier_destroy(ifnotifier);
seq_destroy(ifaces_changed);
HMAP_FOR_EACH_SAFE (br, next_br, node, &all_bridges) {
- bridge_destroy(br, false);
+ bridge_destroy(br, delete_datapath);
}
ovsdb_idl_destroy(idl);
}
#ifndef VSWITCHD_BRIDGE_H
#define VSWITCHD_BRIDGE_H 1
+#include <stdbool.h>
+
struct simap;
void bridge_init(const char *remote);
-void bridge_exit(void);
+void bridge_exit(bool delete_datapath);
void bridge_run(void);
void bridge_wait(void);
described below. The command descriptions assume an understanding of
how to configure Open vSwitch.
.SS "GENERAL COMMANDS"
-.IP "\fBexit\fR"
-Causes \fBovs\-vswitchd\fR to gracefully terminate.
+.IP "\fBexit\fR \fI--cleanup\fR"
+Causes \fBovs\-vswitchd\fR to gracefully terminate. If \fI--cleanup\fR
+is specified, release datapath resources configured by \fBovs\-vswitchd\fR.
+Otherwise, datapath flows and other resources remains undeleted.
+.
.IP "\fBqos/show-types\fR \fIinterface\fR"
Queries the interface for a list of Quality of Service types that are
configurable via Open vSwitch for the given \fIinterface\fR.
static char *parse_options(int argc, char *argv[], char **unixctl_path);
OVS_NO_RETURN static void usage(void);
+struct ovs_vswitchd_exit_args {
+ bool *exiting;
+ bool *cleanup;
+};
+
int
main(int argc, char *argv[])
{
char *unixctl_path = NULL;
struct unixctl_server *unixctl;
char *remote;
- bool exiting;
+ bool exiting, cleanup;
+ struct ovs_vswitchd_exit_args exit_args = {&exiting, &cleanup};
int retval;
set_program_name(argv[0]);
if (retval) {
exit(EXIT_FAILURE);
}
- unixctl_command_register("exit", "", 0, 0, ovs_vswitchd_exit, &exiting);
+ unixctl_command_register("exit", "[--cleanup]", 0, 1,
+ ovs_vswitchd_exit, &exit_args);
bridge_init(remote);
free(remote);
exiting = false;
+ cleanup = false;
while (!exiting) {
memory_run();
if (memory_should_report()) {
exiting = true;
}
}
- bridge_exit();
+ bridge_exit(cleanup);
unixctl_server_destroy(unixctl);
service_stop();
}
static void
-ovs_vswitchd_exit(struct unixctl_conn *conn, int argc OVS_UNUSED,
- const char *argv[] OVS_UNUSED, void *exiting_)
+ovs_vswitchd_exit(struct unixctl_conn *conn, int argc,
+ const char *argv[], void *exit_args_)
{
- bool *exiting = exiting_;
- *exiting = true;
+ struct ovs_vswitchd_exit_args *exit_args = exit_args_;
+ *exit_args->exiting = true;
+ *exit_args->cleanup = argc == 2 && !strcmp(argv[1], "--cleanup");
unixctl_command_reply(conn, NULL);
}