mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
Revert "lock_driver: Introduce new VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON"
This reverts commit 22baf6e08c65d9174b24f66370724ce961ce9576. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
a8df96526a
commit
ded3d47bbe
@ -42,8 +42,6 @@ typedef enum {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
/* The managed object is a virtual guest domain */
|
/* The managed object is a virtual guest domain */
|
||||||
VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN = 0,
|
VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN = 0,
|
||||||
/* The managed object is a daemon (e.g. libvirtd) */
|
|
||||||
VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON = 1,
|
|
||||||
} virLockManagerObjectType;
|
} virLockManagerObjectType;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -56,21 +56,10 @@ struct _virLockManagerLockDaemonResource {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct _virLockManagerLockDaemonPrivate {
|
struct _virLockManagerLockDaemonPrivate {
|
||||||
virLockManagerObjectType type;
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||||
union {
|
char *name;
|
||||||
struct {
|
int id;
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
pid_t pid;
|
||||||
char *name;
|
|
||||||
int id;
|
|
||||||
pid_t pid;
|
|
||||||
} dom;
|
|
||||||
|
|
||||||
struct {
|
|
||||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
|
||||||
char *name;
|
|
||||||
pid_t pid;
|
|
||||||
} daemon;
|
|
||||||
} t;
|
|
||||||
|
|
||||||
size_t nresources;
|
size_t nresources;
|
||||||
virLockManagerLockDaemonResourcePtr resources;
|
virLockManagerLockDaemonResourcePtr resources;
|
||||||
@ -167,30 +156,10 @@ virLockManagerLockDaemonConnectionRegister(virLockManagerPtr lock,
|
|||||||
memset(&args, 0, sizeof(args));
|
memset(&args, 0, sizeof(args));
|
||||||
|
|
||||||
args.flags = 0;
|
args.flags = 0;
|
||||||
|
memcpy(args.owner.uuid, priv->uuid, VIR_UUID_BUFLEN);
|
||||||
switch (priv->type) {
|
args.owner.name = priv->name;
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
|
args.owner.id = priv->id;
|
||||||
memcpy(args.owner.uuid, priv->t.dom.uuid, VIR_UUID_BUFLEN);
|
args.owner.pid = priv->pid;
|
||||||
args.owner.name = priv->t.dom.name;
|
|
||||||
args.owner.id = priv->t.dom.id;
|
|
||||||
args.owner.pid = priv->t.dom.pid;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON:
|
|
||||||
memcpy(args.owner.uuid, priv->t.daemon.uuid, VIR_UUID_BUFLEN);
|
|
||||||
args.owner.name = priv->t.daemon.name;
|
|
||||||
args.owner.pid = priv->t.daemon.pid;
|
|
||||||
/* This one should not be needed. However, virtlockd
|
|
||||||
* checks for ID because not every domain has a PID. */
|
|
||||||
args.owner.id = priv->t.daemon.pid;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Unknown lock manager object type %d"),
|
|
||||||
priv->type);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (virNetClientProgramCall(program,
|
if (virNetClientProgramCall(program,
|
||||||
client,
|
client,
|
||||||
@ -422,18 +391,7 @@ virLockManagerLockDaemonPrivateFree(virLockManagerLockDaemonPrivatePtr priv)
|
|||||||
}
|
}
|
||||||
VIR_FREE(priv->resources);
|
VIR_FREE(priv->resources);
|
||||||
|
|
||||||
switch (priv->type) {
|
VIR_FREE(priv->name);
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
|
|
||||||
VIR_FREE(priv->t.dom.name);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON:
|
|
||||||
VIR_FREE(priv->t.daemon.name);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,82 +420,46 @@ static int virLockManagerLockDaemonNew(virLockManagerPtr lock,
|
|||||||
if (VIR_ALLOC(priv) < 0)
|
if (VIR_ALLOC(priv) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
priv->type = type;
|
switch (type) {
|
||||||
|
|
||||||
switch ((virLockManagerObjectType) type) {
|
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
|
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
|
||||||
for (i = 0; i < nparams; i++) {
|
for (i = 0; i < nparams; i++) {
|
||||||
if (STREQ(params[i].key, "uuid")) {
|
if (STREQ(params[i].key, "uuid")) {
|
||||||
memcpy(priv->t.dom.uuid, params[i].value.uuid, VIR_UUID_BUFLEN);
|
memcpy(priv->uuid, params[i].value.uuid, VIR_UUID_BUFLEN);
|
||||||
} else if (STREQ(params[i].key, "name")) {
|
} else if (STREQ(params[i].key, "name")) {
|
||||||
if (VIR_STRDUP(priv->t.dom.name, params[i].value.str) < 0)
|
if (VIR_STRDUP(priv->name, params[i].value.str) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (STREQ(params[i].key, "id")) {
|
} else if (STREQ(params[i].key, "id")) {
|
||||||
priv->t.dom.id = params[i].value.iv;
|
priv->id = params[i].value.iv;
|
||||||
} else if (STREQ(params[i].key, "pid")) {
|
} else if (STREQ(params[i].key, "pid")) {
|
||||||
priv->t.dom.pid = params[i].value.iv;
|
priv->pid = params[i].value.iv;
|
||||||
} else if (STREQ(params[i].key, "uri")) {
|
} else if (STREQ(params[i].key, "uri")) {
|
||||||
/* ignored */
|
/* ignored */
|
||||||
} else {
|
} else {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unexpected parameter %s for domain object"),
|
_("Unexpected parameter %s for object"),
|
||||||
params[i].key);
|
params[i].key);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (priv->t.dom.id == 0) {
|
if (priv->id == 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing ID parameter for domain object"));
|
_("Missing ID parameter for domain object"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (priv->t.dom.pid == 0)
|
if (priv->pid == 0)
|
||||||
VIR_DEBUG("Missing PID parameter for domain object");
|
VIR_DEBUG("Missing PID parameter for domain object");
|
||||||
if (!priv->t.dom.name) {
|
if (!priv->name) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing name parameter for domain object"));
|
_("Missing name parameter for domain object"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (!virUUIDIsValid(priv->t.dom.uuid)) {
|
if (!virUUIDIsValid(priv->uuid)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing UUID parameter for domain object"));
|
_("Missing UUID parameter for domain object"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON:
|
|
||||||
for (i = 0; i < nparams; i++) {
|
|
||||||
if (STREQ(params[i].key, "uuid")) {
|
|
||||||
memcpy(priv->t.daemon.uuid, params[i].value.uuid, VIR_UUID_BUFLEN);
|
|
||||||
} else if (STREQ(params[i].key, "name")) {
|
|
||||||
if (VIR_STRDUP(priv->t.daemon.name, params[i].value.str) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
} else if (STREQ(params[i].key, "pid")) {
|
|
||||||
priv->t.daemon.pid = params[i].value.iv;
|
|
||||||
} else {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Unexpected parameter %s for daemon object"),
|
|
||||||
params[i].key);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!virUUIDIsValid(priv->t.daemon.uuid)) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Missing UUID parameter for daemon object"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
if (!priv->t.daemon.name) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Missing name parameter for daemon object"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
if (priv->t.daemon.pid == 0) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Missing PID parameter for daemon object"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown lock manager object type %d"),
|
_("Unknown lock manager object type %d"),
|
||||||
@ -572,119 +494,107 @@ static int virLockManagerLockDaemonAddResource(virLockManagerPtr lock,
|
|||||||
if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY)
|
if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (priv->type) {
|
switch (type) {
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
|
case VIR_LOCK_MANAGER_RESOURCE_TYPE_DISK:
|
||||||
|
if (params || nparams) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Unexpected parameters for disk resource"));
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
if (!driver->autoDiskLease) {
|
||||||
|
if (!(flags & (VIR_LOCK_MANAGER_RESOURCE_SHARED |
|
||||||
|
VIR_LOCK_MANAGER_RESOURCE_READONLY)))
|
||||||
|
priv->hasRWDisks = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
/* XXX we should somehow pass in TYPE=BLOCK info
|
||||||
case VIR_LOCK_MANAGER_RESOURCE_TYPE_DISK:
|
* from the domain_lock code, instead of assuming /dev
|
||||||
if (params || nparams) {
|
*/
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
if (STRPREFIX(name, "/dev") &&
|
||||||
_("Unexpected parameters for disk resource"));
|
driver->lvmLockSpaceDir) {
|
||||||
|
VIR_DEBUG("Trying to find an LVM UUID for %s", name);
|
||||||
|
if (virStorageFileGetLVMKey(name, &newName) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
if (!driver->autoDiskLease) {
|
|
||||||
if (!(flags & (VIR_LOCK_MANAGER_RESOURCE_SHARED |
|
|
||||||
VIR_LOCK_MANAGER_RESOURCE_READONLY)))
|
|
||||||
priv->hasRWDisks = true;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XXX we should somehow pass in TYPE=BLOCK info
|
if (newName) {
|
||||||
* from the domain_lock code, instead of assuming /dev
|
VIR_DEBUG("Got an LVM UUID %s for %s", newName, name);
|
||||||
*/
|
if (VIR_STRDUP(newLockspace, driver->lvmLockSpaceDir) < 0)
|
||||||
if (STRPREFIX(name, "/dev") &&
|
|
||||||
driver->lvmLockSpaceDir) {
|
|
||||||
VIR_DEBUG("Trying to find an LVM UUID for %s", name);
|
|
||||||
if (virStorageFileGetLVMKey(name, &newName) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (newName) {
|
|
||||||
VIR_DEBUG("Got an LVM UUID %s for %s", newName, name);
|
|
||||||
if (VIR_STRDUP(newLockspace, driver->lvmLockSpaceDir) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
autoCreate = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
virResetLastError();
|
|
||||||
/* Fallback to generic non-block code */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (STRPREFIX(name, "/dev") &&
|
|
||||||
driver->scsiLockSpaceDir) {
|
|
||||||
VIR_DEBUG("Trying to find an SCSI ID for %s", name);
|
|
||||||
if (virStorageFileGetSCSIKey(name, &newName) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (newName) {
|
|
||||||
VIR_DEBUG("Got an SCSI ID %s for %s", newName, name);
|
|
||||||
if (VIR_STRDUP(newLockspace, driver->scsiLockSpaceDir) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
autoCreate = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
virResetLastError();
|
|
||||||
/* Fallback to generic non-block code */
|
|
||||||
}
|
|
||||||
|
|
||||||
if (driver->fileLockSpaceDir) {
|
|
||||||
if (VIR_STRDUP(newLockspace, driver->fileLockSpaceDir) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
if (virCryptoHashString(VIR_CRYPTO_HASH_SHA256, name, &newName) < 0)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
autoCreate = true;
|
autoCreate = true;
|
||||||
VIR_DEBUG("Using indirect lease %s for %s", newName, name);
|
break;
|
||||||
} else {
|
|
||||||
if (VIR_STRDUP(newLockspace, "") < 0)
|
|
||||||
goto cleanup;
|
|
||||||
if (VIR_STRDUP(newName, name) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
VIR_DEBUG("Using direct lease for %s", name);
|
|
||||||
}
|
}
|
||||||
|
virResetLastError();
|
||||||
|
/* Fallback to generic non-block code */
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
if (STRPREFIX(name, "/dev") &&
|
||||||
case VIR_LOCK_MANAGER_RESOURCE_TYPE_LEASE: {
|
driver->scsiLockSpaceDir) {
|
||||||
size_t i;
|
VIR_DEBUG("Trying to find an SCSI ID for %s", name);
|
||||||
char *path = NULL;
|
if (virStorageFileGetSCSIKey(name, &newName) < 0)
|
||||||
char *lockspace = NULL;
|
|
||||||
for (i = 0; i < nparams; i++) {
|
|
||||||
if (STREQ(params[i].key, "offset")) {
|
|
||||||
if (params[i].value.ul != 0) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Offset must be zero for this lock manager"));
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
} else if (STREQ(params[i].key, "lockspace")) {
|
|
||||||
lockspace = params[i].value.str;
|
|
||||||
} else if (STREQ(params[i].key, "path")) {
|
|
||||||
path = params[i].value.str;
|
|
||||||
} else {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Unexpected parameter %s for lease resource"),
|
|
||||||
params[i].key);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!path || !lockspace) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Missing path or lockspace for lease resource"));
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (newName) {
|
||||||
|
VIR_DEBUG("Got an SCSI ID %s for %s", newName, name);
|
||||||
|
if (VIR_STRDUP(newLockspace, driver->scsiLockSpaceDir) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
autoCreate = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (virAsprintf(&newLockspace, "%s/%s",
|
virResetLastError();
|
||||||
path, lockspace) < 0)
|
/* Fallback to generic non-block code */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (driver->fileLockSpaceDir) {
|
||||||
|
if (VIR_STRDUP(newLockspace, driver->fileLockSpaceDir) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
if (virCryptoHashString(VIR_CRYPTO_HASH_SHA256, name, &newName) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
autoCreate = true;
|
||||||
|
VIR_DEBUG("Using indirect lease %s for %s", newName, name);
|
||||||
|
} else {
|
||||||
|
if (VIR_STRDUP(newLockspace, "") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
if (VIR_STRDUP(newName, name) < 0)
|
if (VIR_STRDUP(newName, name) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
VIR_DEBUG("Using direct lease for %s", name);
|
||||||
|
}
|
||||||
|
|
||||||
} break;
|
break;
|
||||||
default:
|
case VIR_LOCK_MANAGER_RESOURCE_TYPE_LEASE: {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
size_t i;
|
||||||
_("Unknown lock manager object type %d for domain lock object"),
|
char *path = NULL;
|
||||||
type);
|
char *lockspace = NULL;
|
||||||
|
for (i = 0; i < nparams; i++) {
|
||||||
|
if (STREQ(params[i].key, "offset")) {
|
||||||
|
if (params[i].value.ul != 0) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Offset must be zero for this lock manager"));
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
} else if (STREQ(params[i].key, "lockspace")) {
|
||||||
|
lockspace = params[i].value.str;
|
||||||
|
} else if (STREQ(params[i].key, "path")) {
|
||||||
|
path = params[i].value.str;
|
||||||
|
} else {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Unexpected parameter %s for lease resource"),
|
||||||
|
params[i].key);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!path || !lockspace) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("Missing path or lockspace for lease resource"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
break;
|
if (virAsprintf(&newLockspace, "%s/%s",
|
||||||
|
path, lockspace) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
if (VIR_STRDUP(newName, name) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON:
|
} break;
|
||||||
default:
|
default:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown lock manager object type %d"),
|
_("Unknown lock manager object type %d"),
|
||||||
@ -729,8 +639,7 @@ static int virLockManagerLockDaemonAcquire(virLockManagerPtr lock,
|
|||||||
virCheckFlags(VIR_LOCK_MANAGER_ACQUIRE_REGISTER_ONLY |
|
virCheckFlags(VIR_LOCK_MANAGER_ACQUIRE_REGISTER_ONLY |
|
||||||
VIR_LOCK_MANAGER_ACQUIRE_RESTRICT, -1);
|
VIR_LOCK_MANAGER_ACQUIRE_RESTRICT, -1);
|
||||||
|
|
||||||
if (priv->type == VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN &&
|
if (priv->nresources == 0 &&
|
||||||
priv->nresources == 0 &&
|
|
||||||
priv->hasRWDisks &&
|
priv->hasRWDisks &&
|
||||||
driver->requireLeaseForDisks) {
|
driver->requireLeaseForDisks) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
@ -509,32 +509,21 @@ static int virLockManagerSanlockNew(virLockManagerPtr lock,
|
|||||||
|
|
||||||
priv->flags = flags;
|
priv->flags = flags;
|
||||||
|
|
||||||
switch ((virLockManagerObjectType) type) {
|
for (i = 0; i < nparams; i++) {
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN:
|
param = ¶ms[i];
|
||||||
for (i = 0; i < nparams; i++) {
|
|
||||||
param = ¶ms[i];
|
|
||||||
|
|
||||||
if (STREQ(param->key, "uuid")) {
|
if (STREQ(param->key, "uuid")) {
|
||||||
memcpy(priv->vm_uuid, param->value.uuid, 16);
|
memcpy(priv->vm_uuid, param->value.uuid, 16);
|
||||||
} else if (STREQ(param->key, "name")) {
|
} else if (STREQ(param->key, "name")) {
|
||||||
if (VIR_STRDUP(priv->vm_name, param->value.str) < 0)
|
if (VIR_STRDUP(priv->vm_name, param->value.str) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
} else if (STREQ(param->key, "pid")) {
|
} else if (STREQ(param->key, "pid")) {
|
||||||
priv->vm_pid = param->value.iv;
|
priv->vm_pid = param->value.iv;
|
||||||
} else if (STREQ(param->key, "id")) {
|
} else if (STREQ(param->key, "id")) {
|
||||||
priv->vm_id = param->value.ui;
|
priv->vm_id = param->value.ui;
|
||||||
} else if (STREQ(param->key, "uri")) {
|
} else if (STREQ(param->key, "uri")) {
|
||||||
priv->vm_uri = param->value.cstr;
|
priv->vm_uri = param->value.cstr;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
|
|
||||||
case VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON:
|
|
||||||
default:
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Unknown lock manager object type %d"),
|
|
||||||
type);
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sanlock needs process registration, but the only way how to probe
|
/* Sanlock needs process registration, but the only way how to probe
|
||||||
|
Loading…
x
Reference in New Issue
Block a user