mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 15:43:51 +00:00
check availbility of emulators before reporting them in capabilities
* src/qemu_conf.c: patch from Cole Robinson to report in the capabilities only the ones where the emulators is actually found * po/libvirt.pot: regenerated * src/libvirt.c: small typo fix Daniel
This commit is contained in:
parent
41ce15a586
commit
b8f2610280
@ -1,3 +1,10 @@
|
|||||||
|
Tue Sep 2 16:55:01 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/qemu_conf.c: patch from Cole Robinson to report in the
|
||||||
|
capabilities only the ones where the emulators is actually found
|
||||||
|
* po/libvirt.pot: regenerated
|
||||||
|
* src/libvirt.c: small typo fix
|
||||||
|
|
||||||
Tue Sep 2 16:12:20 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
Tue Sep 2 16:12:20 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/storage_backend.h src/storage_backend_logical.c
|
* src/storage_backend.h src/storage_backend_logical.c
|
||||||
|
1749
po/libvirt.pot
1749
po/libvirt.pot
File diff suppressed because it is too large
Load Diff
@ -848,7 +848,7 @@ failed:
|
|||||||
if (ret->driver) ret->driver->close (ret);
|
if (ret->driver) ret->driver->close (ret);
|
||||||
if (uri) xmlFreeURI(uri);
|
if (uri) xmlFreeURI(uri);
|
||||||
|
|
||||||
/* If not global error was set, copy any error set
|
/* If no global error was set, copy any error set
|
||||||
in the connection object we're about to dispose of */
|
in the connection object we're about to dispose of */
|
||||||
if (__lastErr.code == VIR_ERR_OK) {
|
if (__lastErr.code == VIR_ERR_OK) {
|
||||||
memcpy(&__lastErr, &ret->err, sizeof(ret->err));
|
memcpy(&__lastErr, &ret->err, sizeof(ret->err));
|
||||||
|
@ -226,7 +226,29 @@ qemudCapsInitGuest(virCapsPtr caps,
|
|||||||
const struct qemu_arch_info *info,
|
const struct qemu_arch_info *info,
|
||||||
int hvm) {
|
int hvm) {
|
||||||
virCapsGuestPtr guest;
|
virCapsGuestPtr guest;
|
||||||
int i;
|
int i, haskvm, hasbase, samearch;
|
||||||
|
const char *kvmbin = NULL;
|
||||||
|
|
||||||
|
/* Check for existance of base emulator */
|
||||||
|
hasbase = (access(info->binary, X_OK) == 0);
|
||||||
|
|
||||||
|
samearch = STREQ(info->arch, hostmachine);
|
||||||
|
if (samearch) {
|
||||||
|
const char *const kvmbins[] = { "/usr/bin/qemu-kvm", /* Fedora */
|
||||||
|
"/usr/bin/kvm" }; /* Upstream .spec */
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_CARDINALITY(kvmbins); ++i) {
|
||||||
|
if ((haskvm = (access(kvmbins[i], X_OK) == 0))) {
|
||||||
|
kvmbin = kvmbins[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
haskvm = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasbase && !haskvm)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if ((guest = virCapabilitiesAddGuest(caps,
|
if ((guest = virCapabilitiesAddGuest(caps,
|
||||||
hvm ? "hvm" : "xen",
|
hvm ? "hvm" : "xen",
|
||||||
@ -239,8 +261,7 @@ qemudCapsInitGuest(virCapsPtr caps,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (hvm) {
|
if (hvm) {
|
||||||
/* Check for existance of base emulator */
|
if (hasbase &&
|
||||||
if (access(info->binary, X_OK) == 0 &&
|
|
||||||
virCapabilitiesAddGuestDomain(guest,
|
virCapabilitiesAddGuestDomain(guest,
|
||||||
"qemu",
|
"qemu",
|
||||||
NULL,
|
NULL,
|
||||||
@ -250,7 +271,7 @@ qemudCapsInitGuest(virCapsPtr caps,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* If guest & host match, then we can accelerate */
|
/* If guest & host match, then we can accelerate */
|
||||||
if (STREQ(info->arch, hostmachine)) {
|
if (samearch) {
|
||||||
if (access("/dev/kqemu", F_OK) == 0 &&
|
if (access("/dev/kqemu", F_OK) == 0 &&
|
||||||
virCapabilitiesAddGuestDomain(guest,
|
virCapabilitiesAddGuestDomain(guest,
|
||||||
"kqemu",
|
"kqemu",
|
||||||
@ -261,9 +282,10 @@ qemudCapsInitGuest(virCapsPtr caps,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (access("/dev/kvm", F_OK) == 0 &&
|
if (access("/dev/kvm", F_OK) == 0 &&
|
||||||
|
haskvm &&
|
||||||
virCapabilitiesAddGuestDomain(guest,
|
virCapabilitiesAddGuestDomain(guest,
|
||||||
"kvm",
|
"kvm",
|
||||||
"/usr/bin/qemu-kvm",
|
kvmbin,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
NULL) == NULL)
|
NULL) == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user