Accepting request 82564 from Virtualization
Updated libvirt package for Factory... - Enable building with libnetcontrol - Select libnl-1_1-devel - Set qemu migration speed unlimited when migrating to file 7e5f6a51-rpc-generator.patch b12354be-mig-speed-1.patch 1282bd80-mig-speed-2.patch 6f84e110-mig-speed-3.patch 829bce17-mig-speed-4.patch 8fc40c51-mig-speed-5.patch ef1065cf-mig-speed-6.patch 0257ba8f-mig-speed-7.patch bnc#706436 - Increase max size of buffer used to receive xend response 57c95175-xend-buff-size.patch - Don't overwrite useful error messages in legacy xen driver 32620dab-fix-xen-err-msg.patch bnc#711096 - Add upstream patches to stop excessive logging 7f2498ef-no-log-invalid.patch 6ff9fc26-quiet-libxl-logging.patch - Add 'Conflicts: kvm < 0.14.1' to ensure libvirt is using a kvm package that creates qemu user:group. Remove user:group creation from libvirt bnc#694883 - Add libvirt group at package installation bnc#694885 - Explicitly add 'BuildRequires: libgcrypt-devel' since it is no longer required by libgnutls-devel OBS-URL: https://build.opensuse.org/request/show/82564 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=86
This commit is contained in:
commit
c7db9a722e
50
0257ba8f-mig-speed-7.patch
Normal file
50
0257ba8f-mig-speed-7.patch
Normal file
@ -0,0 +1,50 @@
|
||||
commit 0257ba8f9f4bf522a106aa2bbb4756e391a3dd42
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:27 2011 -0600
|
||||
|
||||
Use max bandwidth from qemuDomainObjPrivate struct when migrating
|
||||
|
||||
Adjust qemuMigrationRun() to use migMaxBandwidth in qemuDomainObjPrivate
|
||||
structure when setting qemu migration speed. Caller-specified 'resource'
|
||||
parameter overrides migMaxBandwidth.
|
||||
|
||||
Index: libvirt-0.9.4/src/qemu/qemu_migration.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/qemu/qemu_migration.c
|
||||
+++ libvirt-0.9.4/src/qemu/qemu_migration.c
|
||||
@@ -1284,6 +1284,7 @@ static int doNativeMigrate(struct qemud_
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
unsigned int background_flags = QEMU_MONITOR_MIGRATE_BACKGROUND;
|
||||
qemuMigrationCookiePtr mig = NULL;
|
||||
+ unsigned long migrate_speed = resource ? resource : priv->migMaxBandwidth;
|
||||
VIR_DEBUG("driver=%p, vm=%p, uri=%s, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=%x, dname=%s, resource=%lu",
|
||||
driver, vm, uri, NULLSTR(cookiein), cookieinlen,
|
||||
@@ -1334,8 +1335,7 @@ static int doNativeMigrate(struct qemud_
|
||||
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- if (resource > 0 &&
|
||||
- qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
|
||||
+ if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1506,6 +1506,7 @@ static int doTunnelMigrate(struct qemud_
|
||||
int ret = -1;
|
||||
qemuMigrationCookiePtr mig = NULL;
|
||||
qemuMigrationIOThreadPtr iothread = NULL;
|
||||
+ unsigned long migrate_speed = resource ? resource : priv->migMaxBandwidth;
|
||||
VIR_DEBUG("driver=%p, vm=%p, st=%p, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=%lx, resource=%lu",
|
||||
driver, vm, st, NULLSTR(cookiein), cookieinlen,
|
||||
@@ -1597,8 +1598,7 @@ static int doTunnelMigrate(struct qemud_
|
||||
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- if (resource > 0 &&
|
||||
- qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
|
||||
+ if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
|
||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
goto cleanup;
|
||||
}
|
80
1282bd80-mig-speed-2.patch
Normal file
80
1282bd80-mig-speed-2.patch
Normal file
@ -0,0 +1,80 @@
|
||||
commit 1282bd80f752b1b11e031881b7b64dea214a2461
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:24 2011 -0600
|
||||
|
||||
virsh: Expose virDomainMigrateGetMaxSpeed API
|
||||
|
||||
Index: libvirt-0.9.4/tools/virsh.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/tools/virsh.c
|
||||
+++ libvirt-0.9.4/tools/virsh.c
|
||||
@@ -5200,6 +5200,45 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * "migrate-getspeed" command
|
||||
+ */
|
||||
+static const vshCmdInfo info_migrate_getspeed[] = {
|
||||
+ {"help", N_("Get the maximum migration bandwidth")},
|
||||
+ {"desc", N_("Get the maximum migration bandwidth (in Mbps) for a domain.")},
|
||||
+ {NULL, NULL}
|
||||
+};
|
||||
+
|
||||
+static const vshCmdOptDef opts_migrate_getspeed[] = {
|
||||
+ {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
|
||||
+ {NULL, 0, 0, NULL}
|
||||
+};
|
||||
+
|
||||
+static bool
|
||||
+cmdMigrateGetMaxSpeed(vshControl *ctl, const vshCmd *cmd)
|
||||
+{
|
||||
+ virDomainPtr dom = NULL;
|
||||
+ unsigned long bandwidth;
|
||||
+ bool ret = false;
|
||||
+
|
||||
+ if (!vshConnectionUsability(ctl, ctl->conn))
|
||||
+ return false;
|
||||
+
|
||||
+ if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
|
||||
+ return false;
|
||||
+
|
||||
+ if (virDomainMigrateGetMaxSpeed(dom, &bandwidth, 0) < 0)
|
||||
+ goto done;
|
||||
+
|
||||
+ vshPrint(ctl, "%lu\n", bandwidth);
|
||||
+
|
||||
+ ret = true;
|
||||
+
|
||||
+done:
|
||||
+ virDomainFree(dom);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
typedef enum {
|
||||
VSH_CMD_BLOCK_JOB_ABORT = 0,
|
||||
VSH_CMD_BLOCK_JOB_INFO = 1,
|
||||
@@ -12519,6 +12558,8 @@ static const vshCmdDef domManagementCmds
|
||||
opts_migrate_setmaxdowntime, info_migrate_setmaxdowntime, 0},
|
||||
{"migrate-setspeed", cmdMigrateSetMaxSpeed,
|
||||
opts_migrate_setspeed, info_migrate_setspeed, 0},
|
||||
+ {"migrate-getspeed", cmdMigrateGetMaxSpeed,
|
||||
+ opts_migrate_getspeed, info_migrate_getspeed, 0},
|
||||
{"reboot", cmdReboot, opts_reboot, info_reboot, 0},
|
||||
{"restore", cmdRestore, opts_restore, info_restore, 0},
|
||||
{"resume", cmdResume, opts_resume, info_resume, 0},
|
||||
Index: libvirt-0.9.4/tools/virsh.pod
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/tools/virsh.pod
|
||||
+++ libvirt-0.9.4/tools/virsh.pod
|
||||
@@ -619,6 +619,10 @@ to be down at the end of live migration.
|
||||
Set the maximum migration bandwidth (in Mbps) for a domain which is being
|
||||
migrated to another host.
|
||||
|
||||
+=item B<migrate-getspeed> I<domain-id>
|
||||
+
|
||||
+Get the maximum migration bandwidth (in Mbps) for a domain.
|
||||
+
|
||||
=item B<reboot> I<domain-id>
|
||||
|
||||
Reboot a domain. This acts just as if the domain had the B<reboot>
|
47
32620dab-fix-xen-err-msg.patch
Normal file
47
32620dab-fix-xen-err-msg.patch
Normal file
@ -0,0 +1,47 @@
|
||||
commit 32620dabb12df70e14a645c20797b7658cd89e02
|
||||
Author: Jim Fehlig <jfehlig@suse.com>
|
||||
Date: Thu Sep 1 16:22:38 2011 -0600
|
||||
|
||||
Don't overwrite errors from xend_{get,req}
|
||||
|
||||
xenDaemonDomainFetch() was overwriting errors reported by
|
||||
xend_get() and xend_req(). E.g. without patch
|
||||
|
||||
error: failed Xen syscall xenDaemonDomainFetch failed to find this domain
|
||||
|
||||
with patch
|
||||
|
||||
error: internal error Xend returned HTTP Content-Length of 73817, which exceeds
|
||||
maximum of 65536
|
||||
|
||||
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
|
||||
index f44d674..957cd17 100644
|
||||
--- a/src/xen/xend_internal.c
|
||||
+++ b/src/xen/xend_internal.c
|
||||
@@ -359,8 +359,10 @@ xend_get(virConnectPtr xend, const char *path,
|
||||
ret = xend_req(s, content);
|
||||
VIR_FORCE_CLOSE(s);
|
||||
|
||||
- if (((ret < 0) || (ret >= 300)) &&
|
||||
- ((ret != 404) || (!STRPREFIX(path, "/xend/domain/")))) {
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ if ((ret >= 300) && ((ret != 404) || (!STRPREFIX(path, "/xend/domain/")))) {
|
||||
virXendError(VIR_ERR_GET_FAILED,
|
||||
_("%d status from xen daemon: %s:%s"),
|
||||
ret, path, NULLSTR(*content));
|
||||
@@ -1810,12 +1812,8 @@ xenDaemonDomainFetch(virConnectPtr conn,
|
||||
root = sexpr_get(conn, "/xend/domain/%s?detail=1", name);
|
||||
else
|
||||
root = sexpr_get(conn, "/xend/domain/%d?detail=1", domid);
|
||||
- if (root == NULL) {
|
||||
- virXendError(VIR_ERR_XEN_CALL,
|
||||
- "%s", _("xenDaemonDomainFetch failed to"
|
||||
- " find this domain"));
|
||||
+ if (root == NULL)
|
||||
return (NULL);
|
||||
- }
|
||||
|
||||
priv = (xenUnifiedPrivatePtr) conn->privateData;
|
||||
|
24
57c95175-xend-buff-size.patch
Normal file
24
57c95175-xend-buff-size.patch
Normal file
@ -0,0 +1,24 @@
|
||||
commit 57c95175e271ca63b3f1be44efef8997f20ffe13
|
||||
Author: Jim Fehlig <jfehlig@suse.com>
|
||||
Date: Thu Sep 1 16:40:46 2011 -0600
|
||||
|
||||
Increase size of buffer for xend response
|
||||
|
||||
On systems with many pcpus, the sexpr returned by xend can be quite
|
||||
large for dom0 when it is configured to have #vcpus = #pcpus (default).
|
||||
E.g. on a 80 pcpu system, where dom0 had 80 vcpus, the sexpr details
|
||||
for dom0 was 73817 bytes! Increase maximum buffer size to 256k.
|
||||
|
||||
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
|
||||
index 957cd17..0a7fb48 100644
|
||||
--- a/src/xen/xend_internal.c
|
||||
+++ b/src/xen/xend_internal.c
|
||||
@@ -56,7 +56,7 @@
|
||||
* The number of Xen scheduler parameters
|
||||
*/
|
||||
|
||||
-#define XEND_RCV_BUF_MAX_LEN 65536
|
||||
+#define XEND_RCV_BUF_MAX_LEN (256 * 1024)
|
||||
|
||||
static int
|
||||
virDomainXMLDevID(virDomainPtr domain,
|
47
6f84e110-mig-speed-3.patch
Normal file
47
6f84e110-mig-speed-3.patch
Normal file
@ -0,0 +1,47 @@
|
||||
commit 6f84e110d61e6e99ee80809f1d3c2c6dde352965
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:22 2011 -0600
|
||||
|
||||
Store max migration bandwidth in qemuDomainObjPrivate struct
|
||||
|
||||
The maximum bandwidth that can be consumed when migrating a domain
|
||||
is better classified as an operational vs configuration parameter of
|
||||
the dommain. As such, store this parameter in qemuDomainObjPrivate
|
||||
structure.
|
||||
|
||||
Index: libvirt-0.9.4/src/qemu/qemu_domain.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/qemu/qemu_domain.c
|
||||
+++ libvirt-0.9.4/src/qemu/qemu_domain.c
|
||||
@@ -215,6 +215,8 @@ static void *qemuDomainObjPrivateAlloc(v
|
||||
if (qemuDomainObjInitJob(priv) < 0)
|
||||
VIR_FREE(priv);
|
||||
|
||||
+ priv->migMaxBandwidth = QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX;
|
||||
+
|
||||
return priv;
|
||||
}
|
||||
|
||||
Index: libvirt-0.9.4/src/qemu/qemu_domain.h
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/qemu/qemu_domain.h
|
||||
+++ libvirt-0.9.4/src/qemu/qemu_domain.h
|
||||
@@ -36,6 +36,9 @@
|
||||
(1 << VIR_DOMAIN_VIRT_KVM) | \
|
||||
(1 << VIR_DOMAIN_VIRT_XEN))
|
||||
|
||||
+# define QEMU_DOMAIN_DEFAULT_MIG_BANDWIDTH_MAX (32 << 20)
|
||||
+# define QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024))
|
||||
+
|
||||
# define JOB_MASK(job) (1 << (job - 1))
|
||||
# define DEFAULT_JOB_MASK \
|
||||
(JOB_MASK(QEMU_JOB_QUERY) | \
|
||||
@@ -113,6 +116,8 @@ struct _qemuDomainObjPrivate {
|
||||
char *lockState;
|
||||
|
||||
bool fakeReboot;
|
||||
+
|
||||
+ unsigned long migMaxBandwidth;
|
||||
};
|
||||
|
||||
struct qemuDomainWatchdogEvent
|
41
6ff9fc26-quiet-libxl-logging.patch
Normal file
41
6ff9fc26-quiet-libxl-logging.patch
Normal file
@ -0,0 +1,41 @@
|
||||
commit 6ff9fc26d3672cd6e822a20a70d9d36ee3e0c173
|
||||
Author: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Wed Aug 31 16:53:09 2011 +0100
|
||||
|
||||
Stop libxl driver polluting logs on non-Xen hosts
|
||||
|
||||
If the libxl driver is compiled in, then everytime libvirtd
|
||||
starts up on a non-Xen Dom0 host, it logs a error message.
|
||||
Since this is an expected condition, we should not log at
|
||||
'error' level, only 'info'.
|
||||
|
||||
* src/libxl/libxl_driver.c: Lower log level for certain
|
||||
expected errors during driver init
|
||||
|
||||
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
|
||||
index d6e0c28..91da438 100644
|
||||
--- a/src/libxl/libxl_driver.c
|
||||
+++ b/src/libxl/libxl_driver.c
|
||||
@@ -963,19 +963,19 @@ libxlStartup(int privileged) {
|
||||
libxl_driver->logger =
|
||||
(xentoollog_logger *)xtl_createlogger_stdiostream(libxl_driver->logger_file, XTL_DEBUG, 0);
|
||||
if (!libxl_driver->logger) {
|
||||
- VIR_ERROR(_("cannot create logger for libxenlight"));
|
||||
+ VIR_INFO("cannot create logger for libxenlight, disabling driver");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (libxl_ctx_init(&libxl_driver->ctx,
|
||||
LIBXL_VERSION,
|
||||
libxl_driver->logger)) {
|
||||
- VIR_ERROR(_("cannot initialize libxenlight context"));
|
||||
+ VIR_INFO("cannot initialize libxenlight context, probably not running in a Xen Dom0, disabling driver");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ver_info = libxl_get_version_info(&libxl_driver->ctx)) == NULL) {
|
||||
- VIR_ERROR(_("cannot version information from libxenlight"));
|
||||
+ VIR_INFO("cannot version information from libxenlight, disabling driver");
|
||||
goto fail;
|
||||
}
|
||||
libxl_driver->version = (ver_info->xen_version_major * 1000000) +
|
73
7e5f6a51-rpc-generator.patch
Normal file
73
7e5f6a51-rpc-generator.patch
Normal file
@ -0,0 +1,73 @@
|
||||
commit 7e5f6a516c1b0066206364655be31276056da147
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 11:46:41 2011 -0600
|
||||
|
||||
Fix generator to cope with call-by-ref long types
|
||||
|
||||
From: Matthias Bolte <matthias.bolte@googlemail.com>
|
||||
Tested-by: Jim Fehlig <jfehlig@novell.com>
|
||||
|
||||
Matthias provided this patch to fix an issue I encountered in the
|
||||
generator with APIs containing call-by-ref long type, e.g.
|
||||
|
||||
int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
|
||||
unsigned long *bandwidth,
|
||||
unsigned int flags);
|
||||
|
||||
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
|
||||
index 0d344e8..f671ff0 100755
|
||||
--- a/src/rpc/gendispatch.pl
|
||||
+++ b/src/rpc/gendispatch.pl
|
||||
@@ -640,10 +640,11 @@ elsif ($opt_b) {
|
||||
} elsif ($ret_member =~ m/^(?:unsigned )?hyper (\S+)<\S+>;/) {
|
||||
# error out on unannotated arrays
|
||||
die "hyper array without insert@<offset> annotation: $ret_member";
|
||||
- } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);/) {
|
||||
+ } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);(?:\s*\/\*\s*insert@(\d+)\s*\*\/)?/) {
|
||||
my $type_name = $1;
|
||||
my $ret_name = $2;
|
||||
my $ret_assign;
|
||||
+ my $insert = $3;
|
||||
|
||||
if (hyper_to_long($call->{ProcName}, "ret", $ret_name)) {
|
||||
my $sign = ""; $sign = "U" if ($1);
|
||||
@@ -657,7 +658,13 @@ elsif ($opt_b) {
|
||||
|
||||
push(@vars_list, "$type_name $ret_name");
|
||||
push(@ret_list, $ret_assign);
|
||||
- $single_ret_var = $ret_name;
|
||||
+
|
||||
+ if ($insert) {
|
||||
+ splice(@args_list, int($insert), 0, "&$ret_name");
|
||||
+ $single_ret_var = undef;
|
||||
+ } else {
|
||||
+ $single_ret_var = $ret_name;
|
||||
+ }
|
||||
|
||||
if ($call->{ProcName} eq "DomainGetMaxMemory" or
|
||||
$call->{ProcName} eq "NodeGetFreeMemory") {
|
||||
@@ -1285,6 +1292,24 @@ elsif ($opt_k) {
|
||||
|
||||
$single_ret_var = "int rv = -1";
|
||||
$single_ret_type = "int";
|
||||
+ } elsif ($ret_member =~ m/^(unsigned )?hyper (\S+);\s*\/\*\s*insert@(\d+)\s*\*\//) {
|
||||
+ my $type_name = $1;
|
||||
+ my $sign = ""; $sign = "U" if ($1);
|
||||
+ my $ret_name = $2;
|
||||
+ my $insert = $3;
|
||||
+
|
||||
+ if (hyper_to_long($call->{ProcName}, "ret", $ret_name)) {
|
||||
+ $type_name .= "long";
|
||||
+ push(@ret_list, "if ($ret_name) HYPER_TO_${sign}LONG(*$ret_name, ret.$ret_name);");
|
||||
+ } else {
|
||||
+ $type_name .= "long long";
|
||||
+ push(@ret_list, "if ($ret_name) *$ret_name = ret.$ret_name;");
|
||||
+ }
|
||||
+
|
||||
+ splice(@args_list, int($insert), 0, ("$type_name *$ret_name"));
|
||||
+ push(@ret_list, "rv = 0;");
|
||||
+ $single_ret_var = "int rv = -1";
|
||||
+ $single_ret_type = "int";
|
||||
} elsif ($ret_member =~ m/^unsigned hyper (\S+);/) {
|
||||
my $ret_name = $1;
|
||||
|
30
7f2498ef-no-log-invalid.patch
Normal file
30
7f2498ef-no-log-invalid.patch
Normal file
@ -0,0 +1,30 @@
|
||||
commit 7f2498efe45505135ed75c6548c21a89674cb6ba
|
||||
Author: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Tue Sep 13 18:24:13 2011 +0800
|
||||
|
||||
Do not log invalid operations in libvirtd logs
|
||||
|
||||
This is a bit painful for example when starting virt-manager
|
||||
it tends to clutter libvirtd.log with invalid operation on cpu pinning
|
||||
for defined but not running domains. A priori those kind of errors
|
||||
don't indicate an error when executing the command but on a precondition
|
||||
for running the API, and honnestly while the application should report
|
||||
it, logging it as an error in libvirtd.log is not really useful,
|
||||
|
||||
Related bug: https://bugzilla.redhat.com/show_bug.cgi?id=590807
|
||||
|
||||
* daemon/libvirtd.c: extend daemonErrorLogFilter() to filter out
|
||||
errors of type VIR_ERR_OPERATION_INVALID
|
||||
|
||||
Index: libvirt-0.9.4/daemon/libvirtd.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.4/daemon/libvirtd.c
|
||||
@@ -392,6 +392,7 @@ static int daemonErrorLogFilter(virError
|
||||
case VIR_ERR_NO_NWFILTER:
|
||||
case VIR_ERR_NO_SECRET:
|
||||
case VIR_ERR_NO_DOMAIN_SNAPSHOT:
|
||||
+ case VIR_ERR_OPERATION_INVALID:
|
||||
return VIR_LOG_DEBUG;
|
||||
}
|
||||
|
59
829bce17-mig-speed-4.patch
Normal file
59
829bce17-mig-speed-4.patch
Normal file
@ -0,0 +1,59 @@
|
||||
commit 829bce174c8a958dee4eb5b1fea63e0f5f914af8
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:23 2011 -0600
|
||||
|
||||
Impl virDomainMigrateGetMaxSpeed in qemu driver
|
||||
|
||||
Index: libvirt-0.9.4/src/qemu/qemu_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/qemu/qemu_driver.c
|
||||
+++ libvirt-0.9.4/src/qemu/qemu_driver.c
|
||||
@@ -8329,6 +8329,40 @@ static int qemuDomainSnapshotSetCurrentI
|
||||
}
|
||||
|
||||
|
||||
+static int
|
||||
+qemuDomainMigrateGetMaxSpeed(virDomainPtr dom,
|
||||
+ unsigned long *bandwidth,
|
||||
+ unsigned int flags)
|
||||
+{
|
||||
+ struct qemud_driver *driver = dom->conn->privateData;
|
||||
+ virDomainObjPtr vm;
|
||||
+ qemuDomainObjPrivatePtr priv;
|
||||
+ int ret = -1;
|
||||
+
|
||||
+ virCheckFlags(0, -1);
|
||||
+
|
||||
+ qemuDriverLock(driver);
|
||||
+ vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
||||
+ qemuDriverUnlock(driver);
|
||||
+
|
||||
+ if (!vm) {
|
||||
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||
+ virUUIDFormat(dom->uuid, uuidstr);
|
||||
+ qemuReportError(VIR_ERR_NO_DOMAIN,
|
||||
+ _("no domain with matching uuid '%s'"), uuidstr);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+ priv = vm->privateData;
|
||||
+ *bandwidth = priv->migMaxBandwidth;
|
||||
+ ret = 0;
|
||||
+
|
||||
+cleanup:
|
||||
+ if (vm)
|
||||
+ virDomainObjUnlock(vm);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int qemuDomainSnapshotIsAllowed(virDomainObjPtr vm)
|
||||
{
|
||||
int i;
|
||||
@@ -9494,6 +9528,7 @@ static virDriver qemuDriver = {
|
||||
.domainAbortJob = qemuDomainAbortJob, /* 0.7.7 */
|
||||
.domainMigrateSetMaxDowntime = qemuDomainMigrateSetMaxDowntime, /* 0.8.0 */
|
||||
.domainMigrateSetMaxSpeed = qemuDomainMigrateSetMaxSpeed, /* 0.9.0 */
|
||||
+ .domainMigrateGetMaxSpeed = qemuDomainMigrateGetMaxSpeed, /* 0.9.5 */
|
||||
.domainEventRegisterAny = qemuDomainEventRegisterAny, /* 0.8.0 */
|
||||
.domainEventDeregisterAny = qemuDomainEventDeregisterAny, /* 0.8.0 */
|
||||
.domainManagedSave = qemuDomainManagedSave, /* 0.8.0 */
|
65
8fc40c51-mig-speed-5.patch
Normal file
65
8fc40c51-mig-speed-5.patch
Normal file
@ -0,0 +1,65 @@
|
||||
commit 8fc40c511c08143cb64ff0d212942dde8e81c279
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:25 2011 -0600
|
||||
|
||||
Save migration speed in qemuDomainMigrateSetMaxSpeed
|
||||
|
||||
Now that migration speed is stored in qemuDomainObjPrivate structure,
|
||||
save the new value when invoking qemuDomainMigrateSetMaxSpeed().
|
||||
|
||||
Allow setting migration speed on inactive domain too.
|
||||
|
||||
Index: libvirt-0.9.4/src/qemu/qemu_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/qemu/qemu_driver.c
|
||||
+++ libvirt-0.9.4/src/qemu/qemu_driver.c
|
||||
@@ -8202,32 +8202,26 @@ qemuDomainMigrateSetMaxSpeed(virDomainPt
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MIGRATION_OP) < 0)
|
||||
- goto cleanup;
|
||||
-
|
||||
- if (!virDomainObjIsActive(vm)) {
|
||||
- qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
- "%s", _("domain is not running"));
|
||||
- goto endjob;
|
||||
- }
|
||||
-
|
||||
priv = vm->privateData;
|
||||
-
|
||||
- if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT) {
|
||||
- qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
- "%s", _("domain is not being migrated"));
|
||||
- goto endjob;
|
||||
+ if (virDomainObjIsActive(vm)) {
|
||||
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MIGRATION_OP) < 0)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ VIR_DEBUG("Setting migration bandwidth to %luMbs", bandwidth);
|
||||
+ qemuDomainObjEnterMonitor(driver, vm);
|
||||
+ ret = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
|
||||
+ qemuDomainObjExitMonitor(driver, vm);
|
||||
+
|
||||
+ if (ret == 0)
|
||||
+ priv->migMaxBandwidth = bandwidth;
|
||||
+
|
||||
+ if (qemuDomainObjEndJob(driver, vm) == 0)
|
||||
+ vm = NULL;
|
||||
+ } else {
|
||||
+ priv->migMaxBandwidth = bandwidth;
|
||||
+ ret = 0;
|
||||
}
|
||||
|
||||
- VIR_DEBUG("Setting migration bandwidth to %luMbs", bandwidth);
|
||||
- qemuDomainObjEnterMonitor(driver, vm);
|
||||
- ret = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
|
||||
- qemuDomainObjExitMonitor(driver, vm);
|
||||
-
|
||||
-endjob:
|
||||
- if (qemuDomainObjEndJob(driver, vm) == 0)
|
||||
- vm = NULL;
|
||||
-
|
||||
cleanup:
|
||||
if (vm)
|
||||
virDomainObjUnlock(vm);
|
292
b12354be-mig-speed-1.patch
Normal file
292
b12354be-mig-speed-1.patch
Normal file
@ -0,0 +1,292 @@
|
||||
commit b12354befee9f8e88d3d5d96390856af8f05eb2f
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:21 2011 -0600
|
||||
|
||||
Add public API for getting migration speed
|
||||
|
||||
Includes impl of python binding since the generator was not
|
||||
able to cope.
|
||||
|
||||
Note: Requires gendispatch.pl patch from Matthias Bolte
|
||||
|
||||
https://www.redhat.com/archives/libvir-list/2011-August/msg01367.html
|
||||
|
||||
Index: libvirt-0.9.4/docs/apibuild.py
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/docs/apibuild.py
|
||||
+++ libvirt-0.9.4/docs/apibuild.py
|
||||
@@ -1643,7 +1643,8 @@ class CParser:
|
||||
"virDomainSetMemory" : (False, ("memory")),
|
||||
"virDomainSetMemoryFlags" : (False, ("memory")),
|
||||
"virDomainBlockJobSetSpeed" : (False, ("bandwidth")),
|
||||
- "virDomainBlockPull" : (False, ("bandwidth")) }
|
||||
+ "virDomainBlockPull" : (False, ("bandwidth")),
|
||||
+ "virDomainMigrateGetMaxSpeed" : (False, ("bandwidth")) }
|
||||
|
||||
def checkLongLegacyFunction(self, name, return_type, signature):
|
||||
if "long" in return_type and "long long" not in return_type:
|
||||
Index: libvirt-0.9.4/include/libvirt/libvirt.h.in
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/include/libvirt/libvirt.h.in
|
||||
+++ libvirt-0.9.4/include/libvirt/libvirt.h.in
|
||||
@@ -711,6 +711,10 @@ int virDomainMigrateSetMaxSpeed(virDomai
|
||||
unsigned long bandwidth,
|
||||
unsigned int flags);
|
||||
|
||||
+int virDomainMigrateGetMaxSpeed(virDomainPtr domain,
|
||||
+ unsigned long *bandwidth,
|
||||
+ unsigned int flags);
|
||||
+
|
||||
/**
|
||||
* VIR_NODEINFO_MAXCPUS:
|
||||
* @nodeinfo: virNodeInfo instance
|
||||
Index: libvirt-0.9.4/python/generator.py
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/python/generator.py
|
||||
+++ libvirt-0.9.4/python/generator.py
|
||||
@@ -372,6 +372,7 @@ skip_impl = (
|
||||
'virNodeGetCPUStats',
|
||||
'virNodeGetMemoryStats',
|
||||
'virDomainGetBlockJobInfo',
|
||||
+ 'virDomainMigrateGetMaxSpeed',
|
||||
)
|
||||
|
||||
|
||||
Index: libvirt-0.9.4/python/libvirt-override-api.xml
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/python/libvirt-override-api.xml
|
||||
+++ libvirt-0.9.4/python/libvirt-override-api.xml
|
||||
@@ -356,5 +356,11 @@
|
||||
<arg name='flags' type='unsigned int' info='fine-tuning flags, currently unused, pass 0.'/>
|
||||
<return type='virDomainBlockJobInfo' info='A dictionary containing job information.' />
|
||||
</function>
|
||||
+ <function name='virDomainMigrateGetMaxSpeed' file='python'>
|
||||
+ <info>Get currently configured maximum migration speed for a domain</info>
|
||||
+ <arg name='domain' type='virDomainPtr' info='a domain object'/>
|
||||
+ <arg name='flags' type='unsigned int' info='flags, currently unused, pass 0.'/>
|
||||
+ <return type='unsigned long' info='current max migration speed, or None in case of error'/>
|
||||
+ </function>
|
||||
</symbols>
|
||||
</api>
|
||||
Index: libvirt-0.9.4/python/libvirt-override.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/python/libvirt-override.c
|
||||
+++ libvirt-0.9.4/python/libvirt-override.c
|
||||
@@ -4543,6 +4543,29 @@ libvirt_virDomainSendKey(PyObject *self
|
||||
return py_retval;
|
||||
}
|
||||
|
||||
+static PyObject *
|
||||
+libvirt_virDomainMigrateGetMaxSpeed(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
|
||||
+ PyObject *py_retval;
|
||||
+ int c_retval;
|
||||
+ unsigned long bandwidth;
|
||||
+ virDomainPtr domain;
|
||||
+ PyObject *pyobj_domain;
|
||||
+
|
||||
+ if (!PyArg_ParseTuple(args, (char *)"O:virDomainMigrateGetMaxSpeed", &pyobj_domain))
|
||||
+ return(NULL);
|
||||
+
|
||||
+ domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
|
||||
+
|
||||
+ LIBVIRT_BEGIN_ALLOW_THREADS;
|
||||
+ c_retval = virDomainMigrateGetMaxSpeed(domain, &bandwidth, 0);
|
||||
+ LIBVIRT_END_ALLOW_THREADS;
|
||||
+
|
||||
+ if (c_retval < 0)
|
||||
+ return VIR_PY_INT_FAIL;
|
||||
+ py_retval = libvirt_ulongWrap(bandwidth);
|
||||
+ return(py_retval);
|
||||
+}
|
||||
+
|
||||
/************************************************************************
|
||||
* *
|
||||
* The registration stuff *
|
||||
@@ -4632,6 +4655,7 @@ static PyMethodDef libvirtMethods[] = {
|
||||
{(char *) "virDomainRevertToSnapshot", libvirt_virDomainRevertToSnapshot, METH_VARARGS, NULL},
|
||||
{(char *) "virDomainGetBlockJobInfo", libvirt_virDomainGetBlockJobInfo, METH_VARARGS, NULL},
|
||||
{(char *) "virDomainSendKey", libvirt_virDomainSendKey, METH_VARARGS, NULL},
|
||||
+ {(char *) "virDomainMigrateGetMaxSpeed", libvirt_virDomainMigrateGetMaxSpeed, METH_VARARGS, NULL},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
Index: libvirt-0.9.4/src/driver.h
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/driver.h
|
||||
+++ libvirt-0.9.4/src/driver.h
|
||||
@@ -531,6 +531,11 @@ typedef int
|
||||
unsigned int flags);
|
||||
|
||||
typedef int
|
||||
+ (*virDrvDomainMigrateGetMaxSpeed)(virDomainPtr domain,
|
||||
+ unsigned long *bandwidth,
|
||||
+ unsigned int flags);
|
||||
+
|
||||
+typedef int
|
||||
(*virDrvDomainEventRegisterAny)(virConnectPtr conn,
|
||||
virDomainPtr dom,
|
||||
int eventID,
|
||||
@@ -827,6 +832,7 @@ struct _virDriver {
|
||||
virDrvDomainGetJobInfo domainGetJobInfo;
|
||||
virDrvDomainAbortJob domainAbortJob;
|
||||
virDrvDomainMigrateSetMaxDowntime domainMigrateSetMaxDowntime;
|
||||
+ virDrvDomainMigrateGetMaxSpeed domainMigrateGetMaxSpeed;
|
||||
virDrvDomainMigrateSetMaxSpeed domainMigrateSetMaxSpeed;
|
||||
virDrvDomainEventRegisterAny domainEventRegisterAny;
|
||||
virDrvDomainEventDeregisterAny domainEventDeregisterAny;
|
||||
Index: libvirt-0.9.4/src/libvirt.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/libvirt.c
|
||||
+++ libvirt-0.9.4/src/libvirt.c
|
||||
@@ -15157,6 +15157,57 @@ error:
|
||||
}
|
||||
|
||||
/**
|
||||
+ * virDomainMigrateGetMaxSpeed:
|
||||
+ * @domain: a domain object
|
||||
+ * @bandwidth: return value of current migration bandwidth limit in Mbps
|
||||
+ * @flags: fine-tuning flags, currently unused, use 0
|
||||
+ *
|
||||
+ * Get the current maximum bandwidth (in Mbps) that will be used if the
|
||||
+ * domain is migrated. Not all hypervisors will support a bandwidth limit.
|
||||
+ *
|
||||
+ * Returns 0 in case of success, -1 otherwise.
|
||||
+ */
|
||||
+int
|
||||
+virDomainMigrateGetMaxSpeed(virDomainPtr domain,
|
||||
+ unsigned long *bandwidth,
|
||||
+ unsigned int flags)
|
||||
+{
|
||||
+ virConnectPtr conn;
|
||||
+
|
||||
+ VIR_DOMAIN_DEBUG(domain, "bandwidth = %p, flags=%x", bandwidth, flags);
|
||||
+
|
||||
+ virResetLastError();
|
||||
+
|
||||
+ if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
|
||||
+ virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
|
||||
+ virDispatchError(NULL);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!bandwidth) {
|
||||
+ virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ conn = domain->conn;
|
||||
+ if (conn->flags & VIR_CONNECT_RO) {
|
||||
+ virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (conn->driver->domainMigrateGetMaxSpeed) {
|
||||
+ if (conn->driver->domainMigrateGetMaxSpeed(domain, bandwidth, flags) < 0)
|
||||
+ goto error;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
|
||||
+error:
|
||||
+ virDispatchError(conn);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* virConnectDomainEventRegisterAny:
|
||||
* @conn: pointer to the connection
|
||||
* @dom: pointer to the domain
|
||||
Index: libvirt-0.9.4/src/libvirt_public.syms
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/libvirt_public.syms
|
||||
+++ libvirt-0.9.4/src/libvirt_public.syms
|
||||
@@ -480,4 +480,9 @@ LIBVIRT_0.9.4 {
|
||||
virDomainBlockPull;
|
||||
} LIBVIRT_0.9.3;
|
||||
|
||||
+LIBVIRT_0.9.5 {
|
||||
+ global:
|
||||
+ virDomainMigrateGetMaxSpeed;
|
||||
+} LIBVIRT_0.9.4;
|
||||
+
|
||||
# .... define new API here using predicted next version number ....
|
||||
Index: libvirt-0.9.4/src/remote/remote_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/remote/remote_driver.c
|
||||
+++ libvirt-0.9.4/src/remote/remote_driver.c
|
||||
@@ -4327,6 +4327,7 @@ static virDriver remote_driver = {
|
||||
.domainAbortJob = remoteDomainAbortJob, /* 0.7.7 */
|
||||
.domainMigrateSetMaxDowntime = remoteDomainMigrateSetMaxDowntime, /* 0.8.0 */
|
||||
.domainMigrateSetMaxSpeed = remoteDomainMigrateSetMaxSpeed, /* 0.9.0 */
|
||||
+ .domainMigrateGetMaxSpeed = remoteDomainMigrateGetMaxSpeed, /* 0.9.5 */
|
||||
.domainEventRegisterAny = remoteDomainEventRegisterAny, /* 0.8.0 */
|
||||
.domainEventDeregisterAny = remoteDomainEventDeregisterAny, /* 0.8.0 */
|
||||
.domainManagedSave = remoteDomainManagedSave, /* 0.8.0 */
|
||||
Index: libvirt-0.9.4/src/remote/remote_protocol.x
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/remote/remote_protocol.x
|
||||
+++ libvirt-0.9.4/src/remote/remote_protocol.x
|
||||
@@ -1913,6 +1913,16 @@ struct remote_domain_migrate_set_max_spe
|
||||
unsigned int flags;
|
||||
};
|
||||
|
||||
+struct remote_domain_migrate_get_max_speed_args {
|
||||
+ remote_nonnull_domain dom;
|
||||
+ unsigned int flags;
|
||||
+};
|
||||
+
|
||||
+struct remote_domain_migrate_get_max_speed_ret {
|
||||
+ unsigned hyper bandwidth; /* insert@1 */
|
||||
+};
|
||||
+
|
||||
+
|
||||
struct remote_domain_events_register_any_args {
|
||||
int eventID;
|
||||
};
|
||||
@@ -2475,7 +2485,8 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_BLOCK_JOB_SET_SPEED = 239, /* autogen autogen */
|
||||
REMOTE_PROC_DOMAIN_BLOCK_PULL = 240, /* autogen autogen */
|
||||
|
||||
- REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB = 241 /* skipgen skipgen */
|
||||
+ REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB = 241, /* skipgen skipgen */
|
||||
+ REMOTE_PROC_DOMAIN_MIGRATE_GET_MAX_SPEED = 242 /* autogen autogen */
|
||||
|
||||
/*
|
||||
* Notice how the entries are grouped in sets of 10 ?
|
||||
Index: libvirt-0.9.4/src/remote_protocol-structs
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/remote_protocol-structs
|
||||
+++ libvirt-0.9.4/src/remote_protocol-structs
|
||||
@@ -1429,6 +1429,14 @@ struct remote_domain_migrate_set_max_spe
|
||||
uint64_t bandwidth;
|
||||
u_int flags;
|
||||
};
|
||||
+struct remote_domain_migrate_get_max_speed_args {
|
||||
+ remote_nonnull_domain dom;
|
||||
+ u_int flags;
|
||||
+};
|
||||
+struct remote_domain_migrate_get_max_speed_ret {
|
||||
+ uint64_t bandwidth;
|
||||
+};
|
||||
+
|
||||
struct remote_domain_events_register_any_args {
|
||||
int eventID;
|
||||
};
|
||||
@@ -1936,4 +1944,5 @@ enum remote_procedure {
|
||||
REMOTE_PROC_DOMAIN_BLOCK_JOB_SET_SPEED = 239,
|
||||
REMOTE_PROC_DOMAIN_BLOCK_PULL = 240,
|
||||
REMOTE_PROC_DOMAIN_EVENT_BLOCK_JOB = 241,
|
||||
+ REMOTE_PROC_DOMAIN_MIGRATE_GET_MAX_SPEED = 242,
|
||||
};
|
||||
Index: libvirt-0.9.4/src/rpc/gendispatch.pl
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/rpc/gendispatch.pl
|
||||
+++ libvirt-0.9.4/src/rpc/gendispatch.pl
|
||||
@@ -222,6 +222,7 @@ my $long_legacy = {
|
||||
NodeGetInfo => { ret => { memory => 1 } },
|
||||
DomainBlockPull => { arg => { bandwidth => 1 } },
|
||||
DomainBlockJobSetSpeed => { arg => { bandwidth => 1 } },
|
||||
+ DomainMigrateGetMaxSpeed => { ret => { bandwidth => 1 } },
|
||||
};
|
||||
|
||||
sub hyper_to_long
|
55
ef1065cf-mig-speed-6.patch
Normal file
55
ef1065cf-mig-speed-6.patch
Normal file
@ -0,0 +1,55 @@
|
||||
commit ef1065cf5acad13767c054758cbe7f4e8af5d241
|
||||
Author: Jim Fehlig <jfehlig@novell.com>
|
||||
Date: Fri Aug 26 12:10:26 2011 -0600
|
||||
|
||||
Set qemu migration speed unlimited when migrating to file
|
||||
|
||||
The qemu migration speed default is 32MiB/s as defined in migration.c
|
||||
|
||||
/* Migration speed throttling */
|
||||
static int64_t max_throttle = (32 << 20);
|
||||
|
||||
There's no need to throttle migration when targeting a file, so set migration
|
||||
speed to unlimited prior to migration, and restore to libvirt default value
|
||||
after migration.
|
||||
|
||||
Default units is MB for migrate_set_speed monitor command, so
|
||||
(INT64_MAX / (1024 * 1024)) is used for unlimited migration speed.
|
||||
|
||||
Tested with both json and text monitors.
|
||||
|
||||
Index: libvirt-0.9.4/src/qemu/qemu_migration.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/qemu/qemu_migration.c
|
||||
+++ libvirt-0.9.4/src/qemu/qemu_migration.c
|
||||
@@ -2675,6 +2675,16 @@ qemuMigrationToFile(struct qemud_driver
|
||||
bool restoreLabel = false;
|
||||
virCommandPtr cmd = NULL;
|
||||
int pipeFD[2] = { -1, -1 };
|
||||
+ unsigned long saveMigBandwidth = priv->migMaxBandwidth;
|
||||
+
|
||||
+ /* Increase migration bandwidth to unlimited since target is a file.
|
||||
+ * Failure to change migration speed is not fatal. */
|
||||
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
|
||||
+ qemuMonitorSetMigrationSpeed(priv->mon,
|
||||
+ QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX);
|
||||
+ priv->migMaxBandwidth = QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX;
|
||||
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
+ }
|
||||
|
||||
if (qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
|
||||
(!compressor || pipe(pipeFD) == 0)) {
|
||||
@@ -2783,6 +2793,13 @@ qemuMigrationToFile(struct qemud_driver
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
+ /* Restore max migration bandwidth */
|
||||
+ if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
|
||||
+ qemuMonitorSetMigrationSpeed(priv->mon, saveMigBandwidth);
|
||||
+ priv->migMaxBandwidth = saveMigBandwidth;
|
||||
+ qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||
+ }
|
||||
+
|
||||
VIR_FORCE_CLOSE(pipeFD[0]);
|
||||
VIR_FORCE_CLOSE(pipeFD[1]);
|
||||
virCommandFree(cmd);
|
225
libvirt-suse-netcontrol.patch
Normal file
225
libvirt-suse-netcontrol.patch
Normal file
@ -0,0 +1,225 @@
|
||||
Index: libvirt-0.9.4/configure.ac
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/configure.ac
|
||||
+++ libvirt-0.9.4/configure.ac
|
||||
@@ -63,6 +63,7 @@ AVAHI_REQUIRED="0.6.0"
|
||||
POLKIT_REQUIRED="0.6"
|
||||
PARTED_REQUIRED="1.8.0"
|
||||
NETCF_REQUIRED="0.1.4"
|
||||
+NETCONTROL_REQUIRED="0.2.0"
|
||||
UDEV_REQUIRED=145
|
||||
PCIACCESS_REQUIRED=0.10.0
|
||||
XMLRPC_REQUIRED=1.14.0
|
||||
@@ -1591,6 +1592,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
|
||||
AC_SUBST([NETCF_CFLAGS])
|
||||
AC_SUBST([NETCF_LIBS])
|
||||
|
||||
+AC_ARG_WITH([netcontrol],
|
||||
+ AC_HELP_STRING([--with-netcontrol], [SUSE netcontrol support to configure physical host network interfaces @<:@default=check@:>@]),
|
||||
+ [],
|
||||
+ [test "$with_netcontrol" = "yes" && with_netcontrol=no || with_netcontrol=check])
|
||||
+
|
||||
+NETCONTROL_CFLAGS=
|
||||
+NETCONTROL_LIBS=
|
||||
+if test "$with_netcf" = "yes"; then
|
||||
+ if test "$with_netcontrol" = "yes" || test "$with_netcontrol" = "check"; then
|
||||
+ AC_MSG_WARN([netcf and netcontrol cannot be used together, disabling netcontrol])
|
||||
+ with_netcontrol=no
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
+if test "$with_netcontrol" = "yes" || test "$with_netcontrol" = "check"; then
|
||||
+ PKG_CHECK_MODULES(NETCONTROL, netcontrol >= $NETCONTROL_REQUIRED,
|
||||
+ [with_netcontrol=yes], [
|
||||
+ if test "$with_netcontrol" = "check" ; then
|
||||
+ with_netcontrol=no
|
||||
+ else
|
||||
+ AC_MSG_ERROR(
|
||||
+ [You must install netcontrol >= $NETCONTROL_REQUIRED to compile libvirt])
|
||||
+ fi
|
||||
+ ])
|
||||
+ if test "$with_netcontrol" = "yes" ; then
|
||||
+ AC_DEFINE_UNQUOTED([WITH_NETCONTROL], 1,
|
||||
+ [whether libnetcontrol is available to configure physical host network interfaces])
|
||||
+ fi
|
||||
+fi
|
||||
+AM_CONDITIONAL([WITH_NETCONTROL], [test "$with_netcontrol" = "yes"])
|
||||
+AC_SUBST([NETCONTROL_CFLAGS])
|
||||
+AC_SUBST([NETCONTROL_LIBS])
|
||||
|
||||
AC_ARG_WITH([secrets],
|
||||
AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
|
||||
@@ -2460,6 +2493,7 @@ AC_MSG_NOTICE([ Remote: $with_remote])
|
||||
AC_MSG_NOTICE([ Network: $with_network])
|
||||
AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
|
||||
AC_MSG_NOTICE([ netcf: $with_netcf])
|
||||
+AC_MSG_NOTICE([ netctrl: $with_netcontrol])
|
||||
AC_MSG_NOTICE([ macvtap: $with_macvtap])
|
||||
AC_MSG_NOTICE([virtport: $with_virtualport])
|
||||
AC_MSG_NOTICE([])
|
||||
@@ -2586,6 +2620,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
|
||||
else
|
||||
AC_MSG_NOTICE([ netcf: no])
|
||||
fi
|
||||
+if test "$with_netcontrol" = "yes" ; then
|
||||
+AC_MSG_NOTICE([ netctrl: $NETCONTROL_CFLAGS $NETCONTROL_LIBS])
|
||||
+else
|
||||
+AC_MSG_NOTICE([ netctrl: no])
|
||||
+fi
|
||||
if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
|
||||
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
|
||||
else
|
||||
Index: libvirt-0.9.4/daemon/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/daemon/Makefile.am
|
||||
+++ libvirt-0.9.4/daemon/Makefile.am
|
||||
@@ -141,6 +141,10 @@ endif
|
||||
|
||||
if WITH_NETCF
|
||||
libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
||||
+else
|
||||
+if WITH_NETCONTROL
|
||||
+ libvirtd_LDADD += ../src/libvirt_driver_interface.la
|
||||
+endif
|
||||
endif
|
||||
|
||||
if WITH_NODE_DEVICES
|
||||
Index: libvirt-0.9.4/daemon/libvirtd.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.4/daemon/libvirtd.c
|
||||
@@ -74,6 +74,10 @@
|
||||
# endif
|
||||
# ifdef WITH_NETCF
|
||||
# include "interface/netcf_driver.h"
|
||||
+# else
|
||||
+# ifdef WITH_NETCONTROL
|
||||
+# include "interface/netcf_driver.h"
|
||||
+# endif
|
||||
# endif
|
||||
# ifdef WITH_STORAGE_DIR
|
||||
# include "storage/storage_driver.h"
|
||||
@@ -428,6 +432,10 @@ static void daemonInitialize(void)
|
||||
# endif
|
||||
# ifdef WITH_NETCF
|
||||
interfaceRegister();
|
||||
+#else
|
||||
+# ifdef WITH_NETCONTROL
|
||||
+ interfaceRegister();
|
||||
+# endif
|
||||
# endif
|
||||
# ifdef WITH_STORAGE_DIR
|
||||
storageRegister();
|
||||
Index: libvirt-0.9.4/src/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/Makefile.am
|
||||
+++ libvirt-0.9.4/src/Makefile.am
|
||||
@@ -870,6 +870,24 @@ libvirt_driver_interface_la_LIBADD += ..
|
||||
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
|
||||
endif
|
||||
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
|
||||
+else
|
||||
+if WITH_NETCONTROL
|
||||
+if WITH_DRIVER_MODULES
|
||||
+mod_LTLIBRARIES += libvirt_driver_interface.la
|
||||
+else
|
||||
+noinst_LTLIBRARIES += libvirt_driver_interface.la
|
||||
+libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la
|
||||
+endif
|
||||
+libvirt_driver_interface_la_CFLAGS = $(NETCONTROL_CFLAGS) \
|
||||
+ -I@top_srcdir@/src/conf $(AM_CFLAGS)
|
||||
+libvirt_driver_interface_la_LDFLAGS = $(AM_LDFLAGS)
|
||||
+libvirt_driver_interface_la_LIBADD = $(NETCONTROL_LIBS)
|
||||
+if WITH_DRIVER_MODULES
|
||||
+libvirt_driver_interface_la_LIBADD += ../gnulib/lib/libgnu.la
|
||||
+libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
|
||||
+endif
|
||||
+libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
|
||||
+endif
|
||||
endif
|
||||
|
||||
if WITH_SECRETS
|
||||
Index: libvirt-0.9.4/src/interface/netcf_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/src/interface/netcf_driver.c
|
||||
+++ libvirt-0.9.4/src/interface/netcf_driver.c
|
||||
@@ -23,7 +23,13 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
+#ifdef WITH_NETCONTROL
|
||||
+#include <netcontrol/netcf.h>
|
||||
+#include <netcontrol/logger.h>
|
||||
+#include "logging.h"
|
||||
+#else
|
||||
#include <netcf.h>
|
||||
+#endif
|
||||
|
||||
#include "virterror_internal.h"
|
||||
#include "datatypes.h"
|
||||
@@ -55,6 +61,39 @@ static void interfaceDriverUnlock(struct
|
||||
virMutexUnlock(&driver->lock);
|
||||
}
|
||||
|
||||
+#ifdef WITH_NETCONTROL
|
||||
+static void interface_nc_log_driver(const char *category,
|
||||
+ int priority,
|
||||
+ const char *func,
|
||||
+ const char *file ATTRIBUTE_UNUSED,
|
||||
+ long long line,
|
||||
+ const char *msg,
|
||||
+ size_t len ATTRIBUTE_UNUSED)
|
||||
+{
|
||||
+ int vp;
|
||||
+ const char *vc;
|
||||
+
|
||||
+ switch(priority) {
|
||||
+ case NC_LOG_FATAL:
|
||||
+ case NC_LOG_ERROR:
|
||||
+ vp = VIR_LOG_ERROR;
|
||||
+ break;
|
||||
+ case NC_LOG_WARN:
|
||||
+ vp = VIR_LOG_WARN;
|
||||
+ break;
|
||||
+ case NC_LOG_INFO:
|
||||
+ vp = VIR_LOG_INFO;
|
||||
+ break;
|
||||
+ case NC_LOG_DEBUG:
|
||||
+ default:
|
||||
+ vp = VIR_LOG_DEBUG;
|
||||
+ break;
|
||||
+ }
|
||||
+ vc = category ? category : "netcontrol";
|
||||
+ virLogMessage(vc, vp, func, line, 0, "%s", msg);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static int netcf_to_vir_err(int netcf_errcode)
|
||||
{
|
||||
switch (netcf_errcode)
|
||||
@@ -140,6 +179,10 @@ static virDrvOpenStatus interfaceOpenInt
|
||||
goto mutex_error;
|
||||
}
|
||||
|
||||
+#ifdef WITH_NETCONTROL
|
||||
+ nc_logger_redirect_to(interface_nc_log_driver);
|
||||
+#endif
|
||||
+
|
||||
/* open netcf */
|
||||
if (ncf_init(&driverState->netcf, NULL) != 0)
|
||||
{
|
||||
Index: libvirt-0.9.4/tools/virsh.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/tools/virsh.c
|
||||
+++ libvirt-0.9.4/tools/virsh.c
|
||||
@@ -14904,6 +14904,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
|
||||
#endif
|
||||
#ifdef WITH_NETCF
|
||||
vshPrint(ctl, " Netcf");
|
||||
+#else
|
||||
+#ifdef WITH_NETCONTROL
|
||||
+ vshPrint(ctl, " NetControl");
|
||||
+#endif
|
||||
#endif
|
||||
#ifdef WITH_NWFILTER
|
||||
vshPrint(ctl, " Nwfilter");
|
@ -1,3 +1,65 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 16 12:50:51 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- Enable building with libnetcontrol
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 16 12:02:37 UTC 2011 - jengelh@medozas.de
|
||||
|
||||
- Select libnl-1_1-devel
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 14 17:18:36 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- Set qemu migration speed unlimited when migrating to file
|
||||
7e5f6a51-rpc-generator.patch b12354be-mig-speed-1.patch
|
||||
1282bd80-mig-speed-2.patch 6f84e110-mig-speed-3.patch
|
||||
829bce17-mig-speed-4.patch 8fc40c51-mig-speed-5.patch
|
||||
ef1065cf-mig-speed-6.patch 0257ba8f-mig-speed-7.patch
|
||||
bnc#706436
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 14 16:12:49 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- Increase max size of buffer used to receive xend response
|
||||
57c95175-xend-buff-size.patch
|
||||
- Don't overwrite useful error messages in legacy xen driver
|
||||
32620dab-fix-xen-err-msg.patch
|
||||
bnc#711096
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 14 15:49:37 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- Add upstream patches to stop excessive logging
|
||||
7f2498ef-no-log-invalid.patch 6ff9fc26-quiet-libxl-logging.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 14 12:06:36 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- Add 'Conflicts: kvm < 0.14.1' to ensure libvirt is using a
|
||||
kvm package that creates qemu user:group. Remove user:group
|
||||
creation from libvirt
|
||||
bnc#694883
|
||||
- Add libvirt group at package installation
|
||||
bnc#694885
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 8 11:11:07 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- Explicitly add 'BuildRequires: libgcrypt-devel' since it is no
|
||||
longer required by libgnutls-devel
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 8 10:21:11 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- netcf is buggy and not well maintained in SUSE. Disable it in
|
||||
libvirt
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 8 10:15:32 MDT 2011 - jfehlig@suse.com
|
||||
|
||||
- polkit support was mistakenly disabled, re-enable
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 24 20:29:37 MDT 2011 - jfehlig@novell.com
|
||||
|
||||
|
79
libvirt.spec
79
libvirt.spec
@ -60,10 +60,13 @@
|
||||
%define with_selinux 0%{!?_without_selinux:%{server_drivers}}
|
||||
%define with_apparmor 0%{!?_without_apparmor:%{server_drivers}}
|
||||
|
||||
# Optional bits on by default
|
||||
%define with_polkit 0%{!?_without_polkit:1}
|
||||
|
||||
# A few optional bits off by default, we enable later
|
||||
%define with_polkit 0%{!?_without_polkit:0}
|
||||
%define with_capng 0%{!?_without_capng:0}
|
||||
%define with_netcf 0%{!?_without_netcf:0}
|
||||
%define with_netcontrol 0%{!?_without_netcontrol:0}
|
||||
%define with_udev 0%{!?_without_udev:0}
|
||||
%define with_hal 0%{!?_without_hal:0}
|
||||
%define with_yajl 0%{!?_without_yajl:0}
|
||||
@ -126,17 +129,17 @@
|
||||
%define with_hal 0%{!?_without_hal:%{server_drivers}}
|
||||
%endif
|
||||
|
||||
# netcontrol is used to manage network interfaces on openSUSE >= 12.1
|
||||
%if 0%{?suse_version} >= 1210
|
||||
%define with_netcontrol 0%{!?_without_netcontrol:%{server_drivers}}
|
||||
%endif
|
||||
|
||||
# libcapng is used to manage capabilities in 11.3 or newer.
|
||||
# It is also used by lxc and needs to be enabled if lxc is enabled.
|
||||
%if 0%{?suse_version} >= 1130 || %{with_lxc}
|
||||
%define with_capng 0%{!?_without_capng:1}
|
||||
%endif
|
||||
|
||||
# netcf is used to manage network interfaces in 11.4 or newer
|
||||
%if 0%{?suse_version} >= 1140
|
||||
%define with_netcf 0%{!?_without_netcf:%{server_drivers}}
|
||||
%endif
|
||||
|
||||
# Enable yajl library for JSON mode with QEMU in 11.4 or newer
|
||||
%if 0%{?suse_version} >= 1140
|
||||
%define with_yajl 0%{!?_without_yajl:%{server_drivers}}
|
||||
@ -190,7 +193,8 @@ BuildRequires: readline-devel
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: gettext
|
||||
BuildRequires: libtasn1-devel
|
||||
BuildRequires: gnutls-devel
|
||||
BuildRequires: libgnutls-devel
|
||||
BuildRequires: libgcrypt-devel
|
||||
BuildRequires: bridge-utils
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: pkg-config
|
||||
@ -239,9 +243,6 @@ BuildRequires: libssh2-devel
|
||||
%if %{with_yajl}
|
||||
BuildRequires: libyajl-devel
|
||||
%endif
|
||||
%if %{with_macvtap}
|
||||
BuildRequires: libnl-devel
|
||||
%endif
|
||||
%if %{with_esx}
|
||||
BuildRequires: libcurl-devel
|
||||
%endif
|
||||
@ -251,6 +252,9 @@ BuildRequires: libcap-ng-devel >= 0.5.0
|
||||
%if %{with_netcf}
|
||||
BuildRequires: netcf-devel >= 0.1.4
|
||||
%endif
|
||||
%if %{with_netcontrol}
|
||||
BuildRequires: libnetcontrol-devel >= 0.2.0
|
||||
%endif
|
||||
%if %{with_network}
|
||||
BuildRequires: dnsmasq >= 2.41
|
||||
BuildRequires: iptables-devel
|
||||
@ -263,7 +267,11 @@ BuildRequires: ebtables
|
||||
BuildRequires: libpcap-devel
|
||||
%endif
|
||||
%if %{with_libnl}
|
||||
%if 0%{?suse_version} < 1210
|
||||
BuildRequires: libnl-devel
|
||||
%else
|
||||
BuildRequires: libnl-1_1-devel
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_fs}
|
||||
# For mount/umount in FS driver
|
||||
@ -297,6 +305,7 @@ AutoReqProv: yes
|
||||
Version: 0.9.4
|
||||
Release: 3
|
||||
Summary: A C toolkit to interract with the virtualization capabilities of Linux
|
||||
Conflicts: kvm < 0.14.1
|
||||
|
||||
# The client side, i.e. shared libs and virsh are in a subpackage
|
||||
Requires: %{name}-client = %{version}-%{release}
|
||||
@ -362,6 +371,18 @@ Source2: libvirtd-relocation-server.fw
|
||||
Source99: baselibs.conf
|
||||
# Upstream patches
|
||||
Patch0: 9e093f0b-libvirtd-sighup.patch
|
||||
Patch1: 32620dab-fix-xen-err-msg.patch
|
||||
Patch2: 57c95175-xend-buff-size.patch
|
||||
Patch3: 6ff9fc26-quiet-libxl-logging.patch
|
||||
Patch4: 7f2498ef-no-log-invalid.patch
|
||||
Patch5: 7e5f6a51-rpc-generator.patch
|
||||
Patch6: b12354be-mig-speed-1.patch
|
||||
Patch7: 1282bd80-mig-speed-2.patch
|
||||
Patch8: 6f84e110-mig-speed-3.patch
|
||||
Patch9: 829bce17-mig-speed-4.patch
|
||||
Patch10: 8fc40c51-mig-speed-5.patch
|
||||
Patch11: ef1065cf-mig-speed-6.patch
|
||||
Patch12: 0257ba8f-mig-speed-7.patch
|
||||
# Need to go upstream
|
||||
Patch100: xen-name-for-devid.patch
|
||||
Patch101: clone.patch
|
||||
@ -373,6 +394,9 @@ Patch201: use-init-script-redhat.patch
|
||||
%if %{with_apparmor}
|
||||
Patch250: install-apparmor-profiles.patch
|
||||
%endif
|
||||
%if %{with_netcontrol}
|
||||
Patch300: libvirt-suse-netcontrol.patch
|
||||
%endif
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -458,7 +482,6 @@ Authors:
|
||||
Karel Zak <kzak@redhat.com>
|
||||
|
||||
%if %{with_python}
|
||||
|
||||
%package python
|
||||
License: LGPLv2.1+
|
||||
Summary: A C toolkit to interract with the virtualization capabilities of Linux
|
||||
@ -482,6 +505,18 @@ Authors:
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch100 -p1
|
||||
%patch101
|
||||
%patch102 -p1
|
||||
@ -491,6 +526,9 @@ Authors:
|
||||
%if %{with_apparmor}
|
||||
%patch250 -p1
|
||||
%endif
|
||||
%if %{with_netcontrol}
|
||||
%patch300 -p1
|
||||
%endif
|
||||
|
||||
%build
|
||||
%if ! %{with_xen}
|
||||
@ -559,6 +597,9 @@ Authors:
|
||||
%if ! %{with_netcf}
|
||||
%define _without_netcf --without-netcf
|
||||
%endif
|
||||
%if ! %{with_netcontrol}
|
||||
%define _without_netcontrol --without-netcontrol
|
||||
%endif
|
||||
%if ! %{with_hal}
|
||||
%define _without_hal --without-hal
|
||||
%endif
|
||||
@ -615,6 +656,7 @@ export CFLAGS="$RPM_OPT_FLAGS"
|
||||
%{?_without_apparmor} \
|
||||
%{?_without_capng} \
|
||||
%{?_without_netcf} \
|
||||
%{?_without_netcontrol} \
|
||||
%{?_without_hal} \
|
||||
%{?_without_udev} \
|
||||
%{?_without_yajl} \
|
||||
@ -710,6 +752,10 @@ install -m 644 %{S:2} $RPM_BUILD_ROOT/%{_fwdefdir}/libvirtd-relocation-server
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%pre
|
||||
%{_bindir}/getent group libvirt >/dev/null || \
|
||||
%{_sbindir}/groupadd -r libvirt 2>/dev/null
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%if %{with_libvirtd}
|
||||
@ -723,15 +769,6 @@ then
|
||||
> %{_sysconfdir}/libvirt/qemu/networks/default.xml
|
||||
fi
|
||||
%endif
|
||||
# Create qemu user:group if necessary
|
||||
if test "%{qemu_user}" = "qemu"; then
|
||||
%{_bindir}/getent group qemu >/dev/null || \
|
||||
%{_sbindir}/groupadd -r qemu 2>/dev/null
|
||||
%{_bindir}/getent group kvm >/dev/null && group_opts="-G kvm"
|
||||
%{_bindir}/getent passwd qemu >/dev/null || \
|
||||
%{_sbindir}/useradd -r -g qemu $group_opts -d / -s /sbin/nologin \
|
||||
-c "qemu user" qemu
|
||||
fi
|
||||
%if 0%{?sles_version}
|
||||
%{fillup_and_insserv -y libvirtd}
|
||||
%else
|
||||
@ -757,7 +794,6 @@ fi
|
||||
%postun client -p /sbin/ldconfig
|
||||
|
||||
%if %{with_libvirtd}
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%{_sbindir}/libvirtd
|
||||
@ -887,7 +923,6 @@ fi
|
||||
%doc %{_docdir}/%{name}/html
|
||||
|
||||
%if %{with_python}
|
||||
|
||||
%files python
|
||||
%defattr(-, root, root)
|
||||
%doc %{_docdir}/%{name}-python
|
||||
|
@ -32,7 +32,7 @@ Index: libvirt-0.9.4/daemon/libvirtd.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.4.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.4/daemon/libvirtd.c
|
||||
@@ -880,7 +880,7 @@ daemonConfigNew(bool privileged ATTRIBUT
|
||||
@@ -881,7 +881,7 @@ daemonConfigNew(bool privileged ATTRIBUT
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ Index: libvirt-0.9.4/daemon/libvirtd.c
|
||||
data->listen_tcp = 0;
|
||||
|
||||
if (!(data->tls_port = strdup(LIBVIRTD_TLS_PORT)))
|
||||
@@ -917,7 +917,7 @@ daemonConfigNew(bool privileged ATTRIBUT
|
||||
@@ -918,7 +918,7 @@ daemonConfigNew(bool privileged ATTRIBUT
|
||||
#endif
|
||||
data->auth_tls = REMOTE_AUTH_NONE;
|
||||
|
||||
|
@ -25,7 +25,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
|
||||
virDomainDeviceDefPtr dev,
|
||||
char *class,
|
||||
char *ref,
|
||||
@@ -2807,7 +2808,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
|
||||
@@ -2805,7 +2806,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
|
||||
|
||||
sexpr = virBufferContentAndReset(&buf);
|
||||
|
||||
@ -34,7 +34,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
|
||||
/* device doesn't exist, define it */
|
||||
ret = xend_op(domain->conn, domain->name, "op", "device_create",
|
||||
"config", sexpr, NULL);
|
||||
@@ -2928,7 +2929,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
|
||||
@@ -2926,7 +2927,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
|
||||
|
||||
sexpr = virBufferContentAndReset(&buf);
|
||||
|
||||
@ -43,7 +43,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
|
||||
virXendError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("requested device does not exist"));
|
||||
goto cleanup;
|
||||
@@ -3023,7 +3024,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
|
||||
@@ -3021,7 +3022,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
|
||||
def, xml, VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
@ -52,7 +52,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
|
||||
goto cleanup;
|
||||
|
||||
if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
|
||||
@@ -3979,6 +3980,7 @@ struct xenUnifiedDriver xenDaemonDriver
|
||||
@@ -3977,6 +3978,7 @@ struct xenUnifiedDriver xenDaemonDriver
|
||||
*/
|
||||
static int
|
||||
virDomainXMLDevID(virDomainPtr domain,
|
||||
@ -60,7 +60,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
|
||||
virDomainDeviceDefPtr dev,
|
||||
char *class,
|
||||
char *ref,
|
||||
@@ -3987,8 +3989,12 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
@@ -3985,8 +3987,12 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
xenUnifiedPrivatePtr priv = domain->conn->privateData;
|
||||
char *xref;
|
||||
char *tmp;
|
||||
@ -73,7 +73,7 @@ Index: libvirt-0.9.4/src/xen/xend_internal.c
|
||||
if (dev->data.disk->driverName &&
|
||||
STREQ(dev->data.disk->driverName, "tap"))
|
||||
strcpy(class, "tap");
|
||||
@@ -3998,19 +4004,21 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
@@ -3996,19 +4002,21 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
else
|
||||
strcpy(class, "vbd");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user