mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
caps: Convert to use VIR_DOMAIN_VIRT internally
This commit is contained in:
parent
5f7c599456
commit
4fa6f9b413
@ -92,8 +92,8 @@ virBhyveCapsBuild(void)
|
|||||||
NULL, 0, NULL)) == NULL)
|
NULL, 0, NULL)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_BHYVE,
|
||||||
"bhyve", NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virBhyveCapsInitCPU(caps, virArchFromHost()) < 0)
|
if (virBhyveCapsInitCPU(caps, virArchFromHost()) < 0)
|
||||||
|
@ -135,7 +135,6 @@ virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom)
|
|||||||
for (i = 0; i < dom->info.nmachines; i++)
|
for (i = 0; i < dom->info.nmachines; i++)
|
||||||
virCapabilitiesFreeGuestMachine(dom->info.machines[i]);
|
virCapabilitiesFreeGuestMachine(dom->info.machines[i]);
|
||||||
VIR_FREE(dom->info.machines);
|
VIR_FREE(dom->info.machines);
|
||||||
VIR_FREE(dom->type);
|
|
||||||
|
|
||||||
VIR_FREE(dom);
|
VIR_FREE(dom);
|
||||||
}
|
}
|
||||||
@ -459,7 +458,7 @@ virCapabilitiesAddGuest(virCapsPtr caps,
|
|||||||
*/
|
*/
|
||||||
virCapsGuestDomainPtr
|
virCapsGuestDomainPtr
|
||||||
virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
|
virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
|
||||||
const char *hvtype,
|
int hvtype,
|
||||||
const char *emulator,
|
const char *emulator,
|
||||||
const char *loader,
|
const char *loader,
|
||||||
int nmachines,
|
int nmachines,
|
||||||
@ -470,8 +469,8 @@ virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
|
|||||||
if (VIR_ALLOC(dom) < 0)
|
if (VIR_ALLOC(dom) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (VIR_STRDUP(dom->type, hvtype) < 0 ||
|
dom->type = hvtype;
|
||||||
VIR_STRDUP(dom->info.emulator, emulator) < 0 ||
|
if (VIR_STRDUP(dom->info.emulator, emulator) < 0 ||
|
||||||
VIR_STRDUP(dom->info.loader, loader) < 0)
|
VIR_STRDUP(dom->info.loader, loader) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -641,6 +640,7 @@ virCapabilitiesSupportsGuestOSTypeArch(virCapsPtr caps,
|
|||||||
* virCapabilitiesDefaultGuestArch:
|
* virCapabilitiesDefaultGuestArch:
|
||||||
* @caps: capabilities to query
|
* @caps: capabilities to query
|
||||||
* @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
* @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
||||||
|
* @domain: domain type to search for, of enum VIR_DOMAIN_VIRT
|
||||||
*
|
*
|
||||||
* Returns the first architecture able to run the
|
* Returns the first architecture able to run the
|
||||||
* requested operating system type
|
* requested operating system type
|
||||||
@ -648,7 +648,7 @@ virCapabilitiesSupportsGuestOSTypeArch(virCapsPtr caps,
|
|||||||
extern virArch
|
extern virArch
|
||||||
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
||||||
int ostype,
|
int ostype,
|
||||||
const char *domain)
|
int domain)
|
||||||
{
|
{
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
@ -656,7 +656,7 @@ virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
|||||||
for (i = 0; i < caps->nguests; i++) {
|
for (i = 0; i < caps->nguests; i++) {
|
||||||
if (caps->guests[i]->ostype == ostype) {
|
if (caps->guests[i]->ostype == ostype) {
|
||||||
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
||||||
if (STREQ(caps->guests[i]->arch.domains[j]->type, domain) &&
|
if (caps->guests[i]->arch.domains[j]->type == domain &&
|
||||||
caps->guests[i]->arch.id == caps->host.arch)
|
caps->guests[i]->arch.id == caps->host.arch)
|
||||||
return caps->guests[i]->arch.id;
|
return caps->guests[i]->arch.id;
|
||||||
}
|
}
|
||||||
@ -667,7 +667,7 @@ virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
|||||||
for (i = 0; i < caps->nguests; i++) {
|
for (i = 0; i < caps->nguests; i++) {
|
||||||
if (caps->guests[i]->ostype == ostype) {
|
if (caps->guests[i]->ostype == ostype) {
|
||||||
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
||||||
if (STREQ(caps->guests[i]->arch.domains[j]->type, domain))
|
if (caps->guests[i]->arch.domains[j]->type == domain)
|
||||||
return caps->guests[i]->arch.id;
|
return caps->guests[i]->arch.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -681,7 +681,7 @@ virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
|||||||
* @caps: capabilities to query
|
* @caps: capabilities to query
|
||||||
* @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
* @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
||||||
* @arch: architecture to search for
|
* @arch: architecture to search for
|
||||||
* @domain: domain type to search for
|
* @domain: domain type to search for, of enum VIR_DOMAIN_VIRT
|
||||||
*
|
*
|
||||||
* Returns the first machine variant associated with
|
* Returns the first machine variant associated with
|
||||||
* the requested operating system type, architecture
|
* the requested operating system type, architecture
|
||||||
@ -691,7 +691,7 @@ extern const char *
|
|||||||
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
||||||
int ostype,
|
int ostype,
|
||||||
virArch arch,
|
virArch arch,
|
||||||
const char *domain)
|
int domain)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -706,7 +706,7 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
|||||||
for (j = 0; j < guest->arch.ndomains; j++) {
|
for (j = 0; j < guest->arch.ndomains; j++) {
|
||||||
virCapsGuestDomainPtr dom = guest->arch.domains[j];
|
virCapsGuestDomainPtr dom = guest->arch.domains[j];
|
||||||
|
|
||||||
if (!STREQ(dom->type, domain))
|
if (dom->type != domain)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!dom->info.nmachines)
|
if (!dom->info.nmachines)
|
||||||
@ -727,7 +727,7 @@ virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
|||||||
* @caps: capabilities to query
|
* @caps: capabilities to query
|
||||||
* @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
* @ostype: guest operating system type, of enum VIR_DOMAIN_OSTYPE
|
||||||
* @arch: architecture to search for
|
* @arch: architecture to search for
|
||||||
* @domain: domain type ('xen', 'qemu', 'kvm')
|
* @domain: domain type to search for, of enum VIR_DOMAIN_VIRT
|
||||||
*
|
*
|
||||||
* Returns the first emulator path associated with
|
* Returns the first emulator path associated with
|
||||||
* the requested operating system type, architecture
|
* the requested operating system type, architecture
|
||||||
@ -737,7 +737,7 @@ extern const char *
|
|||||||
virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
|
virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
|
||||||
int ostype,
|
int ostype,
|
||||||
virArch arch,
|
virArch arch,
|
||||||
const char *domain)
|
int domain)
|
||||||
{
|
{
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
|
||||||
@ -747,7 +747,7 @@ virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
|
|||||||
caps->guests[i]->arch.id == arch) {
|
caps->guests[i]->arch.id == arch) {
|
||||||
emulator = caps->guests[i]->arch.defaultInfo.emulator;
|
emulator = caps->guests[i]->arch.defaultInfo.emulator;
|
||||||
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
||||||
if (STREQ(caps->guests[i]->arch.domains[j]->type, domain)) {
|
if (caps->guests[i]->arch.domains[j]->type == domain) {
|
||||||
if (caps->guests[i]->arch.domains[j]->info.emulator)
|
if (caps->guests[i]->arch.domains[j]->info.emulator)
|
||||||
emulator = caps->guests[i]->arch.domains[j]->info.emulator;
|
emulator = caps->guests[i]->arch.domains[j]->info.emulator;
|
||||||
}
|
}
|
||||||
@ -970,7 +970,7 @@ virCapabilitiesFormatXML(virCapsPtr caps)
|
|||||||
|
|
||||||
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
for (j = 0; j < caps->guests[i]->arch.ndomains; j++) {
|
||||||
virBufferAsprintf(&buf, "<domain type='%s'",
|
virBufferAsprintf(&buf, "<domain type='%s'",
|
||||||
caps->guests[i]->arch.domains[j]->type);
|
virDomainVirtTypeToString(caps->guests[i]->arch.domains[j]->type));
|
||||||
if (!caps->guests[i]->arch.domains[j]->info.emulator &&
|
if (!caps->guests[i]->arch.domains[j]->info.emulator &&
|
||||||
!caps->guests[i]->arch.domains[j]->info.loader &&
|
!caps->guests[i]->arch.domains[j]->info.loader &&
|
||||||
!caps->guests[i]->arch.domains[j]->info.nmachines) {
|
!caps->guests[i]->arch.domains[j]->info.nmachines) {
|
||||||
|
@ -61,7 +61,7 @@ struct _virCapsGuestDomainInfo {
|
|||||||
typedef struct _virCapsGuestDomain virCapsGuestDomain;
|
typedef struct _virCapsGuestDomain virCapsGuestDomain;
|
||||||
typedef virCapsGuestDomain *virCapsGuestDomainPtr;
|
typedef virCapsGuestDomain *virCapsGuestDomainPtr;
|
||||||
struct _virCapsGuestDomain {
|
struct _virCapsGuestDomain {
|
||||||
char *type;
|
int type;
|
||||||
virCapsGuestDomainInfo info;
|
virCapsGuestDomainInfo info;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ virCapabilitiesAddGuest(virCapsPtr caps,
|
|||||||
|
|
||||||
extern virCapsGuestDomainPtr
|
extern virCapsGuestDomainPtr
|
||||||
virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
|
virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
|
||||||
const char *hvtype,
|
int hvtype,
|
||||||
const char *emulator,
|
const char *emulator,
|
||||||
const char *loader,
|
const char *loader,
|
||||||
int nmachines,
|
int nmachines,
|
||||||
@ -280,17 +280,17 @@ virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpu,
|
|||||||
extern virArch
|
extern virArch
|
||||||
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
||||||
int ostype,
|
int ostype,
|
||||||
const char *domain);
|
int domain);
|
||||||
extern const char *
|
extern const char *
|
||||||
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
||||||
int ostype,
|
int ostype,
|
||||||
virArch arch,
|
virArch arch,
|
||||||
const char *domain);
|
int domain);
|
||||||
extern const char *
|
extern const char *
|
||||||
virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
|
virCapabilitiesDefaultGuestEmulator(virCapsPtr caps,
|
||||||
int ostype,
|
int ostype,
|
||||||
virArch arch,
|
virArch arch,
|
||||||
const char *domain);
|
int domain);
|
||||||
|
|
||||||
extern char *
|
extern char *
|
||||||
virCapabilitiesFormatXML(virCapsPtr caps);
|
virCapabilitiesFormatXML(virCapsPtr caps);
|
||||||
|
@ -12959,27 +12959,20 @@ char *
|
|||||||
virDomainDefGetDefaultEmulator(virDomainDefPtr def,
|
virDomainDefGetDefaultEmulator(virDomainDefPtr def,
|
||||||
virCapsPtr caps)
|
virCapsPtr caps)
|
||||||
{
|
{
|
||||||
const char *type;
|
|
||||||
const char *emulator;
|
const char *emulator;
|
||||||
char *retemu;
|
char *retemu;
|
||||||
|
|
||||||
type = virDomainVirtTypeToString(def->virtType);
|
|
||||||
if (!type) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("unknown virt type"));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
emulator = virCapabilitiesDefaultGuestEmulator(caps,
|
emulator = virCapabilitiesDefaultGuestEmulator(caps,
|
||||||
def->os.type,
|
def->os.type,
|
||||||
def->os.arch,
|
def->os.arch,
|
||||||
type);
|
def->virtType);
|
||||||
|
|
||||||
if (!emulator) {
|
if (!emulator) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no emulator for domain %s os type %s "
|
_("no emulator for domain %s os type %s "
|
||||||
"on architecture %s"),
|
"on architecture %s"),
|
||||||
type, virDomainOSTypeToString(def->os.type),
|
virDomainVirtTypeToString(def->virtType),
|
||||||
|
virDomainOSTypeToString(def->os.type),
|
||||||
virArchToString(def->os.arch));
|
virArchToString(def->os.arch));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -14696,7 +14689,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
def->os.arch =
|
def->os.arch =
|
||||||
virCapabilitiesDefaultGuestArch(caps,
|
virCapabilitiesDefaultGuestArch(caps,
|
||||||
def->os.type,
|
def->os.type,
|
||||||
virDomainVirtTypeToString(def->virtType));
|
def->virtType);
|
||||||
if (!def->os.arch) {
|
if (!def->os.arch) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no supported architecture for os type '%s'"),
|
_("no supported architecture for os type '%s'"),
|
||||||
@ -14709,7 +14702,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
const char *defaultMachine = virCapabilitiesDefaultGuestMachine(caps,
|
const char *defaultMachine = virCapabilitiesDefaultGuestMachine(caps,
|
||||||
def->os.type,
|
def->os.type,
|
||||||
def->os.arch,
|
def->os.arch,
|
||||||
virDomainVirtTypeToString(def->virtType));
|
def->virtType);
|
||||||
if (VIR_STRDUP(def->os.machine, defaultMachine) < 0)
|
if (VIR_STRDUP(def->os.machine, defaultMachine) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -581,7 +581,7 @@ esxCapsInit(esxPrivate *priv)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0, NULL))
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
/* x86_64 */
|
/* x86_64 */
|
||||||
@ -594,7 +594,7 @@ esxCapsInit(esxPrivate *priv)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0, NULL))
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"xen",
|
VIR_DOMAIN_VIRT_XEN,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -108,7 +108,7 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"lxc",
|
VIR_DOMAIN_VIRT_LXC,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -127,7 +127,7 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"lxc",
|
VIR_DOMAIN_VIRT_LXC,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -188,7 +188,7 @@ virCapsPtr openvzCapsInit(void)
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"openvz",
|
VIR_DOMAIN_VIRT_OPENVZ,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -106,8 +106,8 @@ parallelsBuildCapabilities(void)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
|
||||||
"parallels", NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_EXE,
|
||||||
@ -116,8 +116,8 @@ parallelsBuildCapabilities(void)
|
|||||||
NULL, 0, NULL)) == NULL)
|
NULL, 0, NULL)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PARALLELS,
|
||||||
"parallels", NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (nodeGetInfo(&nodeinfo))
|
if (nodeGetInfo(&nodeinfo))
|
||||||
|
@ -347,8 +347,8 @@ phypCapsInit(void)
|
|||||||
NULL, NULL, 0, NULL)) == NULL)
|
NULL, NULL, 0, NULL)) == NULL)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_PHYP,
|
||||||
"phyp", NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
|
@ -858,7 +858,7 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"qemu",
|
VIR_DOMAIN_VIRT_QEMU,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -867,7 +867,7 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
|
|||||||
|
|
||||||
if (haskqemu &&
|
if (haskqemu &&
|
||||||
virCapabilitiesAddGuestDomain(guest,
|
virCapabilitiesAddGuestDomain(guest,
|
||||||
"kqemu",
|
VIR_DOMAIN_VIRT_KQEMU,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -882,7 +882,7 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((dom = virCapabilitiesAddGuestDomain(guest,
|
if ((dom = virCapabilitiesAddGuestDomain(guest,
|
||||||
"kvm",
|
VIR_DOMAIN_VIRT_KVM,
|
||||||
kvmbin ? kvmbin : binary,
|
kvmbin ? kvmbin : binary,
|
||||||
NULL,
|
NULL,
|
||||||
nmachines,
|
nmachines,
|
||||||
@ -1899,7 +1899,7 @@ int virQEMUCapsGetDefaultVersion(virCapsPtr caps,
|
|||||||
if ((binary = virCapabilitiesDefaultGuestEmulator(caps,
|
if ((binary = virCapabilitiesDefaultGuestEmulator(caps,
|
||||||
VIR_DOMAIN_OSTYPE_HVM,
|
VIR_DOMAIN_OSTYPE_HVM,
|
||||||
hostarch,
|
hostarch,
|
||||||
"qemu")) == NULL) {
|
VIR_DOMAIN_VIRT_QEMU)) == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Cannot find suitable emulator for %s"),
|
_("Cannot find suitable emulator for %s"),
|
||||||
virArchToString(hostarch));
|
virArchToString(hostarch));
|
||||||
|
@ -13149,7 +13149,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
|
|||||||
virCapabilitiesDefaultGuestMachine(qemuCaps,
|
virCapabilitiesDefaultGuestMachine(qemuCaps,
|
||||||
def->os.type,
|
def->os.type,
|
||||||
def->os.arch,
|
def->os.arch,
|
||||||
virDomainVirtTypeToString(def->virtType));
|
def->virtType);
|
||||||
if (defaultMachine != NULL)
|
if (defaultMachine != NULL)
|
||||||
if (VIR_STRDUP(def->os.machine, defaultMachine) < 0)
|
if (VIR_STRDUP(def->os.machine, defaultMachine) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -353,7 +353,7 @@ testBuildCapabilities(virConnectPtr conn)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"test",
|
VIR_DOMAIN_VIRT_TEST,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -89,7 +89,7 @@ virCapsPtr umlCapsInit(void)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"uml",
|
VIR_DOMAIN_VIRT_UML,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -331,7 +331,7 @@ static virCapsPtr vboxCapsInit(void)
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"vbox",
|
VIR_DOMAIN_VIRT_VBOX,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -79,7 +79,7 @@ vmwareCapsInit(void)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"vmware",
|
VIR_DOMAIN_VIRT_VMWARE,
|
||||||
NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ vmwareCapsInit(void)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"vmware",
|
VIR_DOMAIN_VIRT_VMWARE,
|
||||||
NULL, NULL, 0, NULL) == NULL)
|
NULL, NULL, 0, NULL) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -2158,7 +2158,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch hostarch,
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"xen",
|
VIR_DOMAIN_VIRT_XEN,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -109,13 +109,13 @@ getCapsObject(void)
|
|||||||
guest1 = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, "", "", 0, NULL);
|
guest1 = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM, VIR_ARCH_X86_64, "", "", 0, NULL);
|
||||||
if (!guest1)
|
if (!guest1)
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
domain1 = virCapabilitiesAddGuestDomain(guest1, "xen", "", "", 0, NULL);
|
domain1 = virCapabilitiesAddGuestDomain(guest1, VIR_DOMAIN_VIRT_XEN, "", "", 0, NULL);
|
||||||
if (!domain1)
|
if (!domain1)
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
guest2 = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XEN, VIR_ARCH_X86_64, "", "", 0, NULL);
|
guest2 = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_XEN, VIR_ARCH_X86_64, "", "", 0, NULL);
|
||||||
if (!guest2)
|
if (!guest2)
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
domain2 = virCapabilitiesAddGuestDomain(guest2, "xen", "", "", 0, NULL);
|
domain2 = virCapabilitiesAddGuestDomain(guest2, VIR_DOMAIN_VIRT_XEN, "", "", 0, NULL);
|
||||||
if (!domain2)
|
if (!domain2)
|
||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
|
|
||||||
|
@ -1002,7 +1002,7 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
|
|||||||
def->os.arch =
|
def->os.arch =
|
||||||
virCapabilitiesDefaultGuestArch(caps,
|
virCapabilitiesDefaultGuestArch(caps,
|
||||||
def->os.type,
|
def->os.type,
|
||||||
virDomainVirtTypeToString(def->virtType));
|
def->virtType);
|
||||||
if (!def->os.arch) {
|
if (!def->os.arch) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no supported architecture for os type '%s'"),
|
_("no supported architecture for os type '%s'"),
|
||||||
@ -1013,7 +1013,7 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps)
|
|||||||
defaultMachine = virCapabilitiesDefaultGuestMachine(caps,
|
defaultMachine = virCapabilitiesDefaultGuestMachine(caps,
|
||||||
def->os.type,
|
def->os.type,
|
||||||
def->os.arch,
|
def->os.arch,
|
||||||
virDomainVirtTypeToString(def->virtType));
|
def->virtType);
|
||||||
if (defaultMachine != NULL) {
|
if (defaultMachine != NULL) {
|
||||||
if (VIR_STRDUP(def->os.machine, defaultMachine) < 0)
|
if (VIR_STRDUP(def->os.machine, defaultMachine) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -940,7 +940,7 @@ virCapsPtr virTestGenericCapsInit(void)
|
|||||||
0, NULL)) == NULL)
|
0, NULL)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "test", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
||||||
@ -949,7 +949,7 @@ virCapsPtr virTestGenericCapsInit(void)
|
|||||||
0, NULL)) == NULL)
|
0, NULL)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "test", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_TEST, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ virCapsPtr testLXCCapsInit(void)
|
|||||||
0, NULL)) == NULL)
|
0, NULL)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "lxc", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ virCapsPtr testLXCCapsInit(void)
|
|||||||
0, NULL)) == NULL)
|
0, NULL)) == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "lxc", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_LXC, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ static int testQemuAddPPC64Guest(virCapsPtr caps)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -179,7 +179,7 @@ static int testQemuAddPPC64LEGuest(virCapsPtr caps)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -209,7 +209,7 @@ static int testQemuAddPPCGuest(virCapsPtr caps)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -239,7 +239,7 @@ static int testQemuAddS390Guest(virCapsPtr caps)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -269,7 +269,7 @@ static int testQemuAddArmGuest(virCapsPtr caps)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -297,7 +297,7 @@ static int testQemuAddAARCH64Guest(virCapsPtr caps)
|
|||||||
if (!guest)
|
if (!guest)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (!virCapabilitiesAddGuestDomain(guest, "qemu", NULL, NULL, 0, NULL))
|
if (!virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_QEMU, NULL, NULL, 0, NULL))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -347,7 +347,7 @@ virCapsPtr testQemuCapsInit(void)
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"qemu",
|
VIR_DOMAIN_VIRT_QEMU,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -365,7 +365,7 @@ virCapsPtr testQemuCapsInit(void)
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"qemu",
|
VIR_DOMAIN_VIRT_QEMU,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -376,7 +376,7 @@ virCapsPtr testQemuCapsInit(void)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"kvm",
|
VIR_DOMAIN_VIRT_KVM,
|
||||||
"/usr/bin/kvm",
|
"/usr/bin/kvm",
|
||||||
NULL,
|
NULL,
|
||||||
nmachines,
|
nmachines,
|
||||||
@ -395,7 +395,7 @@ virCapsPtr testQemuCapsInit(void)
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"kvm",
|
VIR_DOMAIN_VIRT_KVM,
|
||||||
"/usr/bin/kvm",
|
"/usr/bin/kvm",
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
|
@ -37,7 +37,7 @@ virCapsPtr testXenCapsInit(void)
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"xen",
|
VIR_DOMAIN_VIRT_XEN,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -55,7 +55,7 @@ virCapsPtr testXenCapsInit(void)
|
|||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest,
|
if (virCapabilitiesAddGuestDomain(guest,
|
||||||
"xen",
|
VIR_DOMAIN_VIRT_XEN,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
@ -98,7 +98,7 @@ testXLInitCaps(void)
|
|||||||
nmachines, machines)) == NULL)
|
nmachines, machines)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
if (virCapabilitiesAddGuestDomain(guest, "xen", NULL,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
||||||
NULL, 0, NULL) == NULL)
|
NULL, 0, NULL) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
nmachines = ARRAY_CARDINALITY(xen_machines);
|
nmachines = ARRAY_CARDINALITY(xen_machines);
|
||||||
@ -113,7 +113,7 @@ testXLInitCaps(void)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
machines = NULL;
|
machines = NULL;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, "xen", NULL,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_XEN, NULL,
|
||||||
NULL, 0, NULL) == NULL)
|
NULL, 0, NULL) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
return caps;
|
return caps;
|
||||||
|
@ -41,7 +41,7 @@ testCapsInit(void)
|
|||||||
if (guest == NULL)
|
if (guest == NULL)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ testCapsInit(void)
|
|||||||
if (guest == NULL)
|
if (guest == NULL)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ testCapsInit(void)
|
|||||||
if (guest == NULL)
|
if (guest == NULL)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ testCapsInit(void)
|
|||||||
if (guest == NULL)
|
if (guest == NULL)
|
||||||
goto failure;
|
goto failure;
|
||||||
|
|
||||||
if (virCapabilitiesAddGuestDomain(guest, "vmware", NULL, NULL, 0,
|
if (virCapabilitiesAddGuestDomain(guest, VIR_DOMAIN_VIRT_VMWARE, NULL, NULL, 0,
|
||||||
NULL) == NULL) {
|
NULL) == NULL) {
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user