/*-1* Copyright (c) 2012, 2013 Spectra Logic Corporation2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions, and the following disclaimer,9* without modification.10* 2. Redistributions in binary form must reproduce at minimum a disclaimer11* substantially similar to the "NO WARRANTY" disclaimer below12* ("Disclaimer") and any redistribution must be conditioned upon13* including a substantially similar Disclaimer requirement for further14* binary redistribution.15*16* NO WARRANTY17* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS18* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT19* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR20* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT21* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL22* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS23* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)24* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,25* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING26* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE27* POSSIBILITY OF SUCH DAMAGES.28*29* Authors: Alan Somers (Spectra Logic Corporation)30*/3132/**33* \file zfsd_main.cc34*35* main function for the ZFS Daemon. Separated to facilitate testing.36*37*/3839#include <sys/cdefs.h>4041#include <cstdlib>42#include <cstdio>43#include <unistd.h>4445#include <list>46#include <map>47#include <string>4849#include <devdctl/guid.h>50#include <devdctl/event.h>51#include <devdctl/event_factory.h>52#include <devdctl/exception.h>53#include <devdctl/consumer.h>5455#include "vdev_iterator.h"56#include "zfsd.h"57/*=============================== Program Main ===============================*/58static void59usage()60{61fprintf(stderr, "usage: %s [-d]\n", getprogname());62exit(1);63}6465/**66* Program entry point.67*/68int69main(int argc, char **argv)70{71int ch;7273while ((ch = getopt(argc, argv, "d")) != -1) {74switch (ch) {75case 'd':76g_debug++;77break;78default:79usage();80}81}8283ZfsDaemon::Run();8485return (0);86}878889