Blame source/vdo/base/vdoDebug.h

Packit Service d40955
/*
Packit Service d40955
 * Copyright (c) 2020 Red Hat, Inc.
Packit Service d40955
 *
Packit Service d40955
 * This program is free software; you can redistribute it and/or
Packit Service d40955
 * modify it under the terms of the GNU General Public License
Packit Service d40955
 * as published by the Free Software Foundation; either version 2
Packit Service d40955
 * of the License, or (at your option) any later version.
Packit Service d40955
 * 
Packit Service d40955
 * This program is distributed in the hope that it will be useful,
Packit Service d40955
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service d40955
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service d40955
 * GNU General Public License for more details.
Packit Service d40955
 * 
Packit Service d40955
 * You should have received a copy of the GNU General Public License
Packit Service d40955
 * along with this program; if not, write to the Free Software
Packit Service d40955
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit Service d40955
 * 02110-1301, USA. 
Packit Service d40955
 *
Packit Service d40955
 * $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/vdoDebug.h#1 $
Packit Service d40955
 */
Packit Service d40955
Packit Service d40955
#ifndef VDO_DEBUG_H
Packit Service d40955
#define VDO_DEBUG_H
Packit Service d40955
Packit Service d40955
#include "completion.h"
Packit Service d40955
#include "vdo.h"
Packit Service d40955
Packit Service d40955
/**
Packit Service d40955
 * A completion used to pass information to a potentially asynchronous
Packit Service d40955
 * (because it must run in a different zone) extended command.
Packit Service d40955
 *
Packit Service d40955
 * These commands are dispatched according to argv[0], which is of the form
Packit Service d40955
 * "x-some-command-name", and intentionally open ended for debugging.
Packit Service d40955
 *
Packit Service d40955
 * The command "x-log-debug-message" is currently defined to echo the
Packit Service d40955
 * remainder of the arguments into the kernel log via the vdo logger at
Packit Service d40955
 * info level.
Packit Service d40955
 **/
Packit Service d40955
typedef struct vdoCommandCompletion {
Packit Service d40955
  VDOCompletion         completion;
Packit Service d40955
  VDOCompletion         subCompletion;
Packit Service d40955
  VDO                  *vdo;
Packit Service d40955
  int                   argc;
Packit Service d40955
  char                **argv;
Packit Service d40955
} VDOCommandCompletion;
Packit Service d40955
Packit Service d40955
/**
Packit Service d40955
 * Initialize a VDO command completion.
Packit Service d40955
 *
Packit Service d40955
 * @param command       The command completion to initialize.
Packit Service d40955
 * @param vdo           The VDO.
Packit Service d40955
 * @param argc          An argument count.
Packit Service d40955
 * @param argv          An argument vector of length argc.
Packit Service d40955
 *
Packit Service d40955
 * @return VDO_SUCCESS or an error code
Packit Service d40955
 **/
Packit Service d40955
int initializeVDOCommandCompletion(VDOCommandCompletion  *command,
Packit Service d40955
                                   VDO                   *vdo,
Packit Service d40955
                                   int                    argc,
Packit Service d40955
                                   char                 **argv);
Packit Service d40955
Packit Service d40955
/**
Packit Service d40955
 * Destroy a VDO command completion.
Packit Service d40955
 *
Packit Service d40955
 * @param command               The command completion.
Packit Service d40955
 *
Packit Service d40955
 * @return the completion result
Packit Service d40955
 **/
Packit Service d40955
int destroyVDOCommandCompletion(VDOCommandCompletion *command);
Packit Service d40955
Packit Service d40955
/**
Packit Service d40955
 * Perform an asynchronous extended command (usually debugging related).
Packit Service d40955
 *
Packit Service d40955
 * @param completion    The completion embedded in VDOCommandCompletion.
Packit Service d40955
 **/
Packit Service d40955
void executeVDOExtendedCommand(VDOCompletion *completion);
Packit Service d40955
Packit Service d40955
#endif // VDO_DEBUG_H