2006-03-23 15:42:10 +00:00
|
|
|
/*
|
|
|
|
* xs_internal.h: internal API for access to XenStore
|
|
|
|
*
|
xml: use long long internally, to centralize overflow checks
On 64-bit platforms, unsigned long and unsigned long long are
identical, so we don't have to worry about overflow checks.
On 32-bit platforms, anywhere we narrow unsigned long long back
to unsigned long, we have to worry about overflow; it's easier
to do this in one place by having most of the code use the same
or wider types, and only doing the narrowing at the last minute.
Therefore, the memory set commands remain unsigned long, and
the memory get command now centralizes the overflow check into
libvirt.c, so that drivers don't have to repeat the work.
This also fixes a bug where xen returned the wrong value on
failure (most APIs return -1 on failure, but getMaxMemory
must return 0 on failure).
* src/driver.h (virDrvDomainGetMaxMemory): Use long long.
* src/libvirt.c (virDomainGetMaxMemory): Raise overflow.
* src/test/test_driver.c (testGetMaxMemory): Fix driver.
* src/rpc/gendispatch.pl (name_to_ProcName): Likewise.
* src/xen/xen_hypervisor.c (xenHypervisorGetMaxMemory): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainGetMaxMemory): Likewise.
* src/xen/xend_internal.c (xenDaemonDomainGetMaxMemory):
Likewise.
* src/xen/xend_internal.h (xenDaemonDomainGetMaxMemory):
Likewise.
* src/xen/xm_internal.c (xenXMDomainGetMaxMemory): Likewise.
* src/xen/xm_internal.h (xenXMDomainGetMaxMemory): Likewise.
* src/xen/xs_internal.c (xenStoreDomainGetMaxMemory): Likewise.
* src/xen/xs_internal.h (xenStoreDomainGetMaxMemory): Likewise.
* src/xenapi/xenapi_driver.c (xenapiDomainGetMaxMemory):
Likewise.
* src/esx/esx_driver.c (esxDomainGetMaxMemory): Likewise.
* src/libxl/libxl_driver.c (libxlDomainGetMaxMemory): Likewise.
* src/qemu/qemu_driver.c (qemudDomainGetMaxMemory): Likewise.
* src/lxc/lxc_driver.c (lxcDomainGetMaxMemory): Likewise.
* src/uml/uml_driver.c (umlDomainGetMaxMemory): Likewise.
2012-03-03 00:47:16 +00:00
|
|
|
* Copyright (C) 2006, 2010-2012 Red Hat, Inc.
|
2006-03-23 15:42:10 +00:00
|
|
|
*
|
2012-07-27 09:39:53 +00:00
|
|
|
* 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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-27 09:39:53 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2006-03-23 15:42:10 +00:00
|
|
|
*
|
|
|
|
* Daniel Veillard <veillard@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_XS_INTERNAL_H__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __VIR_XS_INTERNAL_H__
|
2006-03-23 15:42:10 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "driver.h"
|
2007-08-10 18:25:15 +00:00
|
|
|
|
2013-04-30 13:41:48 +00:00
|
|
|
int xenStoreOpen (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
virConnectAuthPtr auth,
|
2011-07-06 20:40:19 +00:00
|
|
|
unsigned int flags);
|
2006-04-03 13:46:43 +00:00
|
|
|
int xenStoreClose (virConnectPtr conn);
|
|
|
|
int xenStoreNumOfDomains (virConnectPtr conn);
|
2010-12-21 15:58:03 +00:00
|
|
|
int xenStoreListDomains (virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int *ids,
|
|
|
|
int maxids);
|
2006-08-09 15:21:16 +00:00
|
|
|
|
2006-11-07 16:28:16 +00:00
|
|
|
int xenStoreDomainGetVNCPort(virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int domid);
|
2006-11-07 16:28:16 +00:00
|
|
|
char * xenStoreDomainGetConsolePath(virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int domid);
|
2012-01-03 22:39:59 +00:00
|
|
|
char * xenStoreDomainGetSerialConsolePath(virConnectPtr conn,
|
|
|
|
int domid);
|
2006-11-20 16:42:16 +00:00
|
|
|
char * xenStoreDomainGetNetworkID(virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id,
|
|
|
|
const char *mac);
|
2007-11-06 11:49:01 +00:00
|
|
|
char * xenStoreDomainGetDiskID(virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id,
|
|
|
|
const char *dev);
|
2009-12-22 09:53:51 +00:00
|
|
|
char * xenStoreDomainGetPCIID(virConnectPtr conn,
|
|
|
|
int domid,
|
|
|
|
const char *bdf);
|
2007-08-10 18:25:15 +00:00
|
|
|
char * xenStoreDomainGetName(virConnectPtr conn,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id);
|
2008-11-25 10:44:52 +00:00
|
|
|
int xenStoreDomainGetUUID(virConnectPtr conn,
|
|
|
|
int id,
|
|
|
|
unsigned char *uuid);
|
2006-08-08 20:14:40 +00:00
|
|
|
|
2008-11-25 10:44:52 +00:00
|
|
|
typedef int (*xenStoreWatchCallback)(virConnectPtr conn,
|
|
|
|
const char *path,
|
|
|
|
const char *token,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
struct _xenStoreWatch {
|
|
|
|
char *path;
|
|
|
|
char *token;
|
|
|
|
xenStoreWatchCallback cb;
|
|
|
|
void *opaque;
|
|
|
|
};
|
|
|
|
typedef struct _xenStoreWatch xenStoreWatch;
|
|
|
|
typedef xenStoreWatch *xenStoreWatchPtr;
|
|
|
|
|
|
|
|
struct _xenStoreWatchList {
|
2014-03-07 08:33:31 +00:00
|
|
|
size_t count;
|
2008-11-25 10:44:52 +00:00
|
|
|
xenStoreWatchPtr *watches;
|
|
|
|
};
|
|
|
|
typedef struct _xenStoreWatchList xenStoreWatchList;
|
|
|
|
typedef xenStoreWatchList *xenStoreWatchListPtr;
|
|
|
|
|
|
|
|
|
|
|
|
int xenStoreAddWatch(virConnectPtr conn,
|
|
|
|
const char *path,
|
|
|
|
const char *token,
|
|
|
|
xenStoreWatchCallback cb,
|
|
|
|
void *opaque);
|
|
|
|
int xenStoreRemoveWatch(virConnectPtr conn,
|
|
|
|
const char *path,
|
|
|
|
const char *token);
|
|
|
|
|
|
|
|
/* domain events */
|
|
|
|
int xenStoreDomainIntroduced(virConnectPtr conn,
|
|
|
|
const char *path,
|
|
|
|
const char *token,
|
|
|
|
void *opaque);
|
|
|
|
int xenStoreDomainReleased(virConnectPtr conn,
|
|
|
|
const char *path,
|
|
|
|
const char *token,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int xenStoreDomainEventEmitted(virDomainEventType evt);
|
2006-03-23 15:42:10 +00:00
|
|
|
#endif /* __VIR_XS_INTERNAL_H__ */
|