1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-10 05:17:59 +03:00

Mark XML param for attach/detach APIs const

This commit is contained in:
Daniel P. Berrange 2007-10-15 21:38:56 +00:00
parent 56ba14daa4
commit b4fab30b89
10 changed files with 28 additions and 22 deletions

View File

@ -1,3 +1,9 @@
Mon Oct 15 17:35:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/driver.h, src/libvirt.c, include/libvirt/libvirt.h.in,
include/libvirt/libvirt.h, src/xen_unified.c, src/xend_internal.c,
src/xml.c, src/xml.h: Mark XML param for attach/detach APIs 'const'
Mon Oct 15 15:31:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/test.c, include/libvirt/libvirt.h.in: Remove virDomainRestart

View File

@ -579,8 +579,8 @@ int virDomainGetVcpus (virDomainPtr domain,
*/
#define VIR_GET_CPUMAP(cpumaps,maplen,vcpu) &(cpumaps[(vcpu)*(maplen)])
int virDomainAttachDevice(virDomainPtr domain, char *xml);
int virDomainDetachDevice(virDomainPtr domain, char *xml);
int virDomainAttachDevice(virDomainPtr domain, const char *xml);
int virDomainDetachDevice(virDomainPtr domain, const char *xml);
/*
* NUMA support

View File

@ -579,8 +579,8 @@ int virDomainGetVcpus (virDomainPtr domain,
*/
#define VIR_GET_CPUMAP(cpumaps,maplen,vcpu) &(cpumaps[(vcpu)*(maplen)])
int virDomainAttachDevice(virDomainPtr domain, char *xml);
int virDomainDetachDevice(virDomainPtr domain, char *xml);
int virDomainAttachDevice(virDomainPtr domain, const char *xml);
int virDomainDetachDevice(virDomainPtr domain, const char *xml);
/*
* NUMA support

View File

@ -184,10 +184,10 @@ typedef int
(*virDrvDomainGetMaxVcpus) (virDomainPtr domain);
typedef int
(*virDrvDomainAttachDevice) (virDomainPtr domain,
char *xml);
const char *xml);
typedef int
(*virDrvDomainDetachDevice) (virDomainPtr domain,
char *xml);
const char *xml);
typedef int
(*virDrvDomainGetAutostart) (virDomainPtr domain,
int *autostart);

View File

@ -2602,7 +2602,7 @@ virDomainGetMaxVcpus(virDomainPtr domain)
* Returns 0 in case of success, -1 in case of failure.
*/
int
virDomainAttachDevice(virDomainPtr domain, char *xml)
virDomainAttachDevice(virDomainPtr domain, const char *xml)
{
virConnectPtr conn;
DEBUG("domain=%p, xml=%s", domain, xml);
@ -2634,7 +2634,7 @@ virDomainAttachDevice(virDomainPtr domain, char *xml)
* Returns 0 in case of success, -1 in case of failure.
*/
int
virDomainDetachDevice(virDomainPtr domain, char *xml)
virDomainDetachDevice(virDomainPtr domain, const char *xml)
{
virConnectPtr conn;
DEBUG("domain=%p, xml=%s", domain, xml);

View File

@ -2089,13 +2089,13 @@ remoteDomainUndefine (virDomainPtr domain)
}
static int
remoteDomainAttachDevice (virDomainPtr domain, char *xml)
remoteDomainAttachDevice (virDomainPtr domain, const char *xml)
{
remote_domain_attach_device_args args;
GET_PRIVATE (domain->conn, -1);
make_nonnull_domain (&args.dom, domain);
args.xml = xml;
args.xml = (char *) xml;
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_ATTACH_DEVICE,
(xdrproc_t) xdr_remote_domain_attach_device_args, (char *) &args,
@ -2106,13 +2106,13 @@ remoteDomainAttachDevice (virDomainPtr domain, char *xml)
}
static int
remoteDomainDetachDevice (virDomainPtr domain, char *xml)
remoteDomainDetachDevice (virDomainPtr domain, const char *xml)
{
remote_domain_detach_device_args args;
GET_PRIVATE (domain->conn, -1);
make_nonnull_domain (&args.dom, domain);
args.xml = xml;
args.xml = (char *) xml;
if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_DETACH_DEVICE,
(xdrproc_t) xdr_remote_domain_detach_device_args, (char *) &args,

View File

@ -948,7 +948,7 @@ xenUnifiedDomainUndefine (virDomainPtr dom)
}
static int
xenUnifiedDomainAttachDevice (virDomainPtr dom, char *xml)
xenUnifiedDomainAttachDevice (virDomainPtr dom, const char *xml)
{
GET_PRIVATE(dom->conn);
int i;
@ -962,7 +962,7 @@ xenUnifiedDomainAttachDevice (virDomainPtr dom, char *xml)
}
static int
xenUnifiedDomainDetachDevice (virDomainPtr dom, char *xml)
xenUnifiedDomainDetachDevice (virDomainPtr dom, const char *xml)
{
GET_PRIVATE(dom->conn);
int i;

View File

@ -58,8 +58,8 @@ static virDomainPtr xenDaemonCreateLinux(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags);
static char *xenDaemonDomainGetOSType(virDomainPtr domain);
static int xenDaemonAttachDevice(virDomainPtr domain, char *xml);
static int xenDaemonDetachDevice(virDomainPtr domain, char *xml);
static int xenDaemonAttachDevice(virDomainPtr domain, const char *xml);
static int xenDaemonDetachDevice(virDomainPtr domain, const char *xml);
static int xenDaemonDomainCoreDump(virDomainPtr domain, const char *filename,
int flags);
#endif /* PROXY */
@ -3337,7 +3337,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
* Returns 0 in case of success, -1 in case of failure.
*/
static int
xenDaemonAttachDevice(virDomainPtr domain, char *xml)
xenDaemonAttachDevice(virDomainPtr domain, const char *xml)
{
char *sexpr, *conf, *str;
int hvm = 0, ret;
@ -3396,7 +3396,7 @@ xenDaemonAttachDevice(virDomainPtr domain, char *xml)
* Returns 0 in case of success, -1 in case of failure.
*/
static int
xenDaemonDetachDevice(virDomainPtr domain, char *xml)
xenDaemonDetachDevice(virDomainPtr domain, const char *xml)
{
char class[8], ref[80];

View File

@ -1335,7 +1335,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int
* the caller must free() the returned value.
*/
char *
virParseXMLDevice(virConnectPtr conn, char *xmldesc, int hvm, int xendConfigVersion)
virParseXMLDevice(virConnectPtr conn, const char *xmldesc, int hvm, int xendConfigVersion)
{
xmlDocPtr xml = NULL;
xmlNodePtr node;
@ -1396,7 +1396,7 @@ virParseXMLDevice(virConnectPtr conn, char *xmldesc, int hvm, int xendConfigVers
* Returns 0 in case of success, -1 in case of failure.
*/
int
virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref, int ref_len)
virDomainXMLDevID(virDomainPtr domain, const char *xmldesc, char *class, char *ref, int ref_len)
{
xmlDocPtr xml = NULL;
xmlNodePtr node, cur;

View File

@ -32,8 +32,8 @@ int virXPathNodeSet (const char *xpath,
xmlNodePtr **list);
char *virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name, int xendConfigVersion);
char *virParseXMLDevice(virConnectPtr conn, char *xmldesc, int hvm, int xendConfigVersion);
int virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref, int ref_len);
char *virParseXMLDevice(virConnectPtr conn, const char *xmldesc, int hvm, int xendConfigVersion);
int virDomainXMLDevID(virDomainPtr domain, const char *xmldesc, char *class, char *ref, int ref_len);
#ifdef __cplusplus
}