2015-04-15 14:13:22 +00:00
|
|
|
/* -*- c -*-
|
|
|
|
* admin_protocol.x: private protocol for communicating between
|
|
|
|
* remote_internal driver and libvirtd. This protocol is
|
|
|
|
* internal and may change at any time.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014-2015 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Author: Martin Kletzander <mkletzan@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*----- Data types. -----*/
|
|
|
|
|
|
|
|
/* Length of long, but not unbounded, strings.
|
|
|
|
* This is an arbitrary limit designed to stop the decoder from trying
|
|
|
|
* to allocate unbounded amounts of memory when fed with a bad message.
|
|
|
|
*/
|
2015-07-22 09:01:58 +00:00
|
|
|
const ADMIN_STRING_MAX = 4194304;
|
2015-04-15 14:13:22 +00:00
|
|
|
|
|
|
|
/* A long string, which may NOT be NULL. */
|
2015-07-22 09:01:58 +00:00
|
|
|
typedef string admin_nonnull_string<ADMIN_STRING_MAX>;
|
2015-04-15 14:13:22 +00:00
|
|
|
|
|
|
|
/* A long string, which may be NULL. */
|
|
|
|
typedef admin_nonnull_string *admin_string;
|
|
|
|
|
|
|
|
/*----- Protocol. -----*/
|
admin: Rename virAdmConnect to virAdmDaemon
virAdmConnect was named after virConnect, but after some discussions,
most of the APIs called will be working with remote daemon and starting
them virAdmDaemon will make more sense. Only possibly controversal name
is CloseCallback (de)registration, and connecting to the daemon (which
will still be Open/Close), but even this makes sense if one thinks about
the daemon being opened and closed, e.g. as file, etc.
This way all the APIs working with the daemon will start with
virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
and that will better suit with other namings as well (virDomain*,
virAdmServer*, etc.).
Because in virt-admin, the connection name does not refer to a struct
that would have a connect in its name, also adjust 'connname' in
clients. And because it is not used anywhere in the vsh code, move it
from there into each client.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-11-25 15:59:30 +00:00
|
|
|
struct admin_daemon_open_args {
|
2015-04-15 14:13:22 +00:00
|
|
|
unsigned int flags;
|
|
|
|
};
|
|
|
|
|
admin: Rename virAdmConnect to virAdmDaemon
virAdmConnect was named after virConnect, but after some discussions,
most of the APIs called will be working with remote daemon and starting
them virAdmDaemon will make more sense. Only possibly controversal name
is CloseCallback (de)registration, and connecting to the daemon (which
will still be Open/Close), but even this makes sense if one thinks about
the daemon being opened and closed, e.g. as file, etc.
This way all the APIs working with the daemon will start with
virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
and that will better suit with other namings as well (virDomain*,
virAdmServer*, etc.).
Because in virt-admin, the connection name does not refer to a struct
that would have a connect in its name, also adjust 'connname' in
clients. And because it is not used anywhere in the vsh code, move it
from there into each client.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-11-25 15:59:30 +00:00
|
|
|
struct admin_daemon_get_version_ret {
|
2015-10-05 15:17:51 +00:00
|
|
|
unsigned hyper libVer;
|
|
|
|
};
|
|
|
|
|
2015-04-15 14:13:22 +00:00
|
|
|
/* Define the program number, protocol version and procedure numbers here. */
|
|
|
|
const ADMIN_PROGRAM = 0x06900690;
|
|
|
|
const ADMIN_PROTOCOL_VERSION = 1;
|
|
|
|
|
|
|
|
enum admin_procedure {
|
|
|
|
/* Each function must be preceded by a comment providing one or
|
|
|
|
* more annotations:
|
|
|
|
*
|
|
|
|
* - @generate: none|client|server|both
|
|
|
|
*
|
|
|
|
* Whether to generate the dispatch stubs for the server
|
|
|
|
* and/or client code.
|
|
|
|
*
|
|
|
|
* - @readstream: paramnumber
|
|
|
|
* - @writestream: paramnumber
|
|
|
|
*
|
|
|
|
* The @readstream or @writestream annotations let daemon and src/remote
|
|
|
|
* create a stream. The direction is defined from the src/remote point
|
|
|
|
* of view. A readstream transfers data from daemon to src/remote. The
|
|
|
|
* <paramnumber> specifies at which offset the stream parameter is inserted
|
|
|
|
* in the function parameter list.
|
|
|
|
*/
|
|
|
|
/**
|
2015-10-12 15:08:29 +00:00
|
|
|
* @generate: none
|
2015-04-15 14:13:22 +00:00
|
|
|
*/
|
admin: Rename virAdmConnect to virAdmDaemon
virAdmConnect was named after virConnect, but after some discussions,
most of the APIs called will be working with remote daemon and starting
them virAdmDaemon will make more sense. Only possibly controversal name
is CloseCallback (de)registration, and connecting to the daemon (which
will still be Open/Close), but even this makes sense if one thinks about
the daemon being opened and closed, e.g. as file, etc.
This way all the APIs working with the daemon will start with
virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
and that will better suit with other namings as well (virDomain*,
virAdmServer*, etc.).
Because in virt-admin, the connection name does not refer to a struct
that would have a connect in its name, also adjust 'connname' in
clients. And because it is not used anywhere in the vsh code, move it
from there into each client.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-11-25 15:59:30 +00:00
|
|
|
ADMIN_PROC_DAEMON_OPEN = 1,
|
2015-04-15 14:13:22 +00:00
|
|
|
|
|
|
|
/**
|
2015-10-12 15:08:29 +00:00
|
|
|
* @generate: none
|
2015-04-15 14:13:22 +00:00
|
|
|
*/
|
admin: Rename virAdmConnect to virAdmDaemon
virAdmConnect was named after virConnect, but after some discussions,
most of the APIs called will be working with remote daemon and starting
them virAdmDaemon will make more sense. Only possibly controversal name
is CloseCallback (de)registration, and connecting to the daemon (which
will still be Open/Close), but even this makes sense if one thinks about
the daemon being opened and closed, e.g. as file, etc.
This way all the APIs working with the daemon will start with
virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
and that will better suit with other namings as well (virDomain*,
virAdmServer*, etc.).
Because in virt-admin, the connection name does not refer to a struct
that would have a connect in its name, also adjust 'connname' in
clients. And because it is not used anywhere in the vsh code, move it
from there into each client.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-11-25 15:59:30 +00:00
|
|
|
ADMIN_PROC_DAEMON_CLOSE = 2,
|
2015-10-05 15:17:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @generate: both
|
|
|
|
*/
|
admin: Rename virAdmConnect to virAdmDaemon
virAdmConnect was named after virConnect, but after some discussions,
most of the APIs called will be working with remote daemon and starting
them virAdmDaemon will make more sense. Only possibly controversal name
is CloseCallback (de)registration, and connecting to the daemon (which
will still be Open/Close), but even this makes sense if one thinks about
the daemon being opened and closed, e.g. as file, etc.
This way all the APIs working with the daemon will start with
virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
and that will better suit with other namings as well (virDomain*,
virAdmServer*, etc.).
Because in virt-admin, the connection name does not refer to a struct
that would have a connect in its name, also adjust 'connname' in
clients. And because it is not used anywhere in the vsh code, move it
from there into each client.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2015-11-25 15:59:30 +00:00
|
|
|
ADMIN_PROC_DAEMON_GET_VERSION = 3
|
2015-04-15 14:13:22 +00:00
|
|
|
};
|