mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 22:45:21 +00:00
_virLockManagerLockDaemonPrivate: Move @hasRWDisks into dom union
The fact whether domain has or doesn't have RW disks is specific to VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN and therefore should reside in union specific to it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
22baf6e08c
commit
aaf34cb901
@ -63,6 +63,8 @@ struct _virLockManagerLockDaemonPrivate {
|
|||||||
char *name;
|
char *name;
|
||||||
int id;
|
int id;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
|
bool hasRWDisks;
|
||||||
} dom;
|
} dom;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@ -74,8 +76,6 @@ struct _virLockManagerLockDaemonPrivate {
|
|||||||
|
|
||||||
size_t nresources;
|
size_t nresources;
|
||||||
virLockManagerLockDaemonResourcePtr resources;
|
virLockManagerLockDaemonResourcePtr resources;
|
||||||
|
|
||||||
bool hasRWDisks;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ static int virLockManagerLockDaemonAddResource(virLockManagerPtr lock,
|
|||||||
if (!driver->autoDiskLease) {
|
if (!driver->autoDiskLease) {
|
||||||
if (!(flags & (VIR_LOCK_MANAGER_RESOURCE_SHARED |
|
if (!(flags & (VIR_LOCK_MANAGER_RESOURCE_SHARED |
|
||||||
VIR_LOCK_MANAGER_RESOURCE_READONLY)))
|
VIR_LOCK_MANAGER_RESOURCE_READONLY)))
|
||||||
priv->hasRWDisks = true;
|
priv->t.dom.hasRWDisks = true;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -731,7 +731,7 @@ static int virLockManagerLockDaemonAcquire(virLockManagerPtr lock,
|
|||||||
|
|
||||||
if (priv->type == VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN &&
|
if (priv->type == VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN &&
|
||||||
priv->nresources == 0 &&
|
priv->nresources == 0 &&
|
||||||
priv->hasRWDisks &&
|
priv->t.dom.hasRWDisks &&
|
||||||
driver->requireLeaseForDisks) {
|
driver->requireLeaseForDisks) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("Read/write, exclusive access, disks were present, but no leases specified"));
|
_("Read/write, exclusive access, disks were present, but no leases specified"));
|
||||||
|
Loading…
Reference in New Issue
Block a user