mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
vz: implementation of domainSetUserPassword callback
This commit is contained in:
parent
f166d6449c
commit
ceb5461f7b
@ -1264,6 +1264,25 @@ static int vzDomainDetachDevice(virDomainPtr domain, const char *xml)
|
||||
VIR_DOMAIN_AFFECT_CONFIG | VIR_DOMAIN_AFFECT_LIVE);
|
||||
}
|
||||
|
||||
static int
|
||||
vzDomainSetUserPassword(virDomainPtr domain,
|
||||
const char *user,
|
||||
const char *password,
|
||||
unsigned int flags)
|
||||
{
|
||||
virDomainObjPtr dom = NULL;
|
||||
int ret = -1;
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
if (!(dom = vzDomObjFromDomain(domain)))
|
||||
return -1;
|
||||
|
||||
ret = prlsdkDomainSetUserPassword(dom, user, password);
|
||||
|
||||
virObjectUnlock(dom);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned long long
|
||||
vzDomainGetMaxMemory(virDomainPtr domain)
|
||||
{
|
||||
@ -2737,6 +2756,7 @@ static virHypervisorDriver vzHypervisorDriver = {
|
||||
.domainIsUpdated = vzDomainIsUpdated, /* 1.2.21 */
|
||||
.domainGetVcpusFlags = vzDomainGetVcpusFlags, /* 1.2.21 */
|
||||
.domainGetMaxVcpus = vzDomainGetMaxVcpus, /* 1.2.21 */
|
||||
.domainSetUserPassword = vzDomainSetUserPassword, /* 1.3.6 */
|
||||
.connectDomainEventRegisterAny = vzConnectDomainEventRegisterAny, /* 1.2.10 */
|
||||
.connectDomainEventDeregisterAny = vzConnectDomainEventDeregisterAny, /* 1.2.10 */
|
||||
.nodeGetCPUMap = vzNodeGetCPUMap, /* 1.2.8 */
|
||||
|
@ -3534,6 +3534,37 @@ prlsdkSetBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
prlsdkDomainSetUserPassword(virDomainObjPtr dom,
|
||||
const char *user,
|
||||
const char *password)
|
||||
{
|
||||
int ret = -1;
|
||||
vzDomObjPtr privdom = dom->privateData;
|
||||
PRL_HANDLE job = PRL_INVALID_HANDLE;
|
||||
|
||||
job = PrlVm_BeginEdit(privdom->sdkdom);
|
||||
if (PRL_FAILED(waitJob(job)))
|
||||
goto cleanup;
|
||||
|
||||
job = PrlVm_SetUserPasswd(privdom->sdkdom,
|
||||
user,
|
||||
password,
|
||||
0);
|
||||
|
||||
if (PRL_FAILED(waitJob(job)))
|
||||
goto cleanup;
|
||||
|
||||
job = PrlVm_CommitEx(privdom->sdkdom, 0);
|
||||
if (PRL_FAILED(waitJob(job)))
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
prlsdkDoApplyConfig(vzDriverPtr driver,
|
||||
PRL_HANDLE sdkdom,
|
||||
|
@ -82,7 +82,10 @@ void
|
||||
prlsdkDomObjFreePrivate(void *p);
|
||||
/* memsize is in MiB */
|
||||
int prlsdkSetMemsize(virDomainObjPtr dom, unsigned int memsize);
|
||||
|
||||
int
|
||||
prlsdkDomainSetUserPassword(virDomainObjPtr dom,
|
||||
const char *user,
|
||||
const char *password);
|
||||
virDomainSnapshotObjListPtr prlsdkLoadSnapshots(virDomainObjPtr dom);
|
||||
int prlsdkCreateSnapshot(virDomainObjPtr dom, const char *description);
|
||||
int prlsdkDeleteSnapshot(virDomainObjPtr dom, const char *uuid, bool children);
|
||||
|
Loading…
Reference in New Issue
Block a user