mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vcpu: remove dead xen code
* src/xen/xen_driver.h (xenUnifiedDriver): Remove now-unused domainGetMaxVcpus, domainSetVcpus. * src/xen/proxy_internal.c (xenProxyDriver): Likewise. * src/xen/xen_hypervisor.c (xenHypervisorDriver): Likewise. * src/xen/xen_inotify.c (xenInotifyDriver): Likewise. * src/xen/xend_internal.c (xenDaemonDriver) (xenDaemonDomainSetVcpus): Likewise. * src/xen/xm_internal.c (xenXMDriver, xenXMDomainSetVcpus): Likewise. * src/xen/xs_internal.c (xenStoreDriver): Likewise.
This commit is contained in:
parent
e443a00312
commit
b013788742
@ -67,10 +67,8 @@ struct xenUnifiedDriver xenProxyDriver = {
|
|||||||
NULL, /* domainSave */
|
NULL, /* domainSave */
|
||||||
NULL, /* domainRestore */
|
NULL, /* domainRestore */
|
||||||
NULL, /* domainCoreDump */
|
NULL, /* domainCoreDump */
|
||||||
NULL, /* domainSetVcpus */
|
|
||||||
NULL, /* domainPinVcpu */
|
NULL, /* domainPinVcpu */
|
||||||
NULL, /* domainGetVcpus */
|
NULL, /* domainGetVcpus */
|
||||||
NULL, /* domainGetMaxVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
NULL, /* listDefinedDomains */
|
||||||
NULL, /* numOfDefinedDomains */
|
NULL, /* numOfDefinedDomains */
|
||||||
NULL, /* domainCreate */
|
NULL, /* domainCreate */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* xen_unified.c: Unified Xen driver.
|
* xen_unified.c: Unified Xen driver.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Red Hat, Inc.
|
* Copyright (C) 2007, 2010 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* See COPYING.LIB for the License of this software
|
* See COPYING.LIB for the License of this software
|
||||||
*
|
*
|
||||||
@ -84,10 +84,8 @@ struct xenUnifiedDriver {
|
|||||||
virDrvDomainSave domainSave;
|
virDrvDomainSave domainSave;
|
||||||
virDrvDomainRestore domainRestore;
|
virDrvDomainRestore domainRestore;
|
||||||
virDrvDomainCoreDump domainCoreDump;
|
virDrvDomainCoreDump domainCoreDump;
|
||||||
virDrvDomainSetVcpus domainSetVcpus;
|
|
||||||
virDrvDomainPinVcpu domainPinVcpu;
|
virDrvDomainPinVcpu domainPinVcpu;
|
||||||
virDrvDomainGetVcpus domainGetVcpus;
|
virDrvDomainGetVcpus domainGetVcpus;
|
||||||
virDrvDomainGetMaxVcpus domainGetMaxVcpus;
|
|
||||||
virDrvListDefinedDomains listDefinedDomains;
|
virDrvListDefinedDomains listDefinedDomains;
|
||||||
virDrvNumOfDefinedDomains numOfDefinedDomains;
|
virDrvNumOfDefinedDomains numOfDefinedDomains;
|
||||||
virDrvDomainCreate domainCreate;
|
virDrvDomainCreate domainCreate;
|
||||||
|
@ -784,10 +784,8 @@ struct xenUnifiedDriver xenHypervisorDriver = {
|
|||||||
NULL, /* domainSave */
|
NULL, /* domainSave */
|
||||||
NULL, /* domainRestore */
|
NULL, /* domainRestore */
|
||||||
NULL, /* domainCoreDump */
|
NULL, /* domainCoreDump */
|
||||||
xenHypervisorSetVcpus, /* domainSetVcpus */
|
|
||||||
xenHypervisorPinVcpu, /* domainPinVcpu */
|
xenHypervisorPinVcpu, /* domainPinVcpu */
|
||||||
xenHypervisorGetVcpus, /* domainGetVcpus */
|
xenHypervisorGetVcpus, /* domainGetVcpus */
|
||||||
xenHypervisorGetVcpuMax, /* domainGetMaxVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
NULL, /* listDefinedDomains */
|
||||||
NULL, /* numOfDefinedDomains */
|
NULL, /* numOfDefinedDomains */
|
||||||
NULL, /* domainCreate */
|
NULL, /* domainCreate */
|
||||||
|
@ -71,10 +71,8 @@ struct xenUnifiedDriver xenInotifyDriver = {
|
|||||||
NULL, /* domainSave */
|
NULL, /* domainSave */
|
||||||
NULL, /* domainRestore */
|
NULL, /* domainRestore */
|
||||||
NULL, /* domainCoreDump */
|
NULL, /* domainCoreDump */
|
||||||
NULL, /* domainSetVcpus */
|
|
||||||
NULL, /* domainPinVcpu */
|
NULL, /* domainPinVcpu */
|
||||||
NULL, /* domainGetVcpus */
|
NULL, /* domainGetVcpus */
|
||||||
NULL, /* domainGetMaxVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
NULL, /* listDefinedDomains */
|
||||||
NULL, /* numOfDefinedDomains */
|
NULL, /* numOfDefinedDomains */
|
||||||
NULL, /* domainCreate */
|
NULL, /* domainCreate */
|
||||||
|
@ -3610,37 +3610,6 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
|
|||||||
buf, NULL);
|
buf, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* xenDaemonDomainSetVcpus:
|
|
||||||
* @domain: pointer to domain object
|
|
||||||
* @nvcpus: the new number of virtual CPUs for this domain
|
|
||||||
*
|
|
||||||
* Dynamically change the number of virtual CPUs used by the domain.
|
|
||||||
*
|
|
||||||
* Returns 0 for success; -1 (with errno) on error
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
xenDaemonDomainSetVcpus(virDomainPtr domain, unsigned int vcpus)
|
|
||||||
{
|
|
||||||
char buf[VIR_UUID_BUFLEN];
|
|
||||||
xenUnifiedPrivatePtr priv;
|
|
||||||
|
|
||||||
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)
|
|
||||||
|| (vcpus < 1)) {
|
|
||||||
virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);
|
|
||||||
return (-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
|
|
||||||
|
|
||||||
if (domain->id < 0 && priv->xendConfigVersion < 3)
|
|
||||||
return(-1);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", vcpus);
|
|
||||||
return(xend_op(domain->conn, domain->name, "op", "set_vcpus", "vcpus",
|
|
||||||
buf, NULL));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xenDaemonDomainPinCpu:
|
* xenDaemonDomainPinCpu:
|
||||||
* @domain: pointer to domain object
|
* @domain: pointer to domain object
|
||||||
@ -5213,10 +5182,8 @@ struct xenUnifiedDriver xenDaemonDriver = {
|
|||||||
xenDaemonDomainSave, /* domainSave */
|
xenDaemonDomainSave, /* domainSave */
|
||||||
xenDaemonDomainRestore, /* domainRestore */
|
xenDaemonDomainRestore, /* domainRestore */
|
||||||
xenDaemonDomainCoreDump, /* domainCoreDump */
|
xenDaemonDomainCoreDump, /* domainCoreDump */
|
||||||
xenDaemonDomainSetVcpus, /* domainSetVcpus */
|
|
||||||
xenDaemonDomainPinVcpu, /* domainPinVcpu */
|
xenDaemonDomainPinVcpu, /* domainPinVcpu */
|
||||||
xenDaemonDomainGetVcpus, /* domainGetVcpus */
|
xenDaemonDomainGetVcpus, /* domainGetVcpus */
|
||||||
NULL, /* domainGetMaxVcpus */
|
|
||||||
xenDaemonListDefinedDomains, /* listDefinedDomains */
|
xenDaemonListDefinedDomains, /* listDefinedDomains */
|
||||||
xenDaemonNumOfDefinedDomains,/* numOfDefinedDomains */
|
xenDaemonNumOfDefinedDomains,/* numOfDefinedDomains */
|
||||||
xenDaemonDomainCreate, /* domainCreate */
|
xenDaemonDomainCreate, /* domainCreate */
|
||||||
|
@ -103,10 +103,8 @@ struct xenUnifiedDriver xenXMDriver = {
|
|||||||
NULL, /* domainSave */
|
NULL, /* domainSave */
|
||||||
NULL, /* domainRestore */
|
NULL, /* domainRestore */
|
||||||
NULL, /* domainCoreDump */
|
NULL, /* domainCoreDump */
|
||||||
xenXMDomainSetVcpus, /* domainSetVcpus */
|
|
||||||
xenXMDomainPinVcpu, /* domainPinVcpu */
|
xenXMDomainPinVcpu, /* domainPinVcpu */
|
||||||
NULL, /* domainGetVcpus */
|
NULL, /* domainGetVcpus */
|
||||||
NULL, /* domainGetMaxVcpus */
|
|
||||||
xenXMListDefinedDomains, /* listDefinedDomains */
|
xenXMListDefinedDomains, /* listDefinedDomains */
|
||||||
xenXMNumOfDefinedDomains, /* numOfDefinedDomains */
|
xenXMNumOfDefinedDomains, /* numOfDefinedDomains */
|
||||||
xenXMDomainCreate, /* domainCreate */
|
xenXMDomainCreate, /* domainCreate */
|
||||||
@ -1629,47 +1627,6 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Set the VCPU count in config
|
|
||||||
*/
|
|
||||||
int xenXMDomainSetVcpus(virDomainPtr domain, unsigned int vcpus) {
|
|
||||||
xenUnifiedPrivatePtr priv;
|
|
||||||
const char *filename;
|
|
||||||
xenXMConfCachePtr entry;
|
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) {
|
|
||||||
xenXMError(VIR_ERR_INVALID_ARG, __FUNCTION__);
|
|
||||||
return (-1);
|
|
||||||
}
|
|
||||||
if (domain->conn->flags & VIR_CONNECT_RO)
|
|
||||||
return (-1);
|
|
||||||
if (domain->id != -1)
|
|
||||||
return (-1);
|
|
||||||
|
|
||||||
priv = domain->conn->privateData;
|
|
||||||
xenUnifiedLock(priv);
|
|
||||||
|
|
||||||
if (!(filename = virHashLookup(priv->nameConfigMap, domain->name)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!(entry = virHashLookup(priv->configCache, filename)))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
entry->def->maxvcpus = entry->def->vcpus = vcpus;
|
|
||||||
|
|
||||||
/* If this fails, should we try to undo our changes to the
|
|
||||||
* in-memory representation of the config file. I say not!
|
|
||||||
*/
|
|
||||||
if (xenXMConfigSaveFile(domain->conn, entry->filename, entry->def) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
xenUnifiedUnlock(priv);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xenXMDomainSetVcpusFlags:
|
* xenXMDomainSetVcpusFlags:
|
||||||
* @domain: pointer to domain object
|
* @domain: pointer to domain object
|
||||||
|
@ -67,10 +67,8 @@ struct xenUnifiedDriver xenStoreDriver = {
|
|||||||
NULL, /* domainSave */
|
NULL, /* domainSave */
|
||||||
NULL, /* domainRestore */
|
NULL, /* domainRestore */
|
||||||
NULL, /* domainCoreDump */
|
NULL, /* domainCoreDump */
|
||||||
NULL, /* domainSetVcpus */
|
|
||||||
NULL, /* domainPinVcpu */
|
NULL, /* domainPinVcpu */
|
||||||
NULL, /* domainGetVcpus */
|
NULL, /* domainGetVcpus */
|
||||||
NULL, /* domainGetMaxVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
NULL, /* listDefinedDomains */
|
||||||
NULL, /* numOfDefinedDomains */
|
NULL, /* numOfDefinedDomains */
|
||||||
NULL, /* domainCreate */
|
NULL, /* domainCreate */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user