mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
Add domainGetOSType to libxl driver
* src/libxl/libxl_driver.c: implements libxlDomainGetOSType
This commit is contained in:
parent
d53bca4868
commit
f367a1dfce
@ -1174,6 +1174,33 @@ cleanup:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
libxlDomainGetOSType(virDomainPtr dom)
|
||||||
|
{
|
||||||
|
libxlDriverPrivatePtr driver = dom->conn->privateData;
|
||||||
|
virDomainObjPtr vm;
|
||||||
|
char *type = NULL;
|
||||||
|
|
||||||
|
libxlDriverLock(driver);
|
||||||
|
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
||||||
|
libxlDriverUnlock(driver);
|
||||||
|
if (!vm) {
|
||||||
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
|
virUUIDFormat(dom->uuid, uuidstr);
|
||||||
|
libxlError(VIR_ERR_NO_DOMAIN,
|
||||||
|
_("No domain with matching uuid '%s'"), uuidstr);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(type = strdup(vm->def->os.type)))
|
||||||
|
virReportOOMError();
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (vm)
|
||||||
|
virDomainObjUnlock(vm);
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned long
|
static unsigned long
|
||||||
libxlDomainGetMaxMemory(virDomainPtr dom)
|
libxlDomainGetMaxMemory(virDomainPtr dom)
|
||||||
{
|
{
|
||||||
@ -2124,7 +2151,7 @@ static virDriver libxlDriver = {
|
|||||||
libxlDomainShutdown, /* domainShutdown */
|
libxlDomainShutdown, /* domainShutdown */
|
||||||
libxlDomainReboot, /* domainReboot */
|
libxlDomainReboot, /* domainReboot */
|
||||||
libxlDomainDestroy, /* domainDestroy */
|
libxlDomainDestroy, /* domainDestroy */
|
||||||
NULL, /* domainGetOSType */
|
libxlDomainGetOSType, /* domainGetOSType */
|
||||||
libxlDomainGetMaxMemory, /* domainGetMaxMemory */
|
libxlDomainGetMaxMemory, /* domainGetMaxMemory */
|
||||||
NULL, /* domainSetMaxMemory */
|
NULL, /* domainSetMaxMemory */
|
||||||
libxlDomainSetMemory, /* domainSetMemory */
|
libxlDomainSetMemory, /* domainSetMemory */
|
||||||
|
Loading…
Reference in New Issue
Block a user