X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=switch%2Fswitch.c;h=4c750613a7ece2281bb7ef439e2a73a82d0f6240;hb=f593e3ab70ab06acbf97cbb0a9f897dc4f078011;hp=1f85b37b83357253c653a67c7ea3f324ab85754e;hpb=9c1b16772cfd8d346be89963ddf6a6d6a87f0cc9;p=sliver-openvswitch.git diff --git a/switch/switch.c b/switch/switch.c index 1f85b37b8..4c750613a 100644 --- a/switch/switch.c +++ b/switch/switch.c @@ -93,13 +93,13 @@ main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); if (argc - optind != 1) { - fatal(0, "missing controller argument; use --help for usage"); + ofp_fatal(0, "missing controller argument; use --help for usage"); } rconn = rconn_create(60, max_backoff); error = rconn_connect(rconn, argv[optind]); if (error == EAFNOSUPPORT) { - fatal(0, "no support for %s vconn", argv[optind]); + ofp_fatal(0, "no support for %s vconn", argv[optind]); } error = dp_new(&dp, dpid, rconn); if (listen_pvconn_name) { @@ -108,12 +108,12 @@ main(int argc, char *argv[]) retval = pvconn_open(listen_pvconn_name, &listen_pvconn); if (retval && retval != EAGAIN) { - fatal(retval, "opening %s", listen_pvconn_name); + ofp_fatal(retval, "opening %s", listen_pvconn_name); } dp_add_listen_pvconn(dp, listen_pvconn); } if (error) { - fatal(error, "could not create datapath"); + ofp_fatal(error, "could not create datapath"); } if (port_list) { add_ports(dp, port_list); @@ -121,7 +121,7 @@ main(int argc, char *argv[]) error = vlog_server_listen(NULL, NULL); if (error) { - fatal(error, "could not listen for vlog connections"); + ofp_fatal(error, "could not listen for vlog connections"); } die_if_already_running(); @@ -149,7 +149,7 @@ add_ports(struct datapath *dp, char *port_list) port = strtok_r(NULL, ",,", &save_ptr)) { int error = dp_add_port(dp, port); if (error) { - fatal(error, "failed to add port %s", port); + ofp_fatal(error, "failed to add port %s", port); } } } @@ -198,12 +198,13 @@ parse_options(int argc, char *argv[]) case 'd': if (strlen(optarg) != 12 || strspn(optarg, "0123456789abcdefABCDEF") != 12) { - fatal(0, "argument to -d or --datapath-id must be " - "exactly 12 hex digits"); + ofp_fatal(0, "argument to -d or --datapath-id must be " + "exactly 12 hex digits"); } dpid = strtoll(optarg, NULL, 16); if (!dpid) { - fatal(0, "argument to -d or --datapath-id must be nonzero"); + ofp_fatal(0, "argument to -d or --datapath-id must " + "be nonzero"); } break; @@ -241,7 +242,7 @@ parse_options(int argc, char *argv[]) case OPT_MAX_BACKOFF: max_backoff = atoi(optarg); if (max_backoff < 1) { - fatal(0, "--max-backoff argument must be at least 1"); + ofp_fatal(0, "--max-backoff argument must be at least 1"); } else if (max_backoff > 3600) { max_backoff = 3600; } @@ -265,7 +266,7 @@ parse_options(int argc, char *argv[]) case 'l': if (listen_pvconn_name) { - fatal(0, "-l or --listen may be only specified once"); + ofp_fatal(0, "-l or --listen may be only specified once"); } listen_pvconn_name = optarg; break;