mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00:00
Fri Feb 23 08:49:12 IST 2007 Mark McLoughlin <markmc@redhat.com>
* include/libvirt/libvirt.h.in, src/libvirt.c add virDomainGetAutostart(), virDomainSetAutostart(), virNetworkGetAutostart() and virNetworkSetAutostart(). * src/libvirt_sym.version: export the API * src/driver.h: add methods to the driver vtables. * src/proxy_internal.c, src/qemu_internal.c, src/test.c, src/xen_internal.c, src/xend_internal.c, src/xm_internal.c, src/xs_internal.c: set those methods to NULL
This commit is contained in:
parent
d954480892
commit
57a1819881
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
Fri Feb 23 08:49:12 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* include/libvirt/libvirt.h.in, src/libvirt.c add
|
||||||
|
virDomainGetAutostart(), virDomainSetAutostart(),
|
||||||
|
virNetworkGetAutostart() and virNetworkSetAutostart().
|
||||||
|
|
||||||
|
* src/libvirt_sym.version: export the API
|
||||||
|
|
||||||
|
* src/driver.h: add methods to the driver vtables.
|
||||||
|
|
||||||
|
* src/proxy_internal.c, src/qemu_internal.c,
|
||||||
|
src/test.c, src/xen_internal.c, src/xend_internal.c,
|
||||||
|
src/xm_internal.c, src/xs_internal.c: set those
|
||||||
|
methods to NULL
|
||||||
|
|
||||||
Fri Feb 23 08:41:34 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
Fri Feb 23 08:41:34 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
* qemud/conf.[ch]: significantly re-factor qemudLoadConfigXML()
|
* qemud/conf.[ch]: significantly re-factor qemudLoadConfigXML()
|
||||||
|
@ -328,6 +328,11 @@ int virConnectListDefinedDomains (virConnectPtr conn,
|
|||||||
int maxnames);
|
int maxnames);
|
||||||
int virDomainCreate (virDomainPtr domain);
|
int virDomainCreate (virDomainPtr domain);
|
||||||
|
|
||||||
|
int virDomainGetAutostart (virDomainPtr domain,
|
||||||
|
int *autostart);
|
||||||
|
int virDomainSetAutostart (virDomainPtr domain,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
||||||
*/
|
*/
|
||||||
@ -528,6 +533,11 @@ char * virNetworkGetXMLDesc (virNetworkPtr network,
|
|||||||
int flags);
|
int flags);
|
||||||
char * virNetworkGetBridgeName (virNetworkPtr network);
|
char * virNetworkGetBridgeName (virNetworkPtr network);
|
||||||
|
|
||||||
|
int virNetworkGetAutostart (virNetworkPtr network,
|
||||||
|
int *autostart);
|
||||||
|
int virNetworkSetAutostart (virNetworkPtr network,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -328,6 +328,11 @@ int virConnectListDefinedDomains (virConnectPtr conn,
|
|||||||
int maxnames);
|
int maxnames);
|
||||||
int virDomainCreate (virDomainPtr domain);
|
int virDomainCreate (virDomainPtr domain);
|
||||||
|
|
||||||
|
int virDomainGetAutostart (virDomainPtr domain,
|
||||||
|
int *autostart);
|
||||||
|
int virDomainSetAutostart (virDomainPtr domain,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
||||||
*/
|
*/
|
||||||
@ -528,6 +533,11 @@ char * virNetworkGetXMLDesc (virNetworkPtr network,
|
|||||||
int flags);
|
int flags);
|
||||||
char * virNetworkGetBridgeName (virNetworkPtr network);
|
char * virNetworkGetBridgeName (virNetworkPtr network);
|
||||||
|
|
||||||
|
int virNetworkGetAutostart (virNetworkPtr network,
|
||||||
|
int *autostart);
|
||||||
|
int virNetworkSetAutostart (virNetworkPtr network,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
17
src/driver.h
17
src/driver.h
@ -134,6 +134,12 @@ typedef int
|
|||||||
typedef int
|
typedef int
|
||||||
(*virDrvDomainDetachDevice) (virDomainPtr domain,
|
(*virDrvDomainDetachDevice) (virDomainPtr domain,
|
||||||
char *xml);
|
char *xml);
|
||||||
|
typedef int
|
||||||
|
(*virDrvDomainGetAutostart) (virDomainPtr domain,
|
||||||
|
int *autostart);
|
||||||
|
typedef int
|
||||||
|
(*virDrvDomainSetAutostart) (virDomainPtr domain,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
typedef struct _virDriver virDriver;
|
typedef struct _virDriver virDriver;
|
||||||
typedef virDriver *virDriverPtr;
|
typedef virDriver *virDriverPtr;
|
||||||
@ -183,6 +189,8 @@ struct _virDriver {
|
|||||||
virDrvDomainUndefine domainUndefine;
|
virDrvDomainUndefine domainUndefine;
|
||||||
virDrvDomainAttachDevice domainAttachDevice;
|
virDrvDomainAttachDevice domainAttachDevice;
|
||||||
virDrvDomainDetachDevice domainDetachDevice;
|
virDrvDomainDetachDevice domainDetachDevice;
|
||||||
|
virDrvDomainGetAutostart domainGetAutostart;
|
||||||
|
virDrvDomainSetAutostart domainSetAutostart;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
@ -219,6 +227,13 @@ typedef char *
|
|||||||
int flags);
|
int flags);
|
||||||
typedef char *
|
typedef char *
|
||||||
(*virDrvNetworkGetBridgeName) (virNetworkPtr network);
|
(*virDrvNetworkGetBridgeName) (virNetworkPtr network);
|
||||||
|
typedef int
|
||||||
|
(*virDrvNetworkGetAutostart) (virNetworkPtr network,
|
||||||
|
int *autostart);
|
||||||
|
typedef int
|
||||||
|
(*virDrvNetworkSetAutostart) (virNetworkPtr network,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
|
|
||||||
typedef struct _virNetworkDriver virNetworkDriver;
|
typedef struct _virNetworkDriver virNetworkDriver;
|
||||||
typedef virNetworkDriver *virNetworkDriverPtr;
|
typedef virNetworkDriver *virNetworkDriverPtr;
|
||||||
@ -245,6 +260,8 @@ struct _virNetworkDriver {
|
|||||||
virDrvNetworkDestroy networkDestroy;
|
virDrvNetworkDestroy networkDestroy;
|
||||||
virDrvNetworkDumpXML networkDumpXML;
|
virDrvNetworkDumpXML networkDumpXML;
|
||||||
virDrvNetworkGetBridgeName networkGetBridgeName;
|
virDrvNetworkGetBridgeName networkGetBridgeName;
|
||||||
|
virDrvNetworkGetAutostart networkGetAutostart;
|
||||||
|
virDrvNetworkSetAutostart networkSetAutostart;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
126
src/libvirt.c
126
src/libvirt.c
@ -1861,6 +1861,69 @@ virDomainCreate(virDomainPtr domain) {
|
|||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virDomainGetAutostart:
|
||||||
|
* @domain: a domain object
|
||||||
|
*
|
||||||
|
* Return a boolean value indicating whether the domain
|
||||||
|
* configured to be automatically started when the host
|
||||||
|
* machine boots.
|
||||||
|
*
|
||||||
|
* Returns -1 in case of error, 0 in case of success
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
virDomainGetAutostart(virDomainPtr domain,
|
||||||
|
int *autostart) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!VIR_IS_DOMAIN(domain)) {
|
||||||
|
virLibDomainError(domain, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
if (!autostart) {
|
||||||
|
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0;i < domain->conn->nb_drivers;i++) {
|
||||||
|
if ((domain->conn->drivers[i] != NULL) &&
|
||||||
|
(domain->conn->drivers[i]->domainGetAutostart != NULL) &&
|
||||||
|
(domain->conn->drivers[i]->domainGetAutostart(domain, autostart) == 0))
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
virLibConnError(domain->conn, VIR_ERR_CALL_FAILED, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virDomainSetAutostart:
|
||||||
|
* @domain: a domain object
|
||||||
|
*
|
||||||
|
* Configure the domain to be automatically started
|
||||||
|
* when the host machine boots.
|
||||||
|
*
|
||||||
|
* Returns -1 in case of error, 0 in case of success
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
virDomainSetAutostart(virDomainPtr domain,
|
||||||
|
int autostart) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!VIR_IS_DOMAIN(domain)) {
|
||||||
|
virLibDomainError(domain, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0;i < domain->conn->nb_drivers;i++) {
|
||||||
|
if ((domain->conn->drivers[i] != NULL) &&
|
||||||
|
(domain->conn->drivers[i]->domainSetAutostart != NULL) &&
|
||||||
|
(domain->conn->drivers[i]->domainSetAutostart(domain, autostart) == 0))
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
virLibConnError(domain->conn, VIR_ERR_CALL_FAILED, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virDomainSetVcpus:
|
* virDomainSetVcpus:
|
||||||
* @domain: pointer to domain object, or NULL for Domain0
|
* @domain: pointer to domain object, or NULL for Domain0
|
||||||
@ -2766,3 +2829,66 @@ virNetworkGetBridgeName(virNetworkPtr network)
|
|||||||
}
|
}
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virNetworkGetAutostart:
|
||||||
|
* @network: a network object
|
||||||
|
*
|
||||||
|
* Return a boolean value indicating whether the network
|
||||||
|
* configured to be automatically started when the host
|
||||||
|
* machine boots.
|
||||||
|
*
|
||||||
|
* Returns -1 in case of error, 0 in case of success
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
virNetworkGetAutostart(virNetworkPtr network,
|
||||||
|
int *autostart) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!VIR_IS_NETWORK(network)) {
|
||||||
|
virLibNetworkError(network, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
if (!autostart) {
|
||||||
|
virLibNetworkError(network, VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0;i < network->conn->nb_network_drivers;i++) {
|
||||||
|
if ((network->conn->networkDrivers[i] != NULL) &&
|
||||||
|
(network->conn->networkDrivers[i]->networkGetAutostart != NULL) &&
|
||||||
|
(network->conn->networkDrivers[i]->networkGetAutostart(network, autostart) == 0))
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
virLibConnError(network->conn, VIR_ERR_CALL_FAILED, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* virNetworkSetAutostart:
|
||||||
|
* @network: a network object
|
||||||
|
*
|
||||||
|
* Configure the network to be automatically started
|
||||||
|
* when the host machine boots.
|
||||||
|
*
|
||||||
|
* Returns -1 in case of error, 0 in case of success
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
virNetworkSetAutostart(virNetworkPtr network,
|
||||||
|
int autostart) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!VIR_IS_NETWORK(network)) {
|
||||||
|
virLibNetworkError(network, VIR_ERR_INVALID_NETWORK, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0;i < network->conn->nb_network_drivers;i++) {
|
||||||
|
if ((network->conn->networkDrivers[i] != NULL) &&
|
||||||
|
(network->conn->networkDrivers[i]->networkSetAutostart != NULL) &&
|
||||||
|
(network->conn->networkDrivers[i]->networkSetAutostart(network, autostart) == 0))
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
virLibConnError(network->conn, VIR_ERR_CALL_FAILED, __FUNCTION__);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
virConnectListDefinedDomains;
|
virConnectListDefinedDomains;
|
||||||
virConnectNumOfDefinedDomains;
|
virConnectNumOfDefinedDomains;
|
||||||
virDomainUndefine;
|
virDomainUndefine;
|
||||||
|
virDomainGetAutostart;
|
||||||
|
virDomainSetAutostart;
|
||||||
virGetVersion;
|
virGetVersion;
|
||||||
virCopyLastError;
|
virCopyLastError;
|
||||||
virConnSetErrorFunc;
|
virConnSetErrorFunc;
|
||||||
@ -76,6 +78,8 @@
|
|||||||
virNetworkGetUUIDString;
|
virNetworkGetUUIDString;
|
||||||
virNetworkGetXMLDesc;
|
virNetworkGetXMLDesc;
|
||||||
virNetworkGetBridgeName;
|
virNetworkGetBridgeName;
|
||||||
|
virNetworkGetAutostart;
|
||||||
|
virNetworkSetAutostart;
|
||||||
|
|
||||||
local: *;
|
local: *;
|
||||||
};
|
};
|
||||||
|
@ -81,6 +81,8 @@ static virDriver xenProxyDriver = {
|
|||||||
NULL, /* domainUndefine */
|
NULL, /* domainUndefine */
|
||||||
NULL, /* domainAttachDevice */
|
NULL, /* domainAttachDevice */
|
||||||
NULL, /* domainDetachDevice */
|
NULL, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1132,6 +1132,8 @@ static virDriver qemuDriver = {
|
|||||||
qemuUndefine, /* domainUndefine */
|
qemuUndefine, /* domainUndefine */
|
||||||
NULL, /* domainAttachDevice */
|
NULL, /* domainAttachDevice */
|
||||||
NULL, /* domainDetachDevice */
|
NULL, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virNetworkDriver qemuNetworkDriver = {
|
static virNetworkDriver qemuNetworkDriver = {
|
||||||
@ -1150,6 +1152,8 @@ static virNetworkDriver qemuNetworkDriver = {
|
|||||||
qemuNetworkDestroy, /* networkDestroy */
|
qemuNetworkDestroy, /* networkDestroy */
|
||||||
qemuNetworkDumpXML, /* networkDumpXML */
|
qemuNetworkDumpXML, /* networkDumpXML */
|
||||||
qemuNetworkGetBridgeName, /* networkGetBridgeName */
|
qemuNetworkGetBridgeName, /* networkGetBridgeName */
|
||||||
|
NULL, /* networkGetAutostart */
|
||||||
|
NULL, /* networkSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
void qemuRegister(void) {
|
void qemuRegister(void) {
|
||||||
|
@ -125,6 +125,8 @@ static virDriver testDriver = {
|
|||||||
testDomainUndefine, /* domainUndefine */
|
testDomainUndefine, /* domainUndefine */
|
||||||
NULL, /* domainAttachDevice */
|
NULL, /* domainAttachDevice */
|
||||||
NULL, /* domainDetachDevice */
|
NULL, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _testDev {
|
typedef struct _testDev {
|
||||||
|
@ -454,6 +454,8 @@ static virDriver xenHypervisorDriver = {
|
|||||||
NULL, /* domainUndefine */
|
NULL, /* domainUndefine */
|
||||||
NULL, /* domainAttachDevice */
|
NULL, /* domainAttachDevice */
|
||||||
NULL, /* domainDetachDevice */
|
NULL, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
#endif /* !PROXY */
|
#endif /* !PROXY */
|
||||||
|
|
||||||
|
@ -96,7 +96,9 @@ static virDriver xenDaemonDriver = {
|
|||||||
xenDaemonDomainDefineXML, /* domainDefineXML */
|
xenDaemonDomainDefineXML, /* domainDefineXML */
|
||||||
xenDaemonDomainUndefine, /* domainUndefine */
|
xenDaemonDomainUndefine, /* domainUndefine */
|
||||||
xenDaemonAttachDevice, /* domainAttachDevice */
|
xenDaemonAttachDevice, /* domainAttachDevice */
|
||||||
xenDaemonDetachDevice /* domainDetachDevice */
|
xenDaemonDetachDevice, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,6 +106,8 @@ static virDriver xenXMDriver = {
|
|||||||
xenXMDomainUndefine, /* domainUndefine */
|
xenXMDomainUndefine, /* domainUndefine */
|
||||||
NULL, /* domainAttachDevice */
|
NULL, /* domainAttachDevice */
|
||||||
NULL, /* domainDetachDevice */
|
NULL, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -75,6 +75,8 @@ static virDriver xenStoreDriver = {
|
|||||||
NULL, /* domainUndefine */
|
NULL, /* domainUndefine */
|
||||||
NULL, /* domainAttachDevice */
|
NULL, /* domainAttachDevice */
|
||||||
NULL, /* domainDetachDevice */
|
NULL, /* domainDetachDevice */
|
||||||
|
NULL, /* domainGetAutostart */
|
||||||
|
NULL, /* domainSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user