[libvirt] [PATCHv2 16/14] vcpu: remove dead xen code

Eric Blake eblake at redhat.com
Thu Oct 14 23:11:34 UTC 2010


v2: new patch. To be squashed with 14/14.

* src/xen/xen_driver.h (xenUnifiedDriver): Remove now-unused
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.
---

 src/xen/proxy_internal.c |    1 -
 src/xen/xen_driver.h     |    1 -
 src/xen/xen_hypervisor.c |    1 -
 src/xen/xen_inotify.c    |    1 -
 src/xen/xend_internal.c  |   32 --------------------------------
 src/xen/xm_internal.c    |   42 ------------------------------------------
 src/xen/xs_internal.c    |    1 -
 7 files changed, 0 insertions(+), 79 deletions(-)

diff --git a/src/xen/proxy_internal.c b/src/xen/proxy_internal.c
index 3e122f4..4033727 100644
--- a/src/xen/proxy_internal.c
+++ b/src/xen/proxy_internal.c
@@ -67,7 +67,6 @@ struct xenUnifiedDriver xenProxyDriver = {
     NULL, /* domainSave */
     NULL, /* domainRestore */
     NULL, /* domainCoreDump */
-    NULL, /* domainSetVcpus */
     NULL, /* domainPinVcpu */
     NULL, /* domainGetVcpus */
     NULL, /* listDefinedDomains */
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index e67faba..53f97d4 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -84,7 +84,6 @@ struct xenUnifiedDriver {
         virDrvDomainSave		domainSave;
         virDrvDomainRestore		domainRestore;
         virDrvDomainCoreDump		domainCoreDump;
-        virDrvDomainSetVcpus		domainSetVcpus;
         virDrvDomainPinVcpu		domainPinVcpu;
         virDrvDomainGetVcpus		domainGetVcpus;
         virDrvListDefinedDomains	listDefinedDomains;
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 32f3683..3797865 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -784,7 +784,6 @@ struct xenUnifiedDriver xenHypervisorDriver = {
     NULL, /* domainSave */
     NULL, /* domainRestore */
     NULL, /* domainCoreDump */
-    xenHypervisorSetVcpus, /* domainSetVcpus */
     xenHypervisorPinVcpu, /* domainPinVcpu */
     xenHypervisorGetVcpus, /* domainGetVcpus */
     NULL, /* listDefinedDomains */
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index 9b95d67..9507061 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -71,7 +71,6 @@ struct xenUnifiedDriver xenInotifyDriver = {
     NULL, /* domainSave */
     NULL, /* domainRestore */
     NULL, /* domainCoreDump */
-    NULL, /* domainSetVcpus */
     NULL, /* domainPinVcpu */
     NULL, /* domainGetVcpus */
     NULL, /* listDefinedDomains */
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index ed90459..b90c331 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -3611,37 +3611,6 @@ xenDaemonDomainSetVcpusFlags(virDomainPtr domain, unsigned int vcpus,
 }

 /**
- * 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:
  * @domain: pointer to domain object
  * @vcpu: virtual CPU number
@@ -5213,7 +5182,6 @@ struct xenUnifiedDriver xenDaemonDriver = {
     xenDaemonDomainSave,         /* domainSave */
     xenDaemonDomainRestore,      /* domainRestore */
     xenDaemonDomainCoreDump,     /* domainCoreDump */
-    xenDaemonDomainSetVcpus,     /* domainSetVcpus */
     xenDaemonDomainPinVcpu,      /* domainPinVcpu */
     xenDaemonDomainGetVcpus,     /* domainGetVcpus */
     xenDaemonListDefinedDomains, /* listDefinedDomains */
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 663802b..430d40b 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -103,7 +103,6 @@ struct xenUnifiedDriver xenXMDriver = {
     NULL, /* domainSave */
     NULL, /* domainRestore */
     NULL, /* domainCoreDump */
-    xenXMDomainSetVcpus, /* domainSetVcpus */
     xenXMDomainPinVcpu, /* domainPinVcpu */
     NULL, /* domainGetVcpus */
     xenXMListDefinedDomains, /* listDefinedDomains */
@@ -1629,47 +1628,6 @@ cleanup:
 }

 /*
- * 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:
  * @domain: pointer to domain object
  * @nvcpus: number of vcpus
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 434904c..a9817b1 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -67,7 +67,6 @@ struct xenUnifiedDriver xenStoreDriver = {
     NULL, /* domainSave */
     NULL, /* domainRestore */
     NULL, /* domainCoreDump */
-    NULL, /* domainSetVcpus */
     NULL, /* domainPinVcpu */
     NULL, /* domainGetVcpus */
     NULL, /* listDefinedDomains */
-- 
1.7.2.3




More information about the libvir-list mailing list