Print this page
2594 implement graceful shutdown for local zones in zoneadm

@@ -19,10 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  */
 
 #include <assert.h>
 #include <dirent.h>
 #include <errno.h>

@@ -69,10 +70,11 @@
 #define DTD_ELEM_PRESNAP        ((const xmlChar *) "presnap")
 #define DTD_ELEM_PRESTATECHG    ((const xmlChar *) "prestatechange")
 #define DTD_ELEM_PREUNINSTALL   ((const xmlChar *) "preuninstall")
 #define DTD_ELEM_PRIVILEGE      ((const xmlChar *) "privilege")
 #define DTD_ELEM_QUERY          ((const xmlChar *) "query")
+#define DTD_ELEM_SHUTDOWN       ((const xmlChar *) "shutdown")
 #define DTD_ELEM_SYMLINK        ((const xmlChar *) "symlink")
 #define DTD_ELEM_SYSBOOT        ((const xmlChar *) "sysboot")
 #define DTD_ELEM_UNINSTALL      ((const xmlChar *) "uninstall")
 #define DTD_ELEM_USER_CMD       ((const xmlChar *) "user_cmd")
 #define DTD_ELEM_VALIDSNAP      ((const xmlChar *) "validatesnap")

@@ -499,10 +501,19 @@
         struct brand_handle *bhp = (struct brand_handle *)bh;
         return (brand_get_value(bhp, zonename, zonepath, NULL, NULL,
             buf, len, DTD_ELEM_HALT, B_TRUE, B_TRUE));
 }
 
+int
+brand_get_shutdown(brand_handle_t bh, const char *zonename,
+    const char *zonepath, char *buf, size_t len)
+{
+        struct brand_handle *bhp = (struct brand_handle *)bh;
+        return (brand_get_value(bhp, zonename, zonepath, NULL, NULL,
+            buf, len, DTD_ELEM_SHUTDOWN, B_TRUE, B_TRUE));
+}
+
 int
 brand_get_initname(brand_handle_t bh, char *buf, size_t len)
 {
         struct brand_handle *bhp = (struct brand_handle *)bh;
         return (brand_get_value(bhp, NULL, NULL, NULL, NULL,