[libvirt] Allow to change the maximum migration downtime -- bug 561935
by Alex Jia
Hi Daniel,
I have simulated a slow network by linux bridge on source host machine,
but I found that I hardly connected guest by serial or vnc, it is pretty
slow, I can't run other big application in the guest, so I change my idea,
as long as I have a slow link, whether the network is in source or target
machine, finally, I created slow network on target machine, the attachment
is a shell script about the network creation process.
Using 'tc' to throttle network traffic on the target host
# tc qdisc show
qdisc tbf 8004: dev eth0 root refcnt 2 rate 128000bit burst 128Kb lat 50.0ms
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
WRT big apps, I use stress tool to consume guest memory(current size is 4G),
cmd line argument as following:
stress --cpu 2 --io 2 --vm 50 --vm-bytes 128M --timeout 480s
And then running migration, and open another terminal set maximum migration
downtime 60000 milliseconds, the following error information is raised by
libvirt:
1.open one terminal run migrate
# virsh migrate rhel6 qemu+ssh://10.66.70.152/system
root(a)10.66.70.152's password:
2.open another terminal set maximum migration downtime
# virsh migrate-setmaxdowntime --domain rhel6 --downtime 60000
error: Requested operation is not valid: domain is not being migrated
In fact, step 1 will never be finished.
BTW, the guest can be successfully migrated if I don't use the above environment
configuration.
Best Regards,
Alex
14 years, 4 months
[libvirt] [PATCH] Ensure we return the callback ID in python events binding
by Daniel P. Berrange
A missing return statement in the python binding meant that
the callers could not get the callback ID, and thus not be
able to unregister event callbacks
* python/libvirt-override-virConnect.py: Add missing return
statement
---
python/libvirt-override-virConnect.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/python/libvirt-override-virConnect.py b/python/libvirt-override-virConnect.py
index 1a1cdd0..52914dc 100644
--- a/python/libvirt-override-virConnect.py
+++ b/python/libvirt-override-virConnect.py
@@ -146,3 +146,4 @@
if ret == -1:
raise libvirtError ('virConnectDomainEventRegisterAny() failed', conn=self)
self.domainEventCallbackID[ret] = opaque
+ return ret
--
1.6.6.1
14 years, 4 months
[libvirt] [PATCH] Implement virsh managedsave-remove command.
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
tools/virsh.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 6 ++++++
2 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 2d749de..8e5aa42 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1452,6 +1452,60 @@ cmdManagedSave(vshControl *ctl, const vshCmd *cmd)
}
/*
+ * "managedsave-remove" command
+ */
+static const vshCmdInfo info_managedsaveremove[] = {
+ {"help", N_("Remove managed save of a domain")},
+ {"desc", N_("Remove an existing managed save state file from a domain")},
+ {NULL, NULL}
+};
+
+static const vshCmdOptDef opts_managedsaveremove[] = {
+ {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
+ {NULL, 0, 0, NULL}
+};
+
+static int
+cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd)
+{
+ virDomainPtr dom;
+ char *name;
+ int ret = FALSE;
+ int hassave;
+
+ if (!vshConnectionUsability(ctl, ctl->conn))
+ return FALSE;
+
+ if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
+ return FALSE;
+
+ hassave = virDomainHasManagedSaveImage(dom, 0);
+ if (hassave < 0) {
+ vshError(ctl, _("Failed to check for domain managed save image"));
+ goto cleanup;
+ }
+
+ if (hassave) {
+ if (virDomainManagedSaveRemove(dom, 0) < 0) {
+ vshError(ctl, _("Failed to remove managed save image for domain %s"),
+ name);
+ goto cleanup;
+ }
+ else
+ vshPrint(ctl, _("Removed managedsave image for domain %s"), name);
+ }
+ else
+ vshPrint(ctl, _("Domain %s has no manage save image; removal skipped"),
+ name);
+
+ ret = TRUE;
+
+cleanup:
+ virDomainFree(dom);
+ return ret;
+}
+
+/*
* "schedinfo" command
*/
static const vshCmdInfo info_schedinfo[] = {
@@ -9273,6 +9327,7 @@ static const vshCmdDef commands[] = {
{"iface-destroy", cmdInterfaceDestroy, opts_interface_destroy, info_interface_destroy},
{"managedsave", cmdManagedSave, opts_managedsave, info_managedsave},
+ {"managedsave-remove", cmdManagedSaveRemove, opts_managedsaveremove, info_managedsaveremove},
{"nodeinfo", cmdNodeinfo, NULL, info_nodeinfo},
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 2b2227f..eb1fd04 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -380,6 +380,12 @@ Ask libvirt to save a running domain state in a place managed by libvirt.
If libvirt is asked to restart the domain later on it will resume it from
the saved domain state (and the state is discarded).
+=item B<managedsave-remove> I<domain-id>
+
+Remove the managed save file for a domain if it exists. The next time the
+domain is started it will not restore to its previous state but instead will
+do a full boot.
+
=item B<migrate> optional I<--live> I<--suspend> I<domain-id> I<desturi> I<migrateuri>
Migrate domain to another host. Add --live for live migration; --suspend
--
1.6.6.1
14 years, 4 months
[libvirt] [PATCH] daemon: Fix compilation error of dispatch.c
by Ryota Ozaki
[error message]
CC libvirtd-dispatch.o
dispatch.c: In function 'remoteDispatchFormatError':
dispatch.c:83: error: 'va_list' undeclared (first use in this function)
dispatch.c:83: error: (Each undeclared identifier is reported only once
dispatch.c:83: error: for each function it appears in.)
dispatch.c:83: error: expected ';' before 'args'
cc1: warnings being treated as errors
dispatch.c:87: error: implicit declaration of function 'va_start' [-Wimplicit-function-declaration]
dispatch.c:87: error: nested extern declaration of 'va_start' [-Wnested-externs]
dispatch.c:87: error: 'args' undeclared (first use in this function)
dispatch.c:88: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration]
dispatch.c:89: error: implicit declaration of function 'va_end' [-Wimplicit-function-declaration]
dispatch.c:89: error: nested extern declaration of 'va_end' [-Wnested-externs]
* daemon/dispatch.c: include stdio.h and stdarg.h
---
daemon/dispatch.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/daemon/dispatch.c b/daemon/dispatch.c
index 8f55eaa..966db71 100644
--- a/daemon/dispatch.c
+++ b/daemon/dispatch.c
@@ -23,6 +23,9 @@
#include <config.h>
+#include <stdio.h>
+#include <stdarg.h>
+
#include "dispatch.h"
#include "remote.h"
--
1.6.6.1
14 years, 4 months
[libvirt] [PATCH v3 0/8]: Add arbitrary qemu command-line and monitor commands
by Chris Lalancette
As we discussed previously, here is the patch series to add the ability
to specify arbitrary qemu command-line parameters and environment variables,
and also give arbitrary monitor commands to a guest. Because these
extra arguments have a good shot at confusing libvirt, the use of them
is not supported, but left available for advanced users and developers.
They are also in a separate library and have a separate on-the-wire
protocol.
There is one bug left that I have not yet been able to fix. Because of the
complicated way that virsh parses command-line arguments, it is not possible
to pass through spaces and quotes when using the qemu-monitor-command.
Unfortunately, the qemu monitor commands (and in particular when using QMP)
depend heavily on quoting and spacing, so using virsh to send through
command-lines is difficult. I'll have to think about how to better resolve
this issue, but it should not hold up the rest of the series.
I will point out one particular patch that could use some careful review,
namely PATCH 6/8. In there, I change the remote_message_hdr to use an
unsigned proc instead of a remote_procedure proc. Now, as far as I can tell
the two sizes should be the same, so the wire protocol should be the same.
Indeed, testing seems to show that older virsh can talk just fine to a libvirtd
with this patch applied. However, the regenerated remote_protocol.c file for
parsing remote_message_header has some strange bits in it that I don't quite
understand. I'm hoping someone else can look at it and confirm that it is OK.
Thanks to Dan Berrange and Eric Blake for their reviews already, and to DV
for the Relax NG schema changes.
Changes since v2 are listed in the individual patches.
14 years, 4 months
[libvirt] [PATCH] cpu: Add new models from qemu's target-x86_64.conf
by Jiri Denemark
---
src/cpu/cpu_map.xml | 283 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 283 insertions(+), 0 deletions(-)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index 3ec4a7e..986c61d 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -353,5 +353,288 @@
<feature name='ssse3'/>
<feature name='nx'/>
</model>
+
+ <model name='Conroe'>
+ <vendor>Intel</vendor>
+ <feature name='sse2'/>
+ <feature name='sse'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='sep'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='mtrr'/>
+ <feature name='clflush'/>
+ <feature name='mca'/>
+ <feature name='pse36'/>
+ <feature name='pni'/>
+ <feature name='ssse3'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='lm'/>
+ <feature name='syscall'/>
+ <feature name='nx'/>
+ <feature name='lahf_lm'/>
+ </model>
+
+ <model name='Penryn'>
+ <vendor>Intel</vendor>
+ <feature name='sse2'/>
+ <feature name='sse'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='sep'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='mtrr'/>
+ <feature name='clflush'/>
+ <feature name='mca'/>
+ <feature name='pse36'/>
+ <feature name='pni'/>
+ <feature name='cx16'/>
+ <feature name='ssse3'/>
+ <feature name='sse4.1'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='lm'/>
+ <feature name='syscall'/>
+ <feature name='nx'/>
+ <feature name='lahf_lm'/>
+ </model>
+
+ <model name='Nehalem'>
+ <vendor>Intel</vendor>
+ <feature name='sse2'/>
+ <feature name='sse'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='sep'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='mtrr'/>
+ <feature name='clflush'/>
+ <feature name='mca'/>
+ <feature name='pse36'/>
+ <feature name='pni'/>
+ <feature name='cx16'/>
+ <feature name='ssse3'/>
+ <feature name='sse4.1'/>
+ <feature name='sse4.2'/>
+ <feature name='popcnt'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='lm'/>
+ <feature name='syscall'/>
+ <feature name='nx'/>
+ <feature name='lahf_lm'/>
+ </model>
+
+ <model name='Opteron_G1'>
+ <vendor>AMD</vendor>
+ <feature name='sse2'/>
+ <feature name='sse'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='sep'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='mtrr'/>
+ <feature name='clflush'/>
+ <feature name='mca'/>
+ <feature name='pse36'/>
+ <feature name='pni'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='lm'/>
+ <feature name='syscall'/>
+ <feature name='nx'/>
+ </model>
+
+ <model name='Opteron_G2'>
+ <vendor>AMD</vendor>
+ <feature name='sse2'/>
+ <feature name='sse'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='sep'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='mtrr'/>
+ <feature name='clflush'/>
+ <feature name='mca'/>
+ <feature name='pse36'/>
+ <feature name='pni'/>
+ <feature name='cx16'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='lm'/>
+ <feature name='syscall'/>
+ <feature name='nx'/>
+ <feature name='rdtscp'/>
+ <feature name='svm'/>
+ <feature name='lahf_lm'/>
+ </model>
+
+ <model name='Opteron_G3'>
+ <vendor>AMD</vendor>
+ <feature name='sse2'/>
+ <feature name='sse'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='sep'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='mtrr'/>
+ <feature name='clflush'/>
+ <feature name='mca'/>
+ <feature name='pse36'/>
+ <feature name='pni'/>
+ <feature name='cx16'/>
+ <feature name='monitor'/>
+ <feature name='popcnt'/>
+ <feature name='fxsr'/>
+ <feature name='mmx'/>
+ <feature name='pat'/>
+ <feature name='cmov'/>
+ <feature name='pge'/>
+ <feature name='apic'/>
+ <feature name='cx8'/>
+ <feature name='mce'/>
+ <feature name='pae'/>
+ <feature name='msr'/>
+ <feature name='tsc'/>
+ <feature name='pse'/>
+ <feature name='de'/>
+ <feature name='fpu'/>
+ <feature name='lm'/>
+ <feature name='syscall'/>
+ <feature name='nx'/>
+ <feature name='rdtscp'/>
+ <feature name='svm'/>
+ <feature name='sse4a'/>
+ <feature name='abm'/>
+ <feature name='misalignsse'/>
+ <feature name='lahf_lm'/>
+ </model>
</arch>
</cpus>
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] cpuBaseline: Detect empty set of common features
by Jiri Denemark
In case the set of CPUs has no features in common, report incompatible
CPUs instead of returning the simplest CPU model with all features
disabled.
---
src/cpu/cpu_x86.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 30a2db6..0266ce9 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -233,6 +233,26 @@ x86DataSubtract(union cpuData *data1,
}
+static bool
+x86DataIsEmpty(union cpuData *data)
+{
+ struct cpuX86cpuid zero = { 0, 0, 0, 0, 0 };
+ unsigned int i;
+
+ for (i = 0; i < data->x86.basic_len; i++) {
+ if (!x86cpuidMatch(data->x86.basic + i, &zero))
+ return false;
+ }
+
+ for (i = 0; i < data->x86.extended_len; i++) {
+ if (!x86cpuidMatch(data->x86.extended + i, &zero))
+ return false;
+ }
+
+ return true;
+}
+
+
static union cpuData *
x86DataFromModel(const struct x86_model *model)
{
@@ -1363,6 +1383,12 @@ x86Baseline(virCPUDefPtr *cpus,
if (!(data = x86DataFromModel(base_model)))
goto no_memory;
+ if (x86DataIsEmpty(data)) {
+ virCPUReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("CPUs are incompatible"));
+ goto error;
+ }
+
if (x86Decode(cpu, data, models, nmodels, NULL) < 0)
goto error;
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] cpuBaseline: Don't mess with the CPU returned by arch driver
by Jiri Denemark
All features in the baseline CPU definition were always created with
policy='require' even though an arch driver returned them with different
policy settings.
---
src/cpu/cpu.c | 12 +-----------
src/cpu/cpu_x86.c | 2 ++
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 580b767..8d6c22b 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -354,7 +354,6 @@ cpuBaseline(virCPUDefPtr *cpus,
unsigned int nmodels)
{
struct cpuArchDriver *driver;
- virCPUDefPtr cpu;
unsigned int i;
VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
@@ -394,16 +393,7 @@ cpuBaseline(virCPUDefPtr *cpus,
return NULL;
}
- if ((cpu = driver->baseline(cpus, ncpus, models, nmodels))) {
- cpu->type = VIR_CPU_TYPE_GUEST;
- cpu->match = VIR_CPU_MATCH_EXACT;
- VIR_FREE(cpu->arch);
-
- for (i = 0; i < cpu->nfeatures; i++)
- cpu->features[i].policy = VIR_CPU_FEATURE_REQUIRE;
- }
-
- return cpu;
+ return driver->baseline(cpus, ncpus, models, nmodels);
}
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index f7473bf..30a2db6 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1366,6 +1366,8 @@ x86Baseline(virCPUDefPtr *cpus,
if (x86Decode(cpu, data, models, nmodels, NULL) < 0)
goto error;
+ VIR_FREE(cpu->arch);
+
cleanup:
x86DataFree(data);
x86ModelFree(base_model);
--
1.7.1.1
14 years, 4 months
[libvirt] [PATCH] Make html docs in non-srcdir build
by Jiri Denemark
---
docs/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index c01e085..1183321 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -53,7 +53,7 @@ gif = \
architecture.gif \
node.gif
-dot_html_in = $(wildcard *.html.in)
+dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in))
dot_html = $(dot_html_in:%.html.in=%.html)
patches = $(wildcard api_extension/*.patch)
--
1.7.1.1
14 years, 4 months