Skip to content
Snippets Groups Projects
Commit df5f5a0f authored by Guido Günther's avatar Guido Günther
Browse files

pull kvm/qemu patches from upstream

parent 4087b7dd
No related branches found
No related tags found
No related merge requests found
From: Daniel P. Berrange <berrange@redhat.com>
Date: Mon, 11 May 2009 15:14:24 +0000
Subject: [PATCH] Fix QEMU ARGV detection with kvm >= 85
---
src/qemu_conf.c | 18 ++++++++++++++----
src/qemu_driver.c | 12 ++----------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 64415ec..a0b406b 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -431,18 +431,28 @@ int qemudExtractVersionInfo(const char *qemu,
return -1;
char *help = NULL;
- enum { MAX_HELP_OUTPUT_SIZE = 8192 };
+ enum { MAX_HELP_OUTPUT_SIZE = 1024*64 };
int len = virFileReadLimFD(newstdout, MAX_HELP_OUTPUT_SIZE, &help);
- if (len < 0)
+ if (len < 0) {
+ virReportSystemError(NULL, errno, "%s",
+ _("Unable to read QEMU help output"));
goto cleanup2;
+ }
if (sscanf(help, "QEMU PC emulator version %u.%u.%u (kvm-%u)",
&major, &minor, &micro, &kvm_version) != 4)
kvm_version = 0;
- if (!kvm_version && sscanf(help, "QEMU PC emulator version %u.%u.%u",
- &major, &minor, &micro) != 3)
+ if (!kvm_version &&
+ sscanf(help, "QEMU PC emulator version %u.%u.%u",
+ &major, &minor, &micro) != 3) {
+ char *eol = strchr(help, '\n');
+ if (eol) *eol = '\0';
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse QEMU version number in '%s'"),
+ help);
goto cleanup2;
+ }
version = (major * 1000 * 1000) + (minor * 1000) + micro;
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index f9fe2ba..4b51a65 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -1379,12 +1379,8 @@ static int qemudStartVMDaemon(virConnectPtr conn,
if (qemudExtractVersionInfo(emulator,
NULL,
- &qemuCmdFlags) < 0) {
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("Cannot determine QEMU argv syntax %s"),
- emulator);
+ &qemuCmdFlags) < 0)
goto cleanup;
- }
if (qemuPrepareHostDevices(conn, vm->def) < 0)
goto cleanup;
@@ -3614,12 +3610,8 @@ static int qemudDomainChangeEjectableMedia(virConnectPtr conn,
if (qemudExtractVersionInfo(vm->def->emulator,
NULL,
- &qemuCmdFlags) < 0) {
- qemudReportError(conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
- _("Cannot determine QEMU argv syntax %s"),
- vm->def->emulator);
+ &qemuCmdFlags) < 0)
return -1;
- }
if (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE) {
if (!(devname = qemudDiskDeviceName(conn, newdisk)))
--
From: Daniel P. Berrange <berrange@redhat.com>
Date: Mon, 18 May 2009 15:10:51 +0000
Subject: [PATCH] Declare support for QEMU migration in capabilities
---
src/qemu_conf.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index a0b406b..4bd616a 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -370,7 +370,7 @@ virCapsPtr qemudCapsInit(void) {
uname (&utsname);
if ((caps = virCapabilitiesNew(utsname.machine,
- 0, 0)) == NULL)
+ 1, 1)) == NULL)
goto no_memory;
/* Using KVM's mac prefix for QEMU too */
@@ -379,6 +379,9 @@ virCapsPtr qemudCapsInit(void) {
if (virCapsInitNUMA(caps) < 0)
goto no_memory;
+ virCapabilitiesAddHostMigrateTransport(caps,
+ "tcp");
+
/* First the pure HVM guests */
for (i = 0 ; i < ARRAY_CARDINALITY(arch_info_hvm) ; i++)
if (qemudCapsInitGuest(caps,
--
......@@ -3,3 +3,5 @@
0003-allow-libvirt-group-to-access-the-socket.patch
0004-fix-Debian-specific-path-to-hvm-loader.patch
0005-don-t-crash-with-def-NULL.patch
0006-Fix-QEMU-ARGV-detection-with-kvm-85.patch
0007-Declare-support-for-QEMU-migration-in-capabilities.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment