[libvirt] [PATCH] Split virDomainMigrate into functions.
by Chris Lalancette
Re-factor virDomainMigrate to split out the version 1 and version 2
protocols into their own functions. In reality, the two versions share
very little in common, so forcing them together in the same function was
just confusing. This will also make adding tunnelled migration easier.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/libvirt.c | 258 ++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 155 insertions(+), 103 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 9fd864d..6c1cc3d 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2874,6 +2874,146 @@ error:
}
+static virDomainPtr
+virDomainMigrateVersion1 (virDomainPtr domain,
+ virConnectPtr dconn,
+ unsigned long flags,
+ const char *dname,
+ const char *uri,
+ unsigned long bandwidth)
+{
+ virDomainPtr ddomain = NULL;
+ char *uri_out = NULL;
+ char *cookie = NULL;
+ int cookielen = 0;
+
+ /* Prepare the migration.
+ *
+ * The destination host may return a cookie, or leave cookie as
+ * NULL.
+ *
+ * The destination host MUST set uri_out if uri_in is NULL.
+ *
+ * If uri_in is non-NULL, then the destination host may modify
+ * the URI by setting uri_out. If it does not wish to modify
+ * the URI, it should leave uri_out as NULL.
+ */
+ if (dconn->driver->domainMigratePrepare
+ (dconn, &cookie, &cookielen, uri, &uri_out, flags, dname,
+ bandwidth) == -1)
+ goto done;
+
+ if (uri == NULL && uri_out == NULL) {
+ virLibConnError (domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("domainMigratePrepare did not set uri"));
+ goto done;
+ }
+ if (uri_out)
+ uri = uri_out; /* Did domainMigratePrepare change URI? */
+ assert (uri != NULL);
+
+ /* Perform the migration. The driver isn't supposed to return
+ * until the migration is complete.
+ */
+ if (domain->conn->driver->domainMigratePerform
+ (domain, cookie, cookielen, uri, flags, dname, bandwidth) == -1)
+ goto done;
+
+ /* Get the destination domain and return it or error.
+ * 'domain' no longer actually exists at this point
+ * (or so we hope), but we still use the object in memory
+ * in order to get the name.
+ */
+ dname = dname ? dname : domain->name;
+ if (dconn->driver->domainMigrateFinish)
+ ddomain = dconn->driver->domainMigrateFinish
+ (dconn, dname, cookie, cookielen, uri, flags);
+ else
+ ddomain = virDomainLookupByName (dconn, dname);
+
+ done:
+ VIR_FREE (uri_out);
+ VIR_FREE (cookie);
+ return ddomain;
+}
+
+static virDomainPtr
+virDomainMigrateVersion2 (virDomainPtr domain,
+ virConnectPtr dconn,
+ unsigned long flags,
+ const char *dname,
+ const char *uri,
+ unsigned long bandwidth)
+{
+ virDomainPtr ddomain = NULL;
+ char *uri_out = NULL;
+ char *cookie = NULL;
+ char *dom_xml = NULL;
+ int cookielen = 0, ret;
+
+ /* Prepare the migration.
+ *
+ * The destination host may return a cookie, or leave cookie as
+ * NULL.
+ *
+ * The destination host MUST set uri_out if uri_in is NULL.
+ *
+ * If uri_in is non-NULL, then the destination host may modify
+ * the URI by setting uri_out. If it does not wish to modify
+ * the URI, it should leave uri_out as NULL.
+ */
+
+ /* In version 2 of the protocol, the prepare step is slightly
+ * different. We fetch the domain XML of the source domain
+ * and pass it to Prepare2.
+ */
+ if (!domain->conn->driver->domainDumpXML) {
+ virLibConnError (domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
+ return NULL;
+ }
+ dom_xml = domain->conn->driver->domainDumpXML (domain,
+ VIR_DOMAIN_XML_SECURE);
+ if (!dom_xml)
+ return NULL;
+
+ ret = dconn->driver->domainMigratePrepare2
+ (dconn, &cookie, &cookielen, uri, &uri_out, flags, dname,
+ bandwidth, dom_xml);
+ VIR_FREE (dom_xml);
+ if (ret == -1)
+ goto done;
+
+ if (uri == NULL && uri_out == NULL) {
+ virLibConnError (domain->conn, VIR_ERR_INTERNAL_ERROR,
+ _("domainMigratePrepare2 did not set uri"));
+ goto done;
+ }
+ if (uri_out)
+ uri = uri_out; /* Did domainMigratePrepare2 change URI? */
+ assert (uri != NULL);
+
+ /* Perform the migration. The driver isn't supposed to return
+ * until the migration is complete.
+ */
+ ret = domain->conn->driver->domainMigratePerform
+ (domain, cookie, cookielen, uri, flags, dname, bandwidth);
+ if (ret == -1)
+ goto done;
+
+ /* In version 2 of the migration protocol, we pass the
+ * status code from the sender to the destination host,
+ * so it can do any cleanup if the migration failed.
+ */
+ dname = dname ? dname : domain->name;
+ ddomain = dconn->driver->domainMigrateFinish2
+ (dconn, dname, cookie, cookielen, uri, flags, ret);
+
+ done:
+ VIR_FREE (uri_out);
+ VIR_FREE (cookie);
+ return ddomain;
+}
+
/**
* virDomainMigrate:
* @domain: a domain object
@@ -2930,140 +3070,52 @@ virDomainMigrate (virDomainPtr domain,
const char *uri,
unsigned long bandwidth)
{
- virConnectPtr conn;
virDomainPtr ddomain = NULL;
- char *uri_out = NULL;
- char *cookie = NULL;
- char *dom_xml = NULL;
- int cookielen = 0, ret, version = 0;
DEBUG("domain=%p, dconn=%p, flags=%lu, dname=%s, uri=%s, bandwidth=%lu",
domain, dconn, flags, NULLSTR(dname), NULLSTR(uri), bandwidth);
virResetLastError();
+ /* First checkout the source */
if (!VIR_IS_CONNECTED_DOMAIN (domain)) {
virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
return NULL;
}
- conn = domain->conn; /* Source connection. */
- if (!VIR_IS_CONNECT (dconn)) {
- virLibConnError (conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
+ if (domain->conn->flags & VIR_CONNECT_RO) {
+ virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
goto error;
}
- if (domain->conn->flags & VIR_CONNECT_RO) {
- virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ /* Now checkout the destination */
+ if (!VIR_IS_CONNECT (dconn)) {
+ virLibConnError (domain->conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
goto error;
}
if (dconn->flags & VIR_CONNECT_RO) {
- /* NB, delibrately report error against source object, not dest here */
- virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ /* NB, deliberately report error against source object, not dest */
+ virLibDomainError (domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__);
goto error;
}
/* Check that migration is supported by both drivers. */
- if (VIR_DRV_SUPPORTS_FEATURE (conn->driver, conn,
+ if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_V1) &&
VIR_DRV_SUPPORTS_FEATURE (dconn->driver, dconn,
VIR_DRV_FEATURE_MIGRATION_V1))
- version = 1;
- else if (VIR_DRV_SUPPORTS_FEATURE (conn->driver, conn,
+ ddomain = virDomainMigrateVersion1 (domain, dconn, flags, dname, uri, bandwidth);
+ else if (VIR_DRV_SUPPORTS_FEATURE (domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_V2) &&
VIR_DRV_SUPPORTS_FEATURE (dconn->driver, dconn,
VIR_DRV_FEATURE_MIGRATION_V2))
- version = 2;
+ ddomain = virDomainMigrateVersion2 (domain, dconn, flags, dname, uri, bandwidth);
else {
- virLibConnError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
+ virLibConnError (domain->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
goto error;
}
- /* Prepare the migration.
- *
- * The destination host may return a cookie, or leave cookie as
- * NULL.
- *
- * The destination host MUST set uri_out if uri_in is NULL.
- *
- * If uri_in is non-NULL, then the destination host may modify
- * the URI by setting uri_out. If it does not wish to modify
- * the URI, it should leave uri_out as NULL.
- */
- if (version == 1) {
- ret = dconn->driver->domainMigratePrepare
- (dconn, &cookie, &cookielen, uri, &uri_out, flags, dname,
- bandwidth);
- if (ret == -1) goto done;
- if (uri == NULL && uri_out == NULL) {
- virLibConnError (conn, VIR_ERR_INTERNAL_ERROR,
- _("domainMigratePrepare did not set uri"));
- goto done;
- }
- if (uri_out) uri = uri_out; /* Did domainMigratePrepare change URI? */
-
- assert (uri != NULL);
- }
- else /* if (version == 2) */ {
- /* In version 2 of the protocol, the prepare step is slightly
- * different. We fetch the domain XML of the source domain
- * and pass it to Prepare2.
- */
- if (!conn->driver->domainDumpXML) {
- virLibConnError (conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
- goto error;
- }
- dom_xml = conn->driver->domainDumpXML (domain,
- VIR_DOMAIN_XML_SECURE);
-
- if (!dom_xml)
- goto error;
-
- ret = dconn->driver->domainMigratePrepare2
- (dconn, &cookie, &cookielen, uri, &uri_out, flags, dname,
- bandwidth, dom_xml);
- VIR_FREE (dom_xml);
- if (ret == -1) goto done;
- if (uri == NULL && uri_out == NULL) {
- virLibConnError (conn, VIR_ERR_INTERNAL_ERROR,
- _("domainMigratePrepare2 did not set uri"));
- goto done;
- }
- if (uri_out) uri = uri_out; /* Did domainMigratePrepare2 change URI? */
+ if (ddomain == NULL)
+ goto error;
- assert (uri != NULL);
- }
-
- /* Perform the migration. The driver isn't supposed to return
- * until the migration is complete.
- */
- ret = conn->driver->domainMigratePerform
- (domain, cookie, cookielen, uri, flags, dname, bandwidth);
-
- if (version == 1) {
- if (ret == -1) goto done;
- /* Get the destination domain and return it or error.
- * 'domain' no longer actually exists at this point
- * (or so we hope), but we still use the object in memory
- * in order to get the name.
- */
- dname = dname ? dname : domain->name;
- if (dconn->driver->domainMigrateFinish)
- ddomain = dconn->driver->domainMigrateFinish
- (dconn, dname, cookie, cookielen, uri, flags);
- else
- ddomain = virDomainLookupByName (dconn, dname);
- } else /* if (version == 2) */ {
- /* In version 2 of the migration protocol, we pass the
- * status code from the sender to the destination host,
- * so it can do any cleanup if the migration failed.
- */
- dname = dname ? dname : domain->name;
- ddomain = dconn->driver->domainMigrateFinish2
- (dconn, dname, cookie, cookielen, uri, flags, ret);
- }
-
- done:
- VIR_FREE (uri_out);
- VIR_FREE (cookie);
return ddomain;
error:
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Fix QEMU domain status after restore.
by Chris Lalancette
When doing a restore, we were forgetting to update the state file
for the VM. That means that if you do a save/restore, then shut
down libvirtd, then start it back up, you'll see the state of the
guest as "paused", even though it is really running. We were
just forgetting a "virDomainSaveStatus" call in the restor path.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/qemu_driver.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 1fb2417..d789c4d 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -4099,6 +4099,7 @@ static int qemudDomainRestore(virConnectPtr conn,
}
VIR_FREE(info);
vm->state = VIR_DOMAIN_RUNNING;
+ virDomainSaveStatus(conn, driver->stateDir, vm);
}
ret = 0;
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Run 'cont' on successful migration finish.
by Chris Lalancette
As of qemu 0.10.6, qemu now honors the -S flag on incoming migration.
That means that when the migration completes, we have to issue a
'cont' command to get the VM running again. We do it unconditionally
since it won't hurt on older qemu.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/qemu_driver.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index bcacd41..1fb2417 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -6600,7 +6600,18 @@ qemudDomainMigrateFinish2 (virConnectPtr dconn,
*/
if (retcode == 0) {
dom = virGetDomain (dconn, vm->def->name, vm->def->uuid);
+
+ /* run 'cont' on the destination, which allows migration on qemu
+ * >= 0.10.6 to work properly. This isn't strictly necessary on
+ * older qemu's, but it also doesn't hurt anything there
+ */
+ if (qemudMonitorCommand(vm, "cont", &info) < 0) {
+ qemudReportError(dconn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("resume operation failed"));
+ goto cleanup;
+ }
VIR_FREE(info);
+
vm->state = VIR_DOMAIN_RUNNING;
event = virDomainEventNewFromObj(vm,
VIR_DOMAIN_EVENT_RESUMED,
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Fix up a stray whitespace in virHashGrow.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/hash.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/hash.c b/src/hash.c
index bde3a0b..9308c0c 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -141,7 +141,7 @@ virHashGrow(virHashTablePtr table, int size)
}
table->size = size;
- /* If the two loops are merged, there would be situations where
+ /* If the two loops are merged, there would be situations where
* a new entry needs to allocated and data copied into it from
* the main table. So instead, we run through the array twice, first
* copying all the elements in the main array (where we can't get
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Fix up a whitespace in comments in src/console.c
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/console.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/console.c b/src/console.c
index badb62c..4a1a80b 100644
--- a/src/console.c
+++ b/src/console.c
@@ -78,7 +78,7 @@ int vshRunConsole(const char *tty) {
return -1;
}
- /* Put STDIN into raw mode so that stuff typed
+ /* Put STDIN into raw mode so that stuff typed
does not echo to the screen (the TTY reads will
result in it being echoed back already), and
also ensure Ctrl-C, etc is blocked, and misc
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Minor cleanup of error path for c_oneVmInfo.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/opennebula/one_client.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/opennebula/one_client.c b/src/opennebula/one_client.c
index d1641bf..21f303a 100644
--- a/src/opennebula/one_client.c
+++ b/src/opennebula/one_client.c
@@ -176,6 +176,7 @@ int c_oneVmInfo(int vmid, char* ret_info,int length)
xmlrpc_value *resultP;
int return_code;
char *return_string;
+ int retval = -1;
resultP = xmlrpc_client_call(&one_client.env, one_client.url,
"one.vmget_info", "(si)", one_client.session, vmid);
@@ -188,18 +189,13 @@ int c_oneVmInfo(int vmid, char* ret_info,int length)
strncpy(ret_info, return_string, length-1);
ret_info[length-1] = '\0';
- xmlrpc_DECREF(resultP);
- free(return_string);
-
- return 0;
+ retval = 0;
}
- else
- {
- xmlrpc_DECREF(resultP);
- free(return_string);
- return -1;
- }
+ xmlrpc_DECREF(resultP);
+ free(return_string);
+
+ return retval;
}
void c_oneFree()
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Make openvzGetVPSUUID take a len.
by Chris Lalancette
Minor fix to openvzGetVPSUUID to make it take a length parameter.
This ensures that it doesn't make assumptions about the length
of the UUID buffer, and paves the way for removal of strncpy in
the future.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/openvz_conf.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
index 6e9af67..a172fe3 100644
--- a/src/openvz_conf.c
+++ b/src/openvz_conf.c
@@ -54,7 +54,7 @@
#define VIR_FROM_THIS VIR_FROM_OPENVZ
static char *openvzLocateConfDir(void);
-static int openvzGetVPSUUID(int vpsid, char *uuidstr);
+static int openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len);
static int openvzLocateConfFile(int vpsid, char *conffile, int maxlen, const char *ext);
static int openvzAssignUUIDs(void);
@@ -469,7 +469,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
if (virAsprintf(&dom->def->name, "%i", veid) < 0)
goto no_memory;
- openvzGetVPSUUID(veid, uuidstr);
+ openvzGetVPSUUID(veid, uuidstr, sizeof(uuidstr));
ret = virUUIDParse(uuidstr, dom->def->uuid);
if (ret == -1) {
@@ -805,7 +805,7 @@ openvz_readline(int fd, char *ptr, int maxlen)
}
static int
-openvzGetVPSUUID(int vpsid, char *uuidstr)
+openvzGetVPSUUID(int vpsid, char *uuidstr, size_t len)
{
char conf_file[PATH_MAX];
char line[1024];
@@ -832,7 +832,7 @@ openvzGetVPSUUID(int vpsid, char *uuidstr)
sscanf(line, "%s %s\n", iden, uuidbuf);
if(STREQ(iden, "#UUID:")) {
- strncpy(uuidstr, uuidbuf, VIR_UUID_STRING_BUFLEN);
+ strncpy(uuidstr, uuidbuf, len);
break;
}
}
@@ -856,7 +856,7 @@ openvzSetDefinedUUID(int vpsid, unsigned char *uuid)
if (openvzLocateConfFile(vpsid, conf_file, PATH_MAX, "conf")<0)
return -1;
- if (openvzGetVPSUUID(vpsid, uuidstr))
+ if (openvzGetVPSUUID(vpsid, uuidstr, sizeof(uuidstr)))
return -1;
if (uuidstr[0] == 0) {
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Fix phyp escape_specialcharacters.
by Chris Lalancette
A couple of minor fixes to phyp escape_specialcharacters. Make it
a static function (since it's only used in phyp/phyp_driver.c), and
make it take a dstlen parameter. This paves the way for removing
strncpy in the future.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/phyp/phyp_driver.c | 10 ++++++----
src/phyp/phyp_driver.h | 2 --
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index cbfd31b..f457cf4 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -53,6 +53,8 @@
#define VIR_FROM_THIS VIR_FROM_PHYP
+static int escape_specialcharacters(char *src, char *dst, size_t dstlen);
+
/*
* URI: phyp://user@[hmc|ivm]/managed_system
* */
@@ -94,7 +96,7 @@ phypOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR;
}
- if (escape_specialcharacters(conn->uri->path, string) == -1) {
+ if (escape_specialcharacters(conn->uri->path, string, sizeof(string)) == -1) {
virRaiseError(conn, NULL, NULL, 0, VIR_FROM_PHYP,
VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0, "%s",
_("Error parsing 'path'. Invalid characters."));
@@ -1341,8 +1343,8 @@ init_uuid_db(virConnectPtr conn)
return;
}
-int
-escape_specialcharacters(char *src, char *dst)
+static int
+escape_specialcharacters(char *src, char *dst, size_t dstlen)
{
size_t len = strlen(src);
char temp_buffer[len];
@@ -1367,7 +1369,7 @@ escape_specialcharacters(char *src, char *dst)
}
temp_buffer[j] = '\0';
- if (strncpy(dst, temp_buffer, j) == NULL)
+ if (strncpy(dst, temp_buffer, dstlen) == NULL)
return -1;
return 0;
diff --git a/src/phyp/phyp_driver.h b/src/phyp/phyp_driver.h
index fd824b3..f16b6fe 100644
--- a/src/phyp/phyp_driver.h
+++ b/src/phyp/phyp_driver.h
@@ -62,5 +62,3 @@ char *phypGetBackingDevice(virConnectPtr conn, const char *managed_system,
int phypDiskType(virConnectPtr conn, char *backing_device);
SSH_SESSION *openSSHSession(virConnectPtr conn, virConnectAuthPtr auth);
-
-int escape_specialcharacters(char *src, char *dst);
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Fix up a few minor indentation issues.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/xen_internal.c | 8 ++++----
src/xend_internal.c | 2 +-
src/xm_internal.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/xen_internal.c b/src/xen_internal.c
index b6bf10d..ae78f84 100644
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -1147,7 +1147,7 @@ static const char *str_cap = "cap";
*/
int
xenHypervisorGetSchedulerParameters(virDomainPtr domain,
- virSchedParameterPtr params, int *nparams)
+ virSchedParameterPtr params, int *nparams)
{
xenUnifiedPrivatePtr priv;
@@ -1209,19 +1209,19 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain,
return(-1);
strncpy (params[0].field, str_weight, VIR_DOMAIN_SCHED_FIELD_LENGTH);
- params[0].field[VIR_DOMAIN_SCHED_FIELD_LENGTH-1] = '\0';
+ params[0].field[VIR_DOMAIN_SCHED_FIELD_LENGTH-1] = '\0';
params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT;
params[0].value.ui = op_dom.u.getschedinfo.u.credit.weight;
strncpy (params[1].field, str_cap, VIR_DOMAIN_SCHED_FIELD_LENGTH);
- params[1].field[VIR_DOMAIN_SCHED_FIELD_LENGTH-1] = '\0';
+ params[1].field[VIR_DOMAIN_SCHED_FIELD_LENGTH-1] = '\0';
params[1].type = VIR_DOMAIN_SCHED_FIELD_UINT;
params[1].value.ui = op_dom.u.getschedinfo.u.credit.cap;
*nparams = 2;
break;
default:
- virXenErrorFunc(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
+ virXenErrorFunc(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
"Unknown scheduler", op_sys.u.getschedulerid.sched_id);
return -1;
}
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 2585703..7bcee7d 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -4732,7 +4732,7 @@ static const char *str_cap = "cap";
*/
static int
xenDaemonGetSchedulerParameters(virDomainPtr domain,
- virSchedParameterPtr params, int *nparams)
+ virSchedParameterPtr params, int *nparams)
{
xenUnifiedPrivatePtr priv;
struct sexpr *root;
diff --git a/src/xm_internal.c b/src/xm_internal.c
index c869120..b7f9e67 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -1418,7 +1418,7 @@ xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf) {
no_memory:
virReportOOMError(conn);
/* fallthrough */
- cleanup:
+cleanup:
virDomainGraphicsDefFree(graphics);
virDomainNetDefFree(net);
virDomainDiskDefFree(disk);
--
1.6.0.6
15 years, 2 months
[libvirt] [PATCH] Remove a duplicated assignment in Xen PCI parsing.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/xm_internal.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/src/xm_internal.c b/src/xm_internal.c
index b7f9e67..71b852e 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -1160,7 +1160,6 @@ xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf) {
goto skippci;
/* pci=['0000:00:1b.0','0000:00:13.0'] */
- key = list->str;
if (!(key = list->str))
goto skippci;
if (!(nextkey = strchr(key, ':')))
--
1.6.0.6
15 years, 2 months