Accepting request 593872 from Virtualization

OBS-URL: https://build.opensuse.org/request/show/593872
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=256
This commit is contained in:
Dominique Leuenberger 2018-04-07 18:52:51 +00:00 committed by Git OBS Bridge
commit 8fc48de02b
56 changed files with 526 additions and 3219 deletions

View File

@ -18,22 +18,10 @@ them.
create mode 100644 src/conf/domain_stats.c
create mode 100644 src/conf/domain_stats.h
Index: libvirt-4.1.0/src/Makefile.am
===================================================================
--- libvirt-4.1.0.orig/src/Makefile.am
+++ libvirt-4.1.0/src/Makefile.am
@@ -441,6 +441,7 @@ DOMAIN_CONF_SOURCES = \
conf/domain_conf.c conf/domain_conf.h \
conf/domain_audit.c conf/domain_audit.h \
conf/domain_nwfilter.c conf/domain_nwfilter.h \
+ conf/domain_stats.c conf/domain_stats.h \
conf/virsavecookie.c conf/virsavecookie.h \
conf/snapshot_conf.c conf/snapshot_conf.h \
conf/numa_conf.c conf/numa_conf.h \
Index: libvirt-4.1.0/src/conf/domain_stats.c
Index: libvirt-4.2.0/src/conf/domain_stats.c
===================================================================
--- /dev/null
+++ libvirt-4.1.0/src/conf/domain_stats.c
+++ libvirt-4.2.0/src/conf/domain_stats.c
@@ -0,0 +1,139 @@
+/*
+ * domain_stats.c: domain stats extraction helpers
@ -174,10 +162,10 @@ Index: libvirt-4.1.0/src/conf/domain_stats.c
+}
+
+#undef STATS_ADD_NET_PARAM
Index: libvirt-4.1.0/src/conf/domain_stats.h
Index: libvirt-4.2.0/src/conf/domain_stats.h
===================================================================
--- /dev/null
+++ libvirt-4.1.0/src/conf/domain_stats.h
+++ libvirt-4.2.0/src/conf/domain_stats.h
@@ -0,0 +1,64 @@
+/*
+ * domain_stats.h: domain stats extraction helpers
@ -243,11 +231,11 @@ Index: libvirt-4.1.0/src/conf/domain_stats.h
+ int *maxparams);
+
+#endif /* __DOMAIN_STATS_H */
Index: libvirt-4.1.0/src/libvirt_private.syms
Index: libvirt-4.2.0/src/libvirt_private.syms
===================================================================
--- libvirt-4.1.0.orig/src/libvirt_private.syms
+++ libvirt-4.1.0/src/libvirt_private.syms
@@ -644,6 +644,9 @@ virDomainConfNWFilterRegister;
--- libvirt-4.2.0.orig/src/libvirt_private.syms
+++ libvirt-4.2.0/src/libvirt_private.syms
@@ -646,6 +646,9 @@ virDomainConfNWFilterRegister;
virDomainConfNWFilterTeardown;
virDomainConfVMNWFilterTeardown;
@ -257,7 +245,7 @@ Index: libvirt-4.1.0/src/libvirt_private.syms
# conf/interface_conf.h
virInterfaceDefFormat;
@@ -1500,6 +1503,7 @@ virCgroupGetMemoryUsage;
@@ -1507,6 +1510,7 @@ virCgroupGetMemoryUsage;
virCgroupGetMemSwapHardLimit;
virCgroupGetMemSwapUsage;
virCgroupGetPercpuStats;
@ -265,19 +253,19 @@ Index: libvirt-4.1.0/src/libvirt_private.syms
virCgroupHasController;
virCgroupHasEmptyTasks;
virCgroupKill;
Index: libvirt-4.1.0/src/qemu/qemu_driver.c
Index: libvirt-4.2.0/src/qemu/qemu_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/qemu/qemu_driver.c
+++ libvirt-4.1.0/src/qemu/qemu_driver.c
@@ -72,6 +72,7 @@
#include "viralloc.h"
--- libvirt-4.2.0.orig/src/qemu/qemu_driver.c
+++ libvirt-4.2.0/src/qemu/qemu_driver.c
@@ -73,6 +73,7 @@
#include "virarptable.h"
#include "viruuid.h"
#include "domain_conf.h"
+#include "domain_stats.h"
#include "domain_audit.h"
#include "node_device_conf.h"
#include "virpci.h"
@@ -19518,21 +19519,7 @@ qemuDomainGetStatsState(virQEMUDriverPtr
@@ -19528,21 +19529,7 @@ qemuDomainGetStatsState(virQEMUDriverPtr
int *maxparams,
unsigned int privflags ATTRIBUTE_UNUSED)
{
@ -300,7 +288,7 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
}
@@ -19555,37 +19542,7 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr d
@@ -19565,37 +19552,7 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr d
unsigned int privflags ATTRIBUTE_UNUSED)
{
qemuDomainObjPrivatePtr priv = dom->privateData;
@ -339,7 +327,7 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
}
static int
@@ -19764,44 +19721,6 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr
@@ -19774,44 +19731,6 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr
return ret;
}
@ -384,7 +372,7 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
static int
qemuDomainGetStatsInterface(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
virDomainObjPtr dom,
@@ -19809,68 +19728,9 @@ qemuDomainGetStatsInterface(virQEMUDrive
@@ -19819,68 +19738,9 @@ qemuDomainGetStatsInterface(virQEMUDrive
int *maxparams,
unsigned int privflags ATTRIBUTE_UNUSED)
{
@ -454,7 +442,7 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
#define QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, num, name, value) \
do { \
char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; \
@@ -19992,10 +19852,10 @@ qemuDomainGetStatsOneBlock(virQEMUDriver
@@ -20002,10 +19862,10 @@ qemuDomainGetStatsOneBlock(virQEMUDriver
if (disk->info.alias)
alias = qemuDomainStorageAlias(disk->info.alias, backing_idx);
@ -467,7 +455,7 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
block_idx, src->path);
if (backing_idx)
QEMU_ADD_BLOCK_PARAM_UI(record, maxparams, block_idx, "backingIndex",
@@ -20111,7 +19971,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr
@@ -20121,7 +19981,7 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr
* after the iteration than it is to iterate twice; but we still
* want count listed first. */
count_index = record->nparams;
@ -476,7 +464,7 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
for (i = 0; i < dom->def->ndisks; i++) {
virDomainDiskDefPtr disk = dom->def->disks[i];
@@ -20145,10 +20005,6 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr
@@ -20155,10 +20015,6 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr
#undef QEMU_ADD_BLOCK_PARAM_ULL
@ -487,10 +475,10 @@ Index: libvirt-4.1.0/src/qemu/qemu_driver.c
static int
qemuDomainGetStatsPerfOneEvent(virPerfPtr perf,
virPerfEventType type,
Index: libvirt-4.1.0/src/util/vircgroup.c
Index: libvirt-4.2.0/src/util/vircgroup.c
===================================================================
--- libvirt-4.1.0.orig/src/util/vircgroup.c
+++ libvirt-4.1.0/src/util/vircgroup.c
--- libvirt-4.2.0.orig/src/util/vircgroup.c
+++ libvirt-4.2.0/src/util/vircgroup.c
@@ -4122,6 +4122,44 @@ virCgroupControllerAvailable(int control
return ret;
}
@ -551,10 +539,10 @@ Index: libvirt-4.1.0/src/util/vircgroup.c
#endif /* !VIR_CGROUP_SUPPORTED */
Index: libvirt-4.1.0/src/util/vircgroup.h
Index: libvirt-4.2.0/src/util/vircgroup.h
===================================================================
--- libvirt-4.1.0.orig/src/util/vircgroup.h
+++ libvirt-4.1.0/src/util/vircgroup.h
--- libvirt-4.2.0.orig/src/util/vircgroup.h
+++ libvirt-4.2.0/src/util/vircgroup.h
@@ -297,4 +297,8 @@ int virCgroupSetOwner(virCgroupPtr cgrou
int virCgroupHasEmptyTasks(virCgroupPtr cgroup, int controller);
@ -564,3 +552,16 @@ Index: libvirt-4.1.0/src/util/vircgroup.h
+ virDomainStatsRecordPtr record,
+ int *maxparams);
#endif /* __VIR_CGROUP_H__ */
Index: libvirt-4.2.0/src/conf/Makefile.inc.am
===================================================================
--- libvirt-4.2.0.orig/src/conf/Makefile.inc.am
+++ libvirt-4.2.0/src/conf/Makefile.inc.am
@@ -20,6 +20,8 @@ DOMAIN_CONF_SOURCES = \
conf/domain_audit.h \
conf/domain_nwfilter.c \
conf/domain_nwfilter.h \
+ conf/domain_stats.c \
+ conf/domain_stats.h \
conf/virsavecookie.c \
conf/virsavecookie.h \
conf/snapshot_conf.c \

View File

@ -9,10 +9,10 @@ them using the existing API.
src/lxc/lxc_driver.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 138 insertions(+)
Index: libvirt-4.1.0/src/lxc/lxc_driver.c
Index: libvirt-4.2.0/src/lxc/lxc_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/lxc/lxc_driver.c
+++ libvirt-4.1.0/src/lxc/lxc_driver.c
--- libvirt-4.2.0.orig/src/lxc/lxc_driver.c
+++ libvirt-4.2.0/src/lxc/lxc_driver.c
@@ -80,6 +80,7 @@
#include "viraccessapichecklxc.h"
#include "virhostdev.h"
@ -21,7 +21,7 @@ Index: libvirt-4.1.0/src/lxc/lxc_driver.c
#define VIR_FROM_THIS VIR_FROM_LXC
@@ -5514,6 +5515,142 @@ lxcDomainHasManagedSaveImage(virDomainPt
@@ -5528,6 +5529,142 @@ lxcDomainHasManagedSaveImage(virDomainPt
return ret;
}
@ -164,7 +164,7 @@ Index: libvirt-4.1.0/src/lxc/lxc_driver.c
/* Function Tables */
static virHypervisorDriver lxcHypervisorDriver = {
@@ -5608,6 +5745,7 @@ static virHypervisorDriver lxcHypervisor
@@ -5622,6 +5759,7 @@ static virHypervisorDriver lxcHypervisor
.nodeGetFreePages = lxcNodeGetFreePages, /* 1.2.6 */
.nodeAllocPages = lxcNodeAllocPages, /* 1.2.9 */
.domainHasManagedSaveImage = lxcDomainHasManagedSaveImage, /* 1.2.13 */

View File

@ -1,237 +0,0 @@
commit 06e7ebb60894ab43b5224752514049c1a286ee06
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Mar 6 17:05:16 2018 +0000
rpc: invoke the message dispatch callback with client unlocked
Currently if the virNetServer instance is created with max_workers==0 to
request a non-threaded dispatch process, we deadlock during dispatch
#0 0x00007fb845f6f42d in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x00007fb845f681d3 in pthread_mutex_lock () from /lib64/libpthread.so.0
#2 0x000055a6628bb305 in virMutexLock (m=<optimized out>) at util/virthread.c:89
#3 0x000055a6628a984b in virObjectLock (anyobj=<optimized out>) at util/virobject.c:435
#4 0x000055a66286fcde in virNetServerClientIsAuthenticated (client=client@entry=0x55a663a7b960)
at rpc/virnetserverclient.c:1565
#5 0x000055a66286cc17 in virNetServerProgramDispatchCall (msg=0x55a663a7bc50, client=0x55a663a7b960,
server=0x55a663a77550, prog=0x55a663a78020) at rpc/virnetserverprogram.c:407
#6 virNetServerProgramDispatch (prog=prog@entry=0x55a663a78020, server=server@entry=0x55a663a77550,
client=client@entry=0x55a663a7b960, msg=msg@entry=0x55a663a7bc50) at rpc/virnetserverprogram.c:307
#7 0x000055a662871d56 in virNetServerProcessMsg (msg=0x55a663a7bc50, prog=0x55a663a78020, client=0x55a663a7b960,
srv=0x55a663a77550) at rpc/virnetserver.c:148
#8 virNetServerDispatchNewMessage (client=0x55a663a7b960, msg=0x55a663a7bc50, opaque=0x55a663a77550)
at rpc/virnetserver.c:227
#9 0x000055a66286e4c0 in virNetServerClientDispatchRead (client=client@entry=0x55a663a7b960)
at rpc/virnetserverclient.c:1322
#10 0x000055a66286e813 in virNetServerClientDispatchEvent (sock=<optimized out>, events=1, opaque=0x55a663a7b960)
at rpc/virnetserverclient.c:1507
#11 0x000055a662899be0 in virEventPollDispatchHandles (fds=0x55a663a7bdc0, nfds=<optimized out>)
at util/vireventpoll.c:508
#12 virEventPollRunOnce () at util/vireventpoll.c:657
#13 0x000055a6628982f1 in virEventRunDefaultImpl () at util/virevent.c:327
#14 0x000055a6628716d5 in virNetDaemonRun (dmn=0x55a663a771b0) at rpc/virnetdaemon.c:858
#15 0x000055a662864c1d in main (argc=<optimized out>,
#argv=0x7ffd105b4838) at logging/log_daemon.c:1235
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/rpc/virnetserverclient.c
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserverclient.c
+++ libvirt-4.1.0/src/rpc/virnetserverclient.c
@@ -143,7 +143,7 @@ VIR_ONCE_GLOBAL_INIT(virNetServerClient)
static void virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque);
static void virNetServerClientUpdateEvent(virNetServerClientPtr client);
-static void virNetServerClientDispatchRead(virNetServerClientPtr client);
+static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr client);
static int virNetServerClientSendMessageLocked(virNetServerClientPtr client,
virNetMessagePtr msg);
@@ -340,18 +340,40 @@ virNetServerClientCheckAccess(virNetServ
}
#endif
+static void virNetServerClientDispatchMessage(virNetServerClientPtr client,
+ virNetMessagePtr msg)
+{
+ virObjectLock(client);
+ if (!client->dispatchFunc) {
+ virNetMessageFree(msg);
+ client->wantClose = true;
+ virObjectUnlock(client);
+ } else {
+ virObjectUnlock(client);
+ /* Accessing 'client' is safe, because virNetServerClientSetDispatcher
+ * only permits setting 'dispatchFunc' once, so if non-NULL, it will
+ * never change again
+ */
+ client->dispatchFunc(client, msg, client->dispatchOpaque);
+ }
+}
+
static void virNetServerClientSockTimerFunc(int timer,
void *opaque)
{
virNetServerClientPtr client = opaque;
+ virNetMessagePtr msg = NULL;
virObjectLock(client);
virEventUpdateTimeout(timer, -1);
/* Although client->rx != NULL when this timer is enabled, it might have
* changed since the client was unlocked in the meantime. */
if (client->rx)
- virNetServerClientDispatchRead(client);
+ msg = virNetServerClientDispatchRead(client);
virObjectUnlock(client);
+
+ if (msg)
+ virNetServerClientDispatchMessage(client, msg);
}
@@ -950,8 +972,13 @@ void virNetServerClientSetDispatcher(vir
void *opaque)
{
virObjectLock(client);
- client->dispatchFunc = func;
- client->dispatchOpaque = opaque;
+ /* Only set dispatcher if not already set, to avoid race
+ * with dispatch code that runs without locks held
+ */
+ if (!client->dispatchFunc) {
+ client->dispatchFunc = func;
+ client->dispatchOpaque = opaque;
+ }
virObjectUnlock(client);
}
@@ -1196,26 +1223,32 @@ static ssize_t virNetServerClientRead(vi
/*
- * Read data until we get a complete message to process
+ * Read data until we get a complete message to process.
+ * If a complete message is available, it will be returned
+ * from this method, for dispatch by the caller.
+ *
+ * Returns a complete message for dispatch, or NULL if none is
+ * yet available, or an error occurred. On error, the wantClose
+ * flag will be set.
*/
-static void virNetServerClientDispatchRead(virNetServerClientPtr client)
+static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr client)
{
readmore:
if (client->rx->nfds == 0) {
if (virNetServerClientRead(client) < 0) {
client->wantClose = true;
- return; /* Error */
+ return NULL; /* Error */
}
}
if (client->rx->bufferOffset < client->rx->bufferLength)
- return; /* Still not read enough */
+ return NULL; /* Still not read enough */
/* Either done with length word header */
if (client->rx->bufferLength == VIR_NET_MESSAGE_LEN_MAX) {
if (virNetMessageDecodeLength(client->rx) < 0) {
client->wantClose = true;
- return;
+ return NULL;
}
virNetServerClientUpdateEvent(client);
@@ -1236,7 +1269,7 @@ static void virNetServerClientDispatchRe
virNetMessageQueueServe(&client->rx);
virNetMessageFree(msg);
client->wantClose = true;
- return;
+ return NULL;
}
/* Now figure out if we need to read more data to get some
@@ -1246,7 +1279,7 @@ static void virNetServerClientDispatchRe
virNetMessageQueueServe(&client->rx);
virNetMessageFree(msg);
client->wantClose = true;
- return; /* Error */
+ return NULL; /* Error */
}
/* Try getting the file descriptors (may fail if blocking) */
@@ -1256,7 +1289,7 @@ static void virNetServerClientDispatchRe
virNetMessageQueueServe(&client->rx);
virNetMessageFree(msg);
client->wantClose = true;
- return;
+ return NULL;
}
if (rv == 0) /* Blocking */
break;
@@ -1270,7 +1303,7 @@ static void virNetServerClientDispatchRe
* again next time we run this method
*/
client->rx->bufferOffset = client->rx->bufferLength;
- return;
+ return NULL;
}
}
@@ -1313,16 +1346,6 @@ static void virNetServerClientDispatchRe
}
}
- /* Send off to for normal dispatch to workers */
- if (msg) {
- if (!client->dispatchFunc) {
- virNetMessageFree(msg);
- client->wantClose = true;
- } else {
- client->dispatchFunc(client, msg, client->dispatchOpaque);
- }
- }
-
/* Possibly need to create another receive buffer */
if (client->nrequests < client->nrequests_max) {
if (!(client->rx = virNetMessageNew(true))) {
@@ -1338,6 +1361,8 @@ static void virNetServerClientDispatchRe
}
}
virNetServerClientUpdateEvent(client);
+
+ return msg;
}
}
@@ -1482,6 +1507,7 @@ static void
virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque)
{
virNetServerClientPtr client = opaque;
+ virNetMessagePtr msg = NULL;
virObjectLock(client);
@@ -1504,7 +1530,7 @@ virNetServerClientDispatchEvent(virNetSo
virNetServerClientDispatchWrite(client);
if (events & VIR_EVENT_HANDLE_READABLE &&
client->rx)
- virNetServerClientDispatchRead(client);
+ msg = virNetServerClientDispatchRead(client);
#if WITH_GNUTLS
}
#endif
@@ -1517,6 +1543,9 @@ virNetServerClientDispatchEvent(virNetSo
client->wantClose = true;
virObjectUnlock(client);
+
+ if (msg)
+ virNetServerClientDispatchMessage(client, msg);
}

View File

@ -0,0 +1,23 @@
commit 09877303014e0297d2c2707be5167d932cc3f425
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Mar 26 13:00:25 2018 -0600
util: honor reportError parameter in virSocketAddrParseInternal
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.2.0/src/util/virsocketaddr.c
===================================================================
--- libvirt-4.2.0.orig/src/util/virsocketaddr.c
+++ libvirt-4.2.0/src/util/virsocketaddr.c
@@ -107,7 +107,8 @@ virSocketAddrParseInternal(struct addrin
int err;
if (val == NULL) {
- virReportError(VIR_ERR_INVALID_ARG, "%s", _("Missing address"));
+ if (reportError)
+ virReportError(VIR_ERR_INVALID_ARG, "%s", _("Missing address"));
return -1;
}

View File

@ -1,25 +0,0 @@
commit 13e81fc6fad03aa6b6ecf4230f44b2ea55078229
Author: Jim Fehlig <jfehlig@suse.com>
Date: Fri Mar 16 15:22:45 2018 -0600
libxl: call EndJob in error case
If starting the domain fails in libxlDomainCreateXML, we mistakenly
jumped to cleanup without calling libxlDomainObjEndJob. Remove the
jump to 'cleanup'.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -1066,7 +1066,6 @@ libxlDomainCreateXML(virConnectPtr conn,
if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
virObjectLock(vm);
- goto cleanup;
}
goto endjob;
}

View File

@ -1,115 +0,0 @@
commit 33c6eb9689eb51dfe31dd05b24b3b6b1c948c267
Author: Jim Fehlig <jfehlig@suse.com>
Date: Thu Mar 8 15:04:48 2018 -0700
libvirtd: fix potential deadlock when reloading
It is possible to deadlock libvirtd when concurrently starting a domain
and restarting the daemon. Threads involved in the deadlock are
Thread 4 (Thread 0x7fc13b53e700 (LWP 64084)):
/lib64/libpthread.so.0
at util/virthread.c:154
at qemu/qemu_monitor.c:1083
cmd=0x7fc110017700, scm_fd=-1, reply=0x7fc13b53d318) at
qemu/qemu_monitor_json.c:305
cmd=0x7fc110017700,
reply=0x7fc13b53d318) at qemu/qemu_monitor_json.c:335
at qemu/qemu_monitor_json.c:1298
at qemu/qemu_monitor.c:1697
vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START) at qemu/qemu_process.c:1763
vm=0x7fc110003d00,
asyncJob=6, logCtxt=0x7fc1100089c0) at qemu/qemu_process.c:1835
vm=0x7fc110003d00, asyncJob=6, logCtxt=0x7fc1100089c0) at
qemu/qemu_process.c:2180
driver=0x7fc12004e1e0,
vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START, incoming=0x0, snapshot=0x0,
vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:6111
driver=0x7fc12004e1e0,
vm=0x7fc110003d00, updatedCPU=0x0, asyncJob=QEMU_ASYNC_JOB_START,
migrateFrom=0x0,
migrateFd=-1, migratePath=0x0, snapshot=0x0,
vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
flags=17) at qemu/qemu_process.c:6334
xml=0x7fc110000ed0 "<!--\nWARNING: THIS IS AN AUTO-GENERATED FILE.
CHANGES TO IT ARE LIKELY TO BE\nOVERWRITTEN AND LOST. Changes to this xml
configuration should be made using:\n virsh edit testvv\nor other
applicati"..., flags=0) at qemu/qemu_driver.c:1776
...
Thread 1 (Thread 0x7fc143c66880 (LWP 64081)):
/lib64/libpthread.so.0
at util/virthread.c:122
conf/nwfilter_conf.c:159
sig=0x7ffe0a831e30,
opaque=0x0) at remote/remote_daemon.c:724
opaque=0x558c5328b230) at rpc/virnetdaemon.c:654
at util/vireventpoll.c:508
rpc/virnetdaemon.c:858
remote/remote_daemon.c:1496
(gdb) thr 1
[Switching to thread 1 (Thread 0x7fc143c66880 (LWP 64081))]
/lib64/libpthread.so.0
(gdb) f 1
at util/virthread.c:122
122 pthread_rwlock_wrlock(&m->lock);
(gdb) p updateLock
$1 = {lock = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 0,
__writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 1,
__writer = 0,
__shared = 0, __rwelision = 0 '\000', __pad1 = "\000\000\000\000\000\000",
__pad2 = 0, __flags = 0},
__size = "\000\000\000\000\001", '\000' <repeats 15 times>, "\001",
'\000' <repeats 34 times>, __align = 4294967296}}
Reloading of the nwfilter driver is stuck waiting for a write lock, which
already has a reader (from qemuDomainCreateXML) in the critical section.
Since the reload occurs in the context of the main event loop thread,
libvirtd becomes deadlocked. The deadlock can be avoided by offloading
the reload work to a thread.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/remote/remote_daemon.c
===================================================================
--- libvirt-4.1.0.orig/src/remote/remote_daemon.c
+++ libvirt-4.1.0/src/remote/remote_daemon.c
@@ -709,20 +709,32 @@ static void daemonShutdownHandler(virNet
virNetDaemonQuit(dmn);
}
+static void daemonReloadHandlerThread(void *opague ATTRIBUTE_UNUSED)
+{
+ VIR_INFO("Reloading configuration on SIGHUP");
+ virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
+ VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL, NULL);
+ if (virStateReload() < 0)
+ VIR_WARN("Error while reloading drivers");
+}
+
static void daemonReloadHandler(virNetDaemonPtr dmn ATTRIBUTE_UNUSED,
siginfo_t *sig ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
+ virThread thr;
+
if (!driversInitialized) {
VIR_WARN("Drivers are not initialized, reload ignored");
return;
}
- VIR_INFO("Reloading configuration on SIGHUP");
- virHookCall(VIR_HOOK_DRIVER_DAEMON, "-",
- VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL, NULL);
- if (virStateReload() < 0)
- VIR_WARN("Error while reloading drivers");
+ if (virThreadCreate(&thr, false, daemonReloadHandlerThread, NULL) < 0) {
+ /*
+ * Not much we can do on error here except log it.
+ */
+ VIR_ERROR(_("Failed to create thread to handle daemon restart"));
+ }
}
static int daemonSetupSignals(virNetDaemonPtr dmn)

View File

@ -1,132 +0,0 @@
commit 3c89868c5fef3d0cfbc40d0185447d13a6242620
Author: Jim Fehlig <jfehlig@suse.com>
Date: Fri Mar 16 15:15:07 2018 -0600
libxl: lock virDomainObj after ListRemove
Most libxl driver API use the pattern of lock and add a ref to
virDomainObj, perform API, then decrement ref and unlock in
virDomainEndAPI. In some cases the API may call
virDomainObjListRemove, which unlocks the virDomainObj. Relock
the object in such cases so EndAPI is called with a locked object.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -1056,7 +1056,7 @@ libxlDomainCreateXML(virConnectPtr conn,
if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) {
if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
goto cleanup;
}
@@ -1065,7 +1065,7 @@ libxlDomainCreateXML(virConnectPtr conn,
(flags & VIR_DOMAIN_START_PAUSED) != 0) < 0) {
if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
goto cleanup;
}
goto endjob;
@@ -1417,8 +1417,10 @@ libxlDomainDestroyFlags(virDomainPtr dom
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
libxlDomainCleanup(driver, vm);
- if (!vm->persistent)
+ if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
+ virObjectLock(vm);
+ }
ret = 0;
@@ -1822,7 +1824,7 @@ libxlDomainSaveFlags(virDomainPtr dom, c
cleanup:
if (remove_dom && vm) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
virDomainObjEndAPI(&vm);
return ret;
@@ -1877,7 +1879,7 @@ libxlDomainRestoreFlags(virConnectPtr co
if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) {
if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
goto cleanup;
}
@@ -1885,8 +1887,10 @@ libxlDomainRestoreFlags(virConnectPtr co
ret = libxlDomainStartRestore(driver, vm,
(flags & VIR_DOMAIN_SAVE_PAUSED) != 0,
fd, hdr.version);
- if (ret < 0 && !vm->persistent)
+ if (ret < 0 && !vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
+ virObjectLock(vm);
+ }
libxlDomainObjEndJob(driver, vm);
@@ -1995,7 +1999,7 @@ libxlDomainCoreDump(virDomainPtr dom, co
cleanup:
if (remove_dom && vm) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
virDomainObjEndAPI(&vm);
if (event)
@@ -2056,7 +2060,7 @@ libxlDomainManagedSave(virDomainPtr dom,
cleanup:
if (remove_dom && vm) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
virDomainObjEndAPI(&vm);
VIR_FREE(name);
@@ -2880,7 +2884,7 @@ libxlDomainUndefineFlags(virDomainPtr do
vm->persistent = 0;
} else {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
ret = 0;
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
@@ -299,7 +299,7 @@ libxlDoMigrateReceive(void *opaque)
cleanup:
if (remove_dom) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
virDomainObjEndAPI(&vm);
}
@@ -1336,8 +1336,11 @@ libxlDomainMigrationFinish(virConnectPtr
VIR_DOMAIN_SHUTOFF_FAILED);
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_FAILED);
- if (!vm->persistent)
+ if (!vm->persistent) {
virDomainObjListRemove(driver->domains, vm);
+ /* Caller passed a locked vm and expects the same on return */
+ virObjectLock(vm);
+ }
}
if (event)

View File

@ -0,0 +1,159 @@
commit 412afdb8f4f3f097d6baad3acaeb9e26dfd15836
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Mar 26 12:53:05 2018 -0600
util: introduce virSocketAddrParseAny
When preparing for migration, the libxl driver creates a new TCP listen
socket for the incoming migration by calling virNetSocketNewListenTCP,
passing the destination host name. virNetSocketNewListenTCP calls
virSocketAddrParse to check if the host name is a wildcard address, in
which case it avoids adding the AI_ADDRCONFIG flag to the hints passed to
getaddrinfo. If the host name is not an IP address, virSocketAddrParse
reports an error
error : virSocketAddrParseInternal:121 : Cannot parse socket address
'myhost.example.com': Name or service not known
But virNetSocketNewListenTCP succeeds regardless and the overall migration
operation succeeds.
Introduce virSocketAddrParseAny and use it when simply testing if a host
name/addr is parsable.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.2.0/src/libvirt_private.syms
===================================================================
--- libvirt-4.2.0.orig/src/libvirt_private.syms
+++ libvirt-4.2.0/src/libvirt_private.syms
@@ -2725,6 +2725,7 @@ virSocketAddrMask;
virSocketAddrMaskByPrefix;
virSocketAddrNumericFamily;
virSocketAddrParse;
+virSocketAddrParseAny;
virSocketAddrParseIPv4;
virSocketAddrParseIPv6;
virSocketAddrPrefixToNetmask;
Index: libvirt-4.2.0/src/rpc/virnetsocket.c
===================================================================
--- libvirt-4.2.0.orig/src/rpc/virnetsocket.c
+++ libvirt-4.2.0/src/rpc/virnetsocket.c
@@ -333,7 +333,7 @@ int virNetSocketNewListenTCP(const char
* startup in most cases.
*/
if (nodename &&
- !(virSocketAddrParse(&tmp_addr, nodename, AF_UNSPEC) > 0 &&
+ !(virSocketAddrParseAny(&tmp_addr, nodename, AF_UNSPEC, false) > 0 &&
virSocketAddrIsWildcard(&tmp_addr)))
hints.ai_flags |= AI_ADDRCONFIG;
Index: libvirt-4.2.0/src/util/virsocketaddr.c
===================================================================
--- libvirt-4.2.0.orig/src/util/virsocketaddr.c
+++ libvirt-4.2.0/src/util/virsocketaddr.c
@@ -101,6 +101,7 @@ static int
virSocketAddrParseInternal(struct addrinfo **res,
const char *val,
int family,
+ int ai_flags,
bool reportError)
{
struct addrinfo hints;
@@ -114,7 +115,7 @@ virSocketAddrParseInternal(struct addrin
memset(&hints, 0, sizeof(hints));
hints.ai_family = family;
- hints.ai_flags = AI_NUMERICHOST;
+ hints.ai_flags = ai_flags;
if ((err = getaddrinfo(val, NULL, &hints, res)) != 0) {
if (reportError)
virReportError(VIR_ERR_SYSTEM_ERROR,
@@ -143,7 +144,7 @@ int virSocketAddrParse(virSocketAddrPtr
int len;
struct addrinfo *res;
- if (virSocketAddrParseInternal(&res, val, family, true) < 0)
+ if (virSocketAddrParseInternal(&res, val, family, AI_NUMERICHOST, true) < 0)
return -1;
if (res == NULL) {
@@ -163,6 +164,52 @@ int virSocketAddrParse(virSocketAddrPtr
return len;
}
+/**
+ * virSocketAddrParseAny:
+ * @addr: where to store the return value, optional.
+ * @val: a network host name or a numeric network address IPv4 or IPv6
+ * @family: address family to pass down to getaddrinfo
+ * @reportError: boolean to control error reporting
+ *
+ * Mostly a wrapper for getaddrinfo() extracting the address storage
+ * from a host name like acme.example.com or a numeric string like 1.2.3.4
+ * or 2001:db8:85a3:0:0:8a2e:370:7334.
+ *
+ * When @val is a network host name, this function may be susceptible to a
+ * delay due to potentially lengthy netork host address lookups.
+ *
+ * Returns the length of the network address or -1 in case of error.
+ */
+int virSocketAddrParseAny(virSocketAddrPtr addr,
+ const char *val,
+ int family,
+ bool reportError)
+{
+ int len;
+ struct addrinfo *res;
+
+ if (virSocketAddrParseInternal(&res, val, family, 0, reportError) < 0)
+ return -1;
+
+ if (res == NULL) {
+ if (reportError) {
+ virReportError(VIR_ERR_SYSTEM_ERROR,
+ _("No socket addresses found for '%s'"),
+ val);
+ }
+ return -1;
+ }
+
+ len = res->ai_addrlen;
+ if (addr != NULL) {
+ memcpy(&addr->data.stor, res->ai_addr, len);
+ addr->len = res->ai_addrlen;
+ }
+
+ freeaddrinfo(res);
+ return len;
+}
+
/*
* virSocketAddrParseIPv4:
* @val: an IPv4 numeric address
@@ -1105,7 +1152,7 @@ virSocketAddrNumericFamily(const char *a
struct addrinfo *res;
unsigned short family;
- if (virSocketAddrParseInternal(&res, address, AF_UNSPEC, false) < 0)
+ if (virSocketAddrParseInternal(&res, address, AF_UNSPEC, AI_NUMERICHOST, false) < 0)
return -1;
family = res->ai_addr->sa_family;
Index: libvirt-4.2.0/src/util/virsocketaddr.h
===================================================================
--- libvirt-4.2.0.orig/src/util/virsocketaddr.h
+++ libvirt-4.2.0/src/util/virsocketaddr.h
@@ -92,6 +92,11 @@ int virSocketAddrParse(virSocketAddrPtr
const char *val,
int family);
+int virSocketAddrParseAny(virSocketAddrPtr addr,
+ const char *val,
+ int family,
+ bool reportError);
+
int virSocketAddrParseIPv4(virSocketAddrPtr addr,
const char *val);

View File

@ -1,49 +0,0 @@
commit 464889fff8174f560316c998f9f38814c9a57771
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Mar 6 16:07:35 2018 +0000
rpc: push ref acquisition into RPC dispatch function
There's no reason why the virNetServerClientDispatchRead method needs to
acquire an extra reference on the "client" object. An extra reference is
only needed if the registered dispatch callback is going to keep hold of
the "client" for work in the background. Thus we can push reference
acquisition into virNetServerDispatchNewMessage.
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/rpc/virnetserver.c
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserver.c
+++ libvirt-4.1.0/src/rpc/virnetserver.c
@@ -217,9 +217,11 @@ static int virNetServerDispatchNewMessag
priority = virNetServerProgramGetPriority(prog, msg->header.proc);
}
+ virObjectRef(client);
ret = virThreadPoolSendJob(srv->workers, priority, job);
if (ret < 0) {
+ virObjectUnref(client);
VIR_FREE(job);
virObjectUnref(prog);
}
Index: libvirt-4.1.0/src/rpc/virnetserverclient.c
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserverclient.c
+++ libvirt-4.1.0/src/rpc/virnetserverclient.c
@@ -1315,12 +1315,10 @@ static void virNetServerClientDispatchRe
/* Send off to for normal dispatch to workers */
if (msg) {
- virObjectRef(client);
if (!client->dispatchFunc ||
client->dispatchFunc(client, msg, client->dispatchOpaque) < 0) {
virNetMessageFree(msg);
client->wantClose = true;
- virObjectUnref(client);
return;
}
}

View File

@ -1,269 +0,0 @@
commit 4e6fcdb6fa838d57a278dacd21bc6932edabec67
Author: John Ferlan <jferlan@redhat.com>
Date: Fri Mar 9 11:47:59 2018 -0500
libxl: Properly cleanup after libxlDomObjFromDomain
Commit id '9ac945078' altered libxlDomObjFromDomain to return
a locked *and* ref counted object for some specific purposes;
however, it neglected to alter all the consumers of the helper
to use virDomainObjEndAPI thus leaving many objects with extra
ref counts.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -1322,8 +1322,7 @@ libxlDomainShutdownFlags(virDomainPtr do
}
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -1373,8 +1372,7 @@ libxlDomainReboot(virDomainPtr dom, unsi
}
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -1459,8 +1457,7 @@ libxlDomainGetOSType(virDomainPtr dom)
goto cleanup;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return type;
}
@@ -1479,8 +1476,7 @@ libxlDomainGetMaxMemory(virDomainPtr dom
ret = virDomainDefGetMemoryTotal(vm->def);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -1658,8 +1654,7 @@ libxlDomainGetInfo(virDomainPtr dom, vir
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -1685,8 +1680,7 @@ libxlDomainGetState(virDomainPtr dom,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -2110,8 +2104,7 @@ libxlDomainHasManagedSaveImage(virDomain
ret = vm->hasManagedSave;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -2140,8 +2133,7 @@ libxlDomainManagedSaveRemove(virDomainPt
cleanup:
VIR_FREE(name);
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -2352,8 +2344,7 @@ libxlDomainGetVcpusFlags(virDomainPtr do
ret = virDomainDefGetVcpus(def);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -2484,8 +2475,7 @@ libxlDomainGetVcpuPinInfo(virDomainPtr d
libxl_get_max_cpus(cfg->ctx), NULL);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -2548,8 +2538,7 @@ libxlDomainGetVcpus(virDomainPtr dom, vi
ret = maxinfo;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -2580,8 +2569,7 @@ libxlDomainGetXMLDesc(virDomainPtr dom,
virDomainDefFormatConvertXMLFlags(flags));
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -2901,8 +2889,7 @@ libxlDomainUndefineFlags(virDomainPtr do
cleanup:
VIR_FREE(name);
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
if (event)
libxlDomainEventQueue(driver, event);
virObjectUnref(cfg);
@@ -4261,8 +4248,7 @@ libxlDomainUpdateDeviceFlags(virDomainPt
cleanup:
virDomainDefFree(vmdef);
virDomainDeviceDefFree(dev);
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -4394,8 +4380,7 @@ libxlDomainGetAutostart(virDomainPtr dom
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -4521,8 +4506,7 @@ libxlDomainGetSchedulerType(virDomainPtr
ignore_value(VIR_STRDUP(ret, name));
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -4587,8 +4571,7 @@ libxlDomainGetSchedulerParametersFlags(v
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -4750,8 +4733,7 @@ libxlDomainOpenConsole(virDomainPtr dom,
}
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -4886,8 +4868,7 @@ libxlDomainGetNumaParameters(virDomainPt
VIR_FREE(nodeset);
virBitmapFree(nodes);
libxl_bitmap_dispose(&nodemap);
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}
@@ -4908,8 +4889,7 @@ libxlDomainIsActive(virDomainPtr dom)
ret = virDomainObjIsActive(obj);
cleanup:
- if (obj)
- virObjectUnlock(obj);
+ virDomainObjEndAPI(&obj);
return ret;
}
@@ -4928,8 +4908,7 @@ libxlDomainIsPersistent(virDomainPtr dom
ret = obj->persistent;
cleanup:
- if (obj)
- virObjectUnlock(obj);
+ virDomainObjEndAPI(&obj);
return ret;
}
@@ -4948,8 +4927,7 @@ libxlDomainIsUpdated(virDomainPtr dom)
ret = vm->updated;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -5107,8 +5085,7 @@ libxlDomainGetCPUStats(virDomainPtr dom,
start_cpu, ncpus);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -5211,8 +5188,7 @@ libxlDomainGetJobInfo(virDomainPtr dom,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -5263,8 +5239,7 @@ libxlDomainGetJobStats(virDomainPtr dom,
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}

View File

@ -1,43 +0,0 @@
commit 594b8b996c83724d6b1c73641daf277307afe5f7
Author: Jim Fehlig <jfehlig@suse.com>
Date: Fri Mar 16 15:29:48 2018 -0600
libxl: convert DefineXMLFlags to use begin/end API pattern
Similar to other uses of virDomainObjListAdd, on success add a ref to the
virDomainObj so that virDomainObjEndAPI can be called as usual.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -2794,6 +2794,7 @@ libxlDomainDefineXMLFlags(virConnectPtr
&oldDef)))
goto cleanup;
+ virObjectRef(vm);
def = NULL;
vm->persistent = 1;
@@ -2801,7 +2802,7 @@ libxlDomainDefineXMLFlags(virConnectPtr
cfg->caps,
vm->newDef ? vm->newDef : vm->def) < 0) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
goto cleanup;
}
@@ -2815,8 +2816,7 @@ libxlDomainDefineXMLFlags(virConnectPtr
cleanup:
virDomainDefFree(def);
virDomainDefFree(oldDef);
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
if (event)
libxlDomainEventQueue(driver, event);
virObjectUnref(cfg);

View File

@ -1,74 +0,0 @@
commit 60b3fcd90cbd83e5721484d72414dfee1706dab8
Author: Jim Fehlig <jfehlig@suse.com>
Date: Tue Mar 13 10:48:28 2018 -0600
libxl: MigratePrepare: use standard begin and end API pattern
libxlDomainMigrationPrepare adds the incoming domain def to the list
of domains via virDomainObjListAdd, but never adds its own ref to the
returned virDomainObj as other callers of virDomainObjListAdd do.
libxlDomainMigrationPrepareTunnel3 suffers the same discrepancy.
Change both to add a ref to the virDomainObj after a successful
virDomainObjListAdd, similar to other callers. This ensures a consistent
pattern throughout the drivers and allows using the virDomainObjEndAPI
function for cleanup.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
@@ -583,6 +583,7 @@ libxlDomainMigrationPrepareTunnel3(virCo
NULL)))
goto error;
+ virObjectRef(vm);
*def = NULL;
priv = vm->privateData;
@@ -635,13 +636,11 @@ libxlDomainMigrationPrepareTunnel3(virCo
/* Remove virDomainObj from domain list */
if (vm) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
done:
- if (vm)
- virObjectUnlock(vm);
-
+ virDomainObjEndAPI(&vm);
return ret;
}
@@ -683,6 +682,7 @@ libxlDomainMigrationPrepare(virConnectPt
NULL)))
goto error;
+ virObjectRef(vm);
*def = NULL;
priv = vm->privateData;
@@ -810,7 +810,7 @@ libxlDomainMigrationPrepare(virConnectPt
/* Remove virDomainObj from domain list */
if (vm) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ virObjectLock(vm);
}
done:
@@ -820,8 +820,7 @@ libxlDomainMigrationPrepare(virConnectPt
VIR_FREE(hostname);
else
virURIFree(uri);
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
virObjectUnref(cfg);
return ret;
}

View File

@ -1,82 +0,0 @@
commit 64370c4b81f04ca73c195854966c6740e01483f2
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Mar 12 11:51:43 2018 -0600
libxl: MigrateBegin: Dont call EndAPI in helper function
The libxlDomainMigrateBegin3Params API locks and ref counts the associated
virDomainObj but relies on the helper function libxlDomainMigrationBegin
to unref/unlock the object. libxlDomainMigrationBegin is also used by
libxlDomainMigratePerform3Params for p2p migration, but in that case the
lock/ref and unref/unlock are properly handled in the API entry point. So
p2p migrations suffer a double unref/unlock in the Perform API.
Remove the unref/unlock (virDomainObjEndAPI) from libxlDomainMigrationBegin
and adjust libxlDomainMigrateBegin3Params to properly unref/unlock
the virDomainObj on success and error paths.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -5876,6 +5876,7 @@ libxlDomainMigrateBegin3Params(virDomain
{
const char *xmlin = NULL;
virDomainObjPtr vm = NULL;
+ char *xmlout = NULL;
#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
virReportUnsupportedError();
@@ -5895,25 +5896,26 @@ libxlDomainMigrateBegin3Params(virDomain
return NULL;
if (STREQ_NULLABLE(vm->def->name, "Domain-0")) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain-0 cannot be migrated"));
- return NULL;
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain-0 cannot be migrated"));
+ goto cleanup;
}
- if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0) {
- virObjectUnlock(vm);
- return NULL;
- }
+ if (virDomainMigrateBegin3ParamsEnsureACL(domain->conn, vm->def) < 0)
+ goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
- virObjectUnlock(vm);
- return NULL;
+ goto cleanup;
}
- return libxlDomainMigrationBegin(domain->conn, vm, xmlin,
- cookieout, cookieoutlen);
+ xmlout = libxlDomainMigrationBegin(domain->conn, vm, xmlin,
+ cookieout, cookieoutlen);
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return xmlout;
}
static int
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
@@ -443,7 +443,6 @@ libxlDomainMigrationBegin(virConnectPtr
cleanup:
libxlMigrationCookieFree(mig);
- virDomainObjEndAPI(&vm);
virDomainDefFree(tmpdef);
virObjectUnref(cfg);
return xml;

View File

@ -1,94 +0,0 @@
From 6b3d716e2b6472eb7189d3220552280ef3d832ce Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange@redhat.com>
Date: Fri, 12 Jan 2018 13:53:44 +0000
Subject: [PATCH] Fix compat with py3 dict keys/values data types
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
tools/keymap-gen | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/keymap-gen b/tools/keymap-gen
index d4594b4..f0269e3 100755
--- a/tools/keymap-gen
+++ b/tools/keymap-gen
@@ -356,19 +356,19 @@ class LanguageSrcGenerator(LanguageGenerator):
if frommapname in database.ENUM_COLUMNS:
fromtype = self.TYPE_ENUM
- elif type(tolinux.keys()[0]) == str:
+ elif type(list(tolinux.keys())[0]) == str:
fromtype = self.TYPE_STRING
else:
fromtype = self.TYPE_INT
if tomapname in database.ENUM_COLUMNS:
totype = self.TYPE_ENUM
- elif type(fromlinux.values()[0]) == str:
+ elif type(list(fromlinux.values())[0]) == str:
totype = self.TYPE_STRING
else:
totype = self.TYPE_INT
- keys = tolinux.keys()
+ keys = list(tolinux.keys())
keys.sort()
if fromtype == self.TYPE_INT:
keys = range(keys[-1] + 1)
@@ -402,7 +402,7 @@ class LanguageSrcGenerator(LanguageGenerator):
raise Exception("Unknown map %s, expected one of %s" % (
mapname, ", ".join(database.mapto.keys())))
- keys = database.mapto[Database.MAP_LINUX].keys()
+ keys = list(database.mapto[Database.MAP_LINUX].keys())
keys.sort()
names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys]
@@ -411,7 +411,7 @@ class LanguageSrcGenerator(LanguageGenerator):
if mapname in database.ENUM_COLUMNS:
totype = self.TYPE_ENUM
- elif type(database.mapto[mapname].values()[0]) == str:
+ elif type(list(database.mapto[mapname].values())[0]) == str:
totype = self.TYPE_STRING
else:
totype = self.TYPE_INT
@@ -440,7 +440,7 @@ class LanguageSrcGenerator(LanguageGenerator):
if varname is None:
varname = "name_map_%s_to_%s" % (frommapname, tomapname)
- keys = tolinux.keys()
+ keys = list(tolinux.keys())
keys.sort()
if type(keys[0]) == int:
keys = range(keys[-1] + 1)
@@ -470,7 +470,7 @@ class LanguageSrcGenerator(LanguageGenerator):
raise Exception("Unknown map %s, expected one of %s" % (
mapname, ", ".join(database.mapname.keys())))
- keys = database.mapto[Database.MAP_LINUX].keys()
+ keys = list(database.mapto[Database.MAP_LINUX].keys())
keys.sort()
names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys]
@@ -514,7 +514,7 @@ class LanguageDocGenerator(LanguageGenerator):
raise Exception("Unknown map %s, expected one of %s" % (
mapname, ", ".join(database.mapname.keys())))
- keys = database.mapto[Database.MAP_LINUX].keys()
+ keys = list(database.mapto[Database.MAP_LINUX].keys())
keys.sort()
names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys]
@@ -537,7 +537,7 @@ class LanguageDocGenerator(LanguageGenerator):
mapname, ", ".join(database.mapfrom.keys())))
tolinux = database.mapfrom[mapname]
- keys = tolinux.keys()
+ keys = list(tolinux.keys())
keys.sort()
if mapname in database.mapname:
names = database.mapname[mapname]
--
libgit2 0.26.0

View File

@ -1,265 +0,0 @@
commit 83edaf4435f9c2d1fa5afd1dfbb1643b4f564fd1
Author: Jim Fehlig <jfehlig@suse.com>
Date: Thu Feb 22 11:52:56 2018 -0700
libxl: don't hardcode scheduler weight
Long ago in commit dfa1e1dd53 the scheduler weight was accidentally
hardcoded to 1000. Weight is a setting with no unit since it is
relative to the weight of other domains. If no weight is specified,
libxl defaults to 256.
Instead of hardcoding the weight to 1000, honor any <shares> specified
in <cputune>. libvirt's notion of shares is synonomous to libxl's
scheduler weight setting. If shares is unspecified, defer default
weight setting to libxl.
Removing the hardcoded weight required some test fixup. While at it,
add an explicit test for <shares> conversion to scheduler weight.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_conf.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_conf.c
+++ libvirt-4.1.0/src/libxl/libxl_conf.c
@@ -366,7 +366,9 @@ libxlMakeDomBuildInfo(virDomainDefPtr de
}
}
- b_info->sched_params.weight = 1000;
+ if (def->cputune.sharesSpecified)
+ b_info->sched_params.weight = def->cputune.shares;
+
/* Xen requires the memory sizes to be rounded to 1MiB increments */
virDomainDefSetMemoryTotal(def,
VIR_ROUND_UP(virDomainDefGetMemoryInitial(def), 1024));
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/basic-hvm.json
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigdata/basic-hvm.json
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/basic-hvm.json
@@ -19,7 +19,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/basic-pv.json
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigdata/basic-pv.json
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/basic-pv.json
@@ -15,7 +15,7 @@
"max_memkb": 524288,
"target_memkb": 524288,
"sched_params": {
- "weight": 1000
+
},
"type.pv": {
"bootloader": "pygrub"
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/cpu-shares-hvm.json
===================================================================
--- /dev/null
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/cpu-shares-hvm.json
@@ -0,0 +1,89 @@
+{
+ "c_info": {
+ "type": "hvm",
+ "name": "test-hvm",
+ "uuid": "2147d599-9cc6-c0dc-92ab-4064b5446e9b"
+ },
+ "b_info": {
+ "max_vcpus": 4,
+ "avail_vcpus": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "max_memkb": 1048576,
+ "target_memkb": 1048576,
+ "video_memkb": 8192,
+ "shadow_memkb": 12288,
+ "device_model_version": "qemu_xen",
+ "device_model": "/bin/true",
+ "sched_params": {
+ "weight": 1500
+ },
+ "type.hvm": {
+ "pae": "True",
+ "apic": "True",
+ "acpi": "True",
+ "vga": {
+ "kind": "cirrus"
+ },
+ "vnc": {
+ "enable": "True",
+ "listen": "0.0.0.0",
+ "findunused": "False"
+ },
+ "sdl": {
+ "enable": "False"
+ },
+ "spice": {
+
+ },
+ "boot": "c",
+ "rdm": {
+
+ }
+ },
+ "arch_arm": {
+
+ }
+ },
+ "disks": [
+ {
+ "pdev_path": "/var/lib/xen/images/test-hvm.img",
+ "vdev": "hda",
+ "backend": "qdisk",
+ "format": "raw",
+ "removable": 1,
+ "readwrite": 1
+ }
+ ],
+ "nics": [
+ {
+ "devid": 0,
+ "mac": "00:16:3e:66:12:b4",
+ "bridge": "br0",
+ "script": "/etc/xen/scripts/vif-bridge",
+ "nictype": "vif_ioemu"
+ }
+ ],
+ "vfbs": [
+ {
+ "devid": -1,
+ "vnc": {
+ "enable": "True",
+ "listen": "0.0.0.0",
+ "findunused": "False"
+ },
+ "sdl": {
+ "enable": "False"
+ }
+ }
+ ],
+ "vkbs": [
+ {
+ "devid": -1
+ }
+ ],
+ "on_reboot": "restart"
+}
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/cpu-shares-hvm.xml
===================================================================
--- /dev/null
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/cpu-shares-hvm.xml
@@ -0,0 +1,39 @@
+<domain type='xen'>
+ <name>test-hvm</name>
+ <description>None</description>
+ <uuid>2147d599-9cc6-c0dc-92ab-4064b5446e9b</uuid>
+ <memory>1048576</memory>
+ <currentMemory>1048576</currentMemory>
+ <vcpu>4</vcpu>
+ <cputune>
+ <shares>1500</shares>
+ </cputune>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <clock offset='utc'/>
+ <os>
+ <type>hvm</type>
+ <loader>/usr/lib/xen/boot/hvmloader</loader>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <apic/>
+ <acpi/>
+ <pae/>
+ </features>
+ <devices>
+ <emulator>/bin/true</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu'/>
+ <source file='/var/lib/xen/images/test-hvm.img'/>
+ <target dev='hda'/>
+ </disk>
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ <mac address='00:16:3e:66:12:b4'/>
+ <script path='/etc/xen/scripts/vif-bridge'/>
+ </interface>
+ <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>
+ </devices>
+</domain>
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/moredevs-hvm.json
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigdata/moredevs-hvm.json
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/moredevs-hvm.json
@@ -21,7 +21,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/multiple-ip.json
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigdata/multiple-ip.json
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/multiple-ip.json
@@ -15,7 +15,7 @@
"max_memkb": 524288,
"target_memkb": 524288,
"sched_params": {
- "weight": 1000
+
},
"type.pv": {
"bootloader": "pygrub"
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/variable-clock-hvm.json
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigdata/variable-clock-hvm.json
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/variable-clock-hvm.json
@@ -21,7 +21,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
Index: libvirt-4.1.0/tests/libxlxml2domconfigdata/vnuma-hvm.json
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigdata/vnuma-hvm.json
+++ libvirt-4.1.0/tests/libxlxml2domconfigdata/vnuma-hvm.json
@@ -107,7 +107,7 @@
"device_model_version": "qemu_xen",
"device_model": "/bin/true",
"sched_params": {
- "weight": 1000
+
},
"type.hvm": {
"pae": "True",
Index: libvirt-4.1.0/tests/libxlxml2domconfigtest.c
===================================================================
--- libvirt-4.1.0.orig/tests/libxlxml2domconfigtest.c
+++ libvirt-4.1.0/tests/libxlxml2domconfigtest.c
@@ -192,6 +192,7 @@ mymain(void)
DO_TEST("basic-pv");
DO_TEST("basic-hvm");
+ DO_TEST("cpu-shares-hvm");
DO_TEST("variable-clock-hvm");
DO_TEST("moredevs-hvm");
DO_TEST("vnuma-hvm");

View File

@ -1,40 +0,0 @@
commit 86cae503a4404e068a11285564a0ee3862d1570c
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Mar 6 17:56:57 2018 +0000
rpc: avoid crashing in pre-exec if no workers are present
If max_workers is set to zero, then the worker thread pool won't be
created, so when serializing state for pre-exec we must set various
parameters to zero.
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/rpc/virnetserver.c
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserver.c
+++ libvirt-4.1.0/src/rpc/virnetserver.c
@@ -580,18 +580,21 @@ virJSONValuePtr virNetServerPreExecResta
goto error;
if (virJSONValueObjectAppendNumberUint(object, "min_workers",
+ srv->workers == NULL ? 0 :
virThreadPoolGetMinWorkers(srv->workers)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot set min_workers data in JSON document"));
goto error;
}
if (virJSONValueObjectAppendNumberUint(object, "max_workers",
+ srv->workers == NULL ? 0 :
virThreadPoolGetMaxWorkers(srv->workers)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot set max_workers data in JSON document"));
goto error;
}
if (virJSONValueObjectAppendNumberUint(object, "priority_workers",
+ srv->workers == NULL ? 0 :
virThreadPoolGetPriorityWorkers(srv->workers)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot set priority_workers data in JSON document"));

View File

@ -1,75 +0,0 @@
commit 99486799c3f911caa009d64889fc05ec3b07f986
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Mar 12 12:22:34 2018 -0600
libxl: MigrateConfirm: Dont unlock virDomainObj in helper function
The libxlDomainMigrateConfirm3Params API locks and ref counts the associated
virDomainObj but relies on the helper function libxlDomainMigrationConfirm
to unlock the object. Unref'ing the object is not done in either function.
libxlDomainMigrationConfirm is also used by libxlDomainMigratePerform3Params
for p2p migration, but in that case the lock/ref and unref/unlock are
properly handled in the API entry point.
Remove the unlock from libxlDomainMigrationConfirm and adjust
libxlDomainMigrateConfirm3Params to properly unref/unlock the virDomainObj
on success and error paths.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -6161,6 +6161,7 @@ libxlDomainMigrateConfirm3Params(virDoma
{
libxlDriverPrivatePtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL;
+ int ret = -1;
#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
virReportUnsupportedError();
@@ -6174,12 +6175,14 @@ libxlDomainMigrateConfirm3Params(virDoma
if (!(vm = libxlDomObjFromDomain(domain)))
return -1;
- if (virDomainMigrateConfirm3ParamsEnsureACL(domain->conn, vm->def) < 0) {
- virObjectUnlock(vm);
- return -1;
- }
+ if (virDomainMigrateConfirm3ParamsEnsureACL(domain->conn, vm->def) < 0)
+ goto cleanup;
+
+ ret = libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
- return libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
}
static int libxlNodeGetSecurityModel(virConnectPtr conn,
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
@@ -1392,7 +1392,8 @@ libxlDomainMigrationConfirm(libxlDriverP
if (!vm->persistent || (flags & VIR_MIGRATE_UNDEFINE_SOURCE)) {
virDomainObjListRemove(driver->domains, vm);
- vm = NULL;
+ /* Caller passed a locked vm and expects the same on return */
+ virObjectLock(vm);
}
ret = 0;
@@ -1400,8 +1401,6 @@ libxlDomainMigrationConfirm(libxlDriverP
cleanup:
if (event)
libxlDomainEventQueue(driver, event);
- if (vm)
- virObjectUnlock(vm);
virObjectUnref(cfg);
return ret;
}

View File

@ -1,989 +0,0 @@
Index: libvirt-4.1.0/docs/apibuild.py
===================================================================
--- libvirt-4.1.0.orig/docs/apibuild.py
+++ libvirt-4.1.0/docs/apibuild.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
#
# This is the API builder, it parses the C sources and build the
# API formal description in XML.
@@ -119,18 +119,18 @@ hidden_macros = {
}
def escape(raw):
- raw = string.replace(raw, '&', '&amp;')
- raw = string.replace(raw, '<', '&lt;')
- raw = string.replace(raw, '>', '&gt;')
- raw = string.replace(raw, "'", '&apos;')
- raw = string.replace(raw, '"', '&quot;')
+ raw = raw.replace('&', '&amp;')
+ raw = raw.replace('<', '&lt;')
+ raw = raw.replace('>', '&gt;')
+ raw = raw.replace("'", '&apos;')
+ raw = raw.replace('"', '&quot;')
return raw
def uniq(items):
d = {}
for item in items:
d[item]=1
- k = d.keys()
+ k = list(d.keys())
k.sort()
return k
@@ -150,8 +150,8 @@ class identifier:
else:
self.conditionals = conditionals[:]
if self.name == debugsym and not quiet:
- print "=> define %s : %s" % (debugsym, (module, type, info,
- extra, conditionals))
+ print("=> define %s : %s" % (debugsym, (module, type, info,
+ extra, conditionals)))
def __repr__(self):
r = "%s %s:" % (self.type, self.name)
@@ -160,11 +160,11 @@ class identifier:
if self.module is not None:
r = r + " from %s" % (self.module)
if self.info is not None:
- r = r + " " + `self.info`
+ r = r + " " + repr(self.info)
if self.extra is not None:
- r = r + " " + `self.extra`
+ r = r + " " + repr(self.extra)
if self.conditionals is not None:
- r = r + " " + `self.conditionals`
+ r = r + " " + repr(self.conditionals)
return r
@@ -210,8 +210,8 @@ class identifier:
def update(self, header, module, type = None, info = None, extra=None,
conditionals=None):
if self.name == debugsym and not quiet:
- print "=> update %s : %s" % (debugsym, (module, type, info,
- extra, conditionals))
+ print("=> update %s : %s" % (debugsym, (module, type, info,
+ extra, conditionals)))
if header is not None and self.header is None:
self.set_header(module)
if module is not None and (self.module is None or self.header == self.module):
@@ -243,7 +243,7 @@ class index:
def warning(self, msg):
global warnings
warnings = warnings + 1
- print msg
+ print(msg)
def add_ref(self, name, header, module, static, type, lineno, info=None, extra=None, conditionals = None):
if name[0:2] == '__':
@@ -263,7 +263,7 @@ class index:
self.references[name] = d
if name == debugsym and not quiet:
- print "New ref: %s" % (d)
+ print("New ref: %s" % (d))
return d
@@ -304,7 +304,7 @@ class index:
self.warning("Unable to register type ", type)
if name == debugsym and not quiet:
- print "New symbol: %s" % (d)
+ print("New symbol: %s" % (d))
return d
@@ -314,9 +314,9 @@ class index:
# macro might be used to override functions or variables
# definitions
#
- if self.macros.has_key(id):
+ if id in self.macros:
del self.macros[id]
- if self.functions.has_key(id):
+ if id in self.functions:
self.warning("function %s from %s redeclared in %s" % (
id, self.functions[id].header, idx.functions[id].header))
else:
@@ -327,30 +327,30 @@ class index:
# macro might be used to override functions or variables
# definitions
#
- if self.macros.has_key(id):
+ if id in self.macros:
del self.macros[id]
- if self.variables.has_key(id):
+ if id in self.variables:
self.warning("variable %s from %s redeclared in %s" % (
id, self.variables[id].header, idx.variables[id].header))
else:
self.variables[id] = idx.variables[id]
self.identifiers[id] = idx.variables[id]
for id in idx.structs.keys():
- if self.structs.has_key(id):
+ if id in self.structs:
self.warning("struct %s from %s redeclared in %s" % (
id, self.structs[id].header, idx.structs[id].header))
else:
self.structs[id] = idx.structs[id]
self.identifiers[id] = idx.structs[id]
for id in idx.unions.keys():
- if self.unions.has_key(id):
- print "union %s from %s redeclared in %s" % (
- id, self.unions[id].header, idx.unions[id].header)
+ if id in self.unions:
+ print("union %s from %s redeclared in %s" % (
+ id, self.unions[id].header, idx.unions[id].header))
else:
self.unions[id] = idx.unions[id]
self.identifiers[id] = idx.unions[id]
for id in idx.typedefs.keys():
- if self.typedefs.has_key(id):
+ if id in self.typedefs:
self.warning("typedef %s from %s redeclared in %s" % (
id, self.typedefs[id].header, idx.typedefs[id].header))
else:
@@ -361,20 +361,20 @@ class index:
# macro might be used to override functions or variables
# definitions
#
- if self.variables.has_key(id):
+ if id in self.variables:
continue
- if self.functions.has_key(id):
+ if id in self.functions:
continue
- if self.enums.has_key(id):
+ if id in self.enums:
continue
- if self.macros.has_key(id):
+ if id in self.macros:
self.warning("macro %s from %s redeclared in %s" % (
id, self.macros[id].header, idx.macros[id].header))
else:
self.macros[id] = idx.macros[id]
self.identifiers[id] = idx.macros[id]
for id in idx.enums.keys():
- if self.enums.has_key(id):
+ if id in self.enums:
self.warning("enum %s from %s redeclared in %s" % (
id, self.enums[id].header, idx.enums[id].header))
else:
@@ -383,7 +383,7 @@ class index:
def merge_public(self, idx):
for id in idx.functions.keys():
- if self.functions.has_key(id):
+ if id in self.functions:
# check that function condition agrees with header
if idx.functions[id].conditionals != \
self.functions[id].conditionals:
@@ -407,9 +407,9 @@ class index:
if id.static == 0:
public = public + 1
if count != public:
- print " %d %s , %d public" % (count, type, public)
+ print(" %d %s , %d public" % (count, type, public))
elif count != 0:
- print " %d public %s" % (count, type)
+ print(" %d public %s" % (count, type))
def analyze(self):
@@ -437,16 +437,16 @@ class CLexer:
if not line:
return None
self.lineno = self.lineno + 1
- line = string.lstrip(line)
- line = string.rstrip(line)
+ line = line.lstrip()
+ line = line.rstrip()
if line == '':
continue
while line[-1] == '\\':
line = line[:-1]
n = self.input.readline()
self.lineno = self.lineno + 1
- n = string.lstrip(n)
- n = string.rstrip(n)
+ n = n.lstrip()
+ n = n.rstrip()
if not n:
break
else:
@@ -460,9 +460,9 @@ class CLexer:
self.tokens.insert(0, token)
def debug(self):
- print "Last token: ", self.last
- print "Token queue: ", self.tokens
- print "Line %d end: " % (self.lineno), self.line
+ print("Last token: ", self.last)
+ print("Token queue: ", self.tokens)
+ print("Line %d end: " % (self.lineno), self.line)
def token(self):
while self.tokens == []:
@@ -475,8 +475,8 @@ class CLexer:
return None
if line[0] == '#':
- self.tokens = map((lambda x: ('preproc', x)),
- string.split(line))
+ self.tokens = list(map((lambda x: ('preproc', x)),
+ line.split()))
# We might have whitespace between the '#' and preproc
# macro name, so instead of having a single token element
@@ -569,21 +569,21 @@ class CLexer:
while i < l:
o = ord(line[i])
if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or \
- (o >= 48 and o <= 57) or string.find(
- " \t(){}:;,+-*/%&!|[]=><", line[i]) == -1:
+ (o >= 48 and o <= 57) or \
+ " \t(){}:;,+-*/%&!|[]=><".find(line[i]) == -1:
i = i + 1
else:
break
self.tokens.append(('name', line[s:i]))
continue
- if string.find("(){}:;,[]", line[i]) != -1:
+ if "(){}:;,[]".find(line[i]) != -1:
# if line[i] == '(' or line[i] == ')' or line[i] == '{' or \
# line[i] == '}' or line[i] == ':' or line[i] == ';' or \
# line[i] == ',' or line[i] == '[' or line[i] == ']':
self.tokens.append(('sep', line[i]))
i = i + 1
continue
- if string.find("+-*><=/%&!|.", line[i]) != -1:
+ if "+-*><=/%&!|.".find(line[i]) != -1:
# if line[i] == '+' or line[i] == '-' or line[i] == '*' or \
# line[i] == '>' or line[i] == '<' or line[i] == '=' or \
# line[i] == '/' or line[i] == '%' or line[i] == '&' or \
@@ -596,7 +596,7 @@ class CLexer:
j = i + 1
if j < l and (
- string.find("+-*><=/%&!|", line[j]) != -1):
+ "+-*><=/%&!|".find(line[j]) != -1):
# line[j] == '+' or line[j] == '-' or line[j] == '*' or \
# line[j] == '>' or line[j] == '<' or line[j] == '=' or \
# line[j] == '/' or line[j] == '%' or line[j] == '&' or \
@@ -612,7 +612,7 @@ class CLexer:
o = ord(line[i])
if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or \
(o >= 48 and o <= 57) or (
- string.find(" \t(){}:;,+-*/%&!|[]=><", line[i]) == -1):
+ " \t(){}:;,+-*/%&!|[]=><".find(line[i]) == -1):
# line[i] != ' ' and line[i] != '\t' and
# line[i] != '(' and line[i] != ')' and
# line[i] != '{' and line[i] != '}' and
@@ -691,27 +691,27 @@ class CParser:
warnings = warnings + 1
if self.no_error:
return
- print msg
+ print(msg)
def error(self, msg, token=-1):
if self.no_error:
return
- print "Parse Error: " + msg
+ print("Parse Error: " + msg)
if token != -1:
- print "Got token ", token
+ print("Got token ", token)
self.lexer.debug()
sys.exit(1)
def debug(self, msg, token=-1):
- print "Debug: " + msg
+ print("Debug: " + msg)
if token != -1:
- print "Got token ", token
+ print("Got token ", token)
self.lexer.debug()
def parseTopComment(self, comment):
res = {}
- lines = string.split(comment, "\n")
+ lines = comment.split("\n")
item = None
for line in lines:
line = line.lstrip().lstrip('*').lstrip()
@@ -722,7 +722,7 @@ class CParser:
line = m.group(2).lstrip()
if item:
- if res.has_key(item):
+ if item in res:
res[item] = res[item] + " " + line
else:
res[item] = line
@@ -760,10 +760,10 @@ class CParser:
self.comment = self.comment + com
token = self.lexer.token()
- if string.find(self.comment, "DOC_DISABLE") != -1:
+ if self.comment.find("DOC_DISABLE") != -1:
self.stop_error()
- if string.find(self.comment, "DOC_ENABLE") != -1:
+ if self.comment.find("DOC_ENABLE") != -1:
self.start_error()
return token
@@ -786,7 +786,7 @@ class CParser:
if not quiet:
self.warning("Missing * in type comment for %s" % (name))
return((args, desc))
- lines = string.split(self.comment, '\n')
+ lines = self.comment.split('\n')
if lines[0] == '*':
del lines[0]
if lines[0] != "* %s:" % (name):
@@ -802,11 +802,11 @@ class CParser:
l = lines[0]
while len(l) > 0 and l[0] == '*':
l = l[1:]
- l = string.strip(l)
+ l = l.strip()
desc = desc + " " + l
del lines[0]
- desc = string.strip(desc)
+ desc = desc.strip()
if quiet == 0:
if desc == "":
@@ -821,7 +821,7 @@ class CParser:
if name[0:2] == '__':
quiet = 1
- if ignored_macros.has_key(name):
+ if name in ignored_macros:
quiet = 1
args = []
@@ -835,7 +835,7 @@ class CParser:
if not quiet:
self.warning("Missing * in macro comment for %s" % (name))
return((args, desc))
- lines = string.split(self.comment, '\n')
+ lines = self.comment.split('\n')
if lines[0] == '*':
del lines[0]
if lines[0] != "* %s:" % (name):
@@ -849,9 +849,9 @@ class CParser:
while len(lines) > 0 and lines[0][0:3] == '* @':
l = lines[0][3:]
try:
- (arg, desc) = string.split(l, ':', 1)
- desc=string.strip(desc)
- arg=string.strip(arg)
+ (arg, desc) = l.split(':', 1)
+ desc=desc.strip()
+ arg=arg.strip()
except:
if not quiet:
self.warning("Misformatted macro comment for %s" % (name))
@@ -859,11 +859,11 @@ class CParser:
del lines[0]
continue
del lines[0]
- l = string.strip(lines[0])
+ l = lines[0].strip()
while len(l) > 2 and l[0:3] != '* @':
while l[0] == '*':
l = l[1:]
- desc = desc + ' ' + string.strip(l)
+ desc = desc + ' ' + l.strip()
del lines[0]
if len(lines) == 0:
break
@@ -876,11 +876,11 @@ class CParser:
l = lines[0]
while len(l) > 0 and l[0] == '*':
l = l[1:]
- l = string.strip(l)
+ l = l.strip()
desc = desc + " " + l
del lines[0]
- desc = string.strip(desc)
+ desc = desc.strip()
if quiet == 0:
if desc == "":
@@ -900,7 +900,7 @@ class CParser:
quiet = 1
if name[0:2] == '__':
quiet = 1
- if ignored_functions.has_key(name):
+ if name in ignored_functions:
quiet = 1
(ret, args) = description
@@ -915,7 +915,7 @@ class CParser:
if not quiet:
self.warning("Missing * in function comment for %s" % (name))
return(((ret[0], retdesc), args, desc))
- lines = string.split(self.comment, '\n')
+ lines = self.comment.split('\n')
if lines[0] == '*':
del lines[0]
if lines[0] != "* %s:" % (name):
@@ -930,9 +930,9 @@ class CParser:
while len(lines) > 0 and lines[0][0:3] == '* @':
l = lines[0][3:]
try:
- (arg, desc) = string.split(l, ':', 1)
- desc=string.strip(desc)
- arg=string.strip(arg)
+ (arg, desc) = l.split(':', 1)
+ desc=desc.strip()
+ arg=arg.strip()
except:
if not quiet:
self.warning("Misformatted function comment for %s" % (name))
@@ -940,11 +940,11 @@ class CParser:
del lines[0]
continue
del lines[0]
- l = string.strip(lines[0])
+ l = lines[0].strip()
while len(l) > 2 and l[0:3] != '* @':
while l[0] == '*':
l = l[1:]
- desc = desc + ' ' + string.strip(l)
+ desc = desc + ' ' + l.strip()
del lines[0]
if len(lines) == 0:
break
@@ -975,16 +975,16 @@ class CParser:
l = l[i:]
if len(l) >= 6 and l[0:7] == "Returns":
try:
- l = string.split(l, ' ', 1)[1]
+ l = l.split(' ', 1)[1]
except:
l = ""
- retdesc = string.strip(l)
+ retdesc = l.strip()
del lines[0]
while len(lines) > 0:
l = lines[0]
while len(l) > 0 and l[0] == '*':
l = l[1:]
- l = string.strip(l)
+ l = l.strip()
retdesc = retdesc + " " + l
del lines[0]
else:
@@ -996,8 +996,8 @@ class CParser:
if desc is None:
desc = ""
- retdesc = string.strip(retdesc)
- desc = string.strip(desc)
+ retdesc = retdesc.strip()
+ desc = desc.strip()
if quiet == 0:
#
@@ -1018,7 +1018,7 @@ class CParser:
def parsePreproc(self, token):
if debug:
- print "=> preproc ", token, self.lexer.tokens
+ print("=> preproc ", token, self.lexer.tokens)
name = token[1]
if name == "#include":
token = self.lexer.token()
@@ -1043,7 +1043,7 @@ class CParser:
lst.append(token[1])
token = self.lexer.token()
try:
- name = string.split(name, '(') [0]
+ name = name.split('(') [0]
except:
pass
@@ -1080,7 +1080,7 @@ class CParser:
apstr = self.lexer.tokens[0][1]
try:
self.defines.append(apstr)
- if string.find(apstr, 'ENABLED') != -1:
+ if apstr.find('ENABLED') != -1:
self.conditionals.append("defined(%s)" % apstr)
except:
pass
@@ -1088,7 +1088,7 @@ class CParser:
apstr = self.lexer.tokens[0][1]
try:
self.defines.append(apstr)
- if string.find(apstr, 'ENABLED') != -1:
+ if apstr.find('ENABLED') != -1:
self.conditionals.append("!defined(%s)" % apstr)
except:
pass
@@ -1100,17 +1100,17 @@ class CParser:
apstr = apstr + tok[1]
try:
self.defines.append(apstr)
- if string.find(apstr, 'ENABLED') != -1:
+ if apstr.find('ENABLED') != -1:
self.conditionals.append(apstr)
except:
pass
elif name == "#else":
if self.conditionals != [] and \
- string.find(self.defines[-1], 'ENABLED') != -1:
+ self.defines[-1].find('ENABLED') != -1:
self.conditionals[-1] = "!(%s)" % self.conditionals[-1]
elif name == "#endif":
if self.conditionals != [] and \
- string.find(self.defines[-1], 'ENABLED') != -1:
+ self.defines[-1].find('ENABLED') != -1:
self.conditionals = self.conditionals[:-1]
self.defines = self.defines[:-1]
token = self.lexer.token()
@@ -1146,7 +1146,7 @@ class CParser:
while token is not None and token[1] != ";":
token = self.lexer.token()
return token
- elif token[0] == "name" and ignored_words.has_key(token[1]):
+ elif token[0] == "name" and token[1] in ignored_words:
(n, info) = ignored_words[token[1]]
i = 0
while i < n:
@@ -1156,7 +1156,7 @@ class CParser:
continue
else:
if debug:
- print "=> ", token
+ print("=> ", token)
return token
return None
@@ -1178,7 +1178,7 @@ class CParser:
name = token[1]
signature = self.signature
if signature is not None:
- type = string.split(type, '(')[0]
+ type = type.split('(')[0]
d = self.mergeFunctionComment(name,
((type, None), signature), 1)
self.index_add(name, self.filename, not self.is_header,
@@ -1385,7 +1385,7 @@ class CParser:
self.cleanupComment()
if name is not None:
if self.comment is not None:
- comment = string.strip(self.comment)
+ comment = self.comment.strip()
self.comment = None
self.enums.append((name, value, comment))
name = token[1]
@@ -2025,7 +2025,7 @@ class CParser:
def parse(self):
if not quiet:
- print "Parsing %s" % (self.filename)
+ print("Parsing %s" % (self.filename))
token = self.token()
while token is not None:
if token[0] == 'name':
@@ -2046,13 +2046,13 @@ class docBuilder:
self.path = path
self.directories = directories
if name == "libvirt":
- self.includes = includes + included_files.keys()
+ self.includes = includes + list(included_files.keys())
elif name == "libvirt-qemu":
- self.includes = includes + qemu_included_files.keys()
+ self.includes = includes + list(qemu_included_files.keys())
elif name == "libvirt-lxc":
- self.includes = includes + lxc_included_files.keys()
+ self.includes = includes + list(lxc_included_files.keys())
elif name == "libvirt-admin":
- self.includes = includes + admin_included_files.keys()
+ self.includes = includes + list(admin_included_files.keys())
self.modules = {}
self.headers = {}
self.idx = index()
@@ -2064,44 +2064,44 @@ class docBuilder:
def warning(self, msg):
global warnings
warnings = warnings + 1
- print msg
+ print(msg)
def error(self, msg):
self.errors += 1
- print >>sys.stderr, "Error:", msg
+ print("Error:", msg, file=sys.stderr)
def indexString(self, id, str):
if str is None:
return
- str = string.replace(str, "'", ' ')
- str = string.replace(str, '"', ' ')
- str = string.replace(str, "/", ' ')
- str = string.replace(str, '*', ' ')
- str = string.replace(str, "[", ' ')
- str = string.replace(str, "]", ' ')
- str = string.replace(str, "(", ' ')
- str = string.replace(str, ")", ' ')
- str = string.replace(str, "<", ' ')
- str = string.replace(str, '>', ' ')
- str = string.replace(str, "&", ' ')
- str = string.replace(str, '#', ' ')
- str = string.replace(str, ",", ' ')
- str = string.replace(str, '.', ' ')
- str = string.replace(str, ';', ' ')
- tokens = string.split(str)
+ str = str.replace("'", ' ')
+ str = str.replace('"', ' ')
+ str = str.replace("/", ' ')
+ str = str.replace('*', ' ')
+ str = str.replace("[", ' ')
+ str = str.replace("]", ' ')
+ str = str.replace("(", ' ')
+ str = str.replace(")", ' ')
+ str = str.replace("<", ' ')
+ str = str.replace('>', ' ')
+ str = str.replace("&", ' ')
+ str = str.replace('#', ' ')
+ str = str.replace(",", ' ')
+ str = str.replace('.', ' ')
+ str = str.replace(';', ' ')
+ tokens = str.split()
for token in tokens:
try:
c = token[0]
- if string.find(string.letters, c) < 0:
+ if string.ascii_letters.find(c) < 0:
pass
elif len(token) < 3:
pass
else:
- lower = string.lower(token)
+ lower = token.lower()
# TODO: generalize this a bit
if lower == 'and' or lower == 'the':
pass
- elif self.xref.has_key(token):
+ elif token in self.xref:
self.xref[token].append(id)
else:
self.xref[token] = [id]
@@ -2110,7 +2110,7 @@ class docBuilder:
def analyze(self):
if not quiet:
- print "Project %s : %d headers, %d modules" % (self.name, len(self.headers.keys()), len(self.modules.keys()))
+ print("Project %s : %d headers, %d modules" % (self.name, len(self.headers.keys()), len(self.modules.keys())))
self.idx.analyze()
def scanHeaders(self):
@@ -2134,7 +2134,7 @@ class docBuilder:
for file in files:
skip = 1
for incl in self.includes:
- if string.find(file, incl) != -1:
+ if file.find(incl) != -1:
skip = 0
break
if skip == 0:
@@ -2143,7 +2143,7 @@ class docBuilder:
for file in files:
skip = 1
for incl in self.includes:
- if string.find(file, incl) != -1:
+ if file.find(incl) != -1:
skip = 0
break
if skip == 0:
@@ -2225,7 +2225,7 @@ class docBuilder:
output.write(" <struct name='%s' file='%s' type='%s'" % (
name, self.modulename_file(id.header), id.info))
name = id.info[7:]
- if self.idx.structs.has_key(name) and ( \
+ if name in self.idx.structs and ( \
type(self.idx.structs[name].info) == type(()) or
type(self.idx.structs[name].info) == type([])):
output.write(">\n")
@@ -2271,7 +2271,7 @@ class docBuilder:
def serialize_function(self, output, name):
id = self.idx.functions[name]
if name == debugsym and not quiet:
- print "=>", id
+ print("=>", id)
# NB: this is consumed by a regex in 'getAPIFilenames' in hvsupport.pl
output.write(" <%s name='%s' file='%s' module='%s'>\n" % (id.type,
@@ -2294,7 +2294,7 @@ class docBuilder:
if ret[0] is not None:
if ret[0] == "void":
output.write(" <return type='void'/>\n")
- elif (ret[1] is None or ret[1] == '') and not ignored_functions.has_key(name):
+ elif (ret[1] is None or ret[1] == '') and not name in ignored_functions:
self.error("Missing documentation for return of function `%s'" % name)
else:
output.write(" <return type='%s' info='%s'/>\n" % (
@@ -2304,7 +2304,7 @@ class docBuilder:
if param[0] == 'void':
continue
if (param[2] is None or param[2] == ''):
- if ignored_functions.has_key(name):
+ if name in ignored_functions:
output.write(" <arg name='%s' type='%s' info=''/>\n" % (param[1], param[0]))
else:
self.error("Missing documentation for arg `%s' of function `%s'" % (param[1], name))
@@ -2312,8 +2312,8 @@ class docBuilder:
output.write(" <arg name='%s' type='%s' info='%s'/>\n" % (param[1], param[0], escape(param[2])))
self.indexString(name, param[2])
except:
- print >>sys.stderr, "Exception:", sys.exc_info()[1]
- self.warning("Failed to save function %s info: %s" % (name, `id.info`))
+ print("Exception:", sys.exc_info()[1], file=sys.stderr)
+ self.warning("Failed to save function %s info: %s" % (name, repr(id.info)))
output.write(" </%s>\n" % (id.type))
def serialize_exports(self, output, file):
@@ -2324,65 +2324,65 @@ class docBuilder:
for data in ('Summary', 'Description', 'Author'):
try:
output.write(" <%s>%s</%s>\n" % (
- string.lower(data),
+ data.lower(),
escape(dict.info[data]),
- string.lower(data)))
+ data.lower()))
except:
self.warning("Header %s lacks a %s description" % (module, data))
- if dict.info.has_key('Description'):
+ if 'Description' in dict.info:
desc = dict.info['Description']
- if string.find(desc, "DEPRECATED") != -1:
+ if desc.find("DEPRECATED") != -1:
output.write(" <deprecated/>\n")
- ids = dict.macros.keys()
+ ids = list(dict.macros.keys())
ids.sort()
for id in uniq(ids):
# Macros are sometime used to masquerade other types.
- if dict.functions.has_key(id):
+ if id in dict.functions:
continue
- if dict.variables.has_key(id):
+ if id in dict.variables:
continue
- if dict.typedefs.has_key(id):
+ if id in dict.typedefs:
continue
- if dict.structs.has_key(id):
+ if id in dict.structs:
continue
- if dict.unions.has_key(id):
+ if id in dict.unions:
continue
- if dict.enums.has_key(id):
+ if id in dict.enums:
continue
output.write(" <exports symbol='%s' type='macro'/>\n" % (id))
- ids = dict.enums.keys()
+ ids = list(dict.enums.keys())
ids.sort()
for id in uniq(ids):
output.write(" <exports symbol='%s' type='enum'/>\n" % (id))
- ids = dict.typedefs.keys()
+ ids = list(dict.typedefs.keys())
ids.sort()
for id in uniq(ids):
output.write(" <exports symbol='%s' type='typedef'/>\n" % (id))
- ids = dict.structs.keys()
+ ids = list(dict.structs.keys())
ids.sort()
for id in uniq(ids):
output.write(" <exports symbol='%s' type='struct'/>\n" % (id))
- ids = dict.variables.keys()
+ ids = list(dict.variables.keys())
ids.sort()
for id in uniq(ids):
output.write(" <exports symbol='%s' type='variable'/>\n" % (id))
- ids = dict.functions.keys()
+ ids = list(dict.functions.keys())
ids.sort()
for id in uniq(ids):
output.write(" <exports symbol='%s' type='function'/>\n" % (id))
output.write(" </file>\n")
def serialize_xrefs_files(self, output):
- headers = self.headers.keys()
+ headers = list(self.headers.keys())
headers.sort()
for file in headers:
module = self.modulename_file(file)
output.write(" <file name='%s'>\n" % (module))
dict = self.headers[file]
- ids = uniq(dict.functions.keys() + dict.variables.keys() + \
- dict.macros.keys() + dict.typedefs.keys() + \
- dict.structs.keys() + dict.enums.keys())
+ ids = uniq(list(dict.functions.keys()) + list(dict.variables.keys()) + \
+ list(dict.macros.keys()) + list(dict.typedefs.keys()) + \
+ list(dict.structs.keys()) + list(dict.enums.keys()))
ids.sort()
for id in ids:
output.write(" <ref name='%s'/>\n" % (id))
@@ -2398,13 +2398,13 @@ class docBuilder:
for param in params:
if param[0] == 'void':
continue
- if funcs.has_key(param[0]):
+ if param[0] in funcs:
funcs[param[0]].append(name)
else:
funcs[param[0]] = [name]
except:
pass
- typ = funcs.keys()
+ typ = list(funcs.keys())
typ.sort()
for type in typ:
if type == '' or type == 'void' or type == "int" or \
@@ -2428,13 +2428,13 @@ class docBuilder:
(ret, params, desc) = id.info
if ret[0] == "void":
continue
- if funcs.has_key(ret[0]):
+ if ret[0] in funcs:
funcs[ret[0]].append(name)
else:
funcs[ret[0]] = [name]
except:
pass
- typ = funcs.keys()
+ typ = list(funcs.keys())
typ.sort()
for type in typ:
if type == '' or type == 'void' or type == "int" or \
@@ -2449,7 +2449,7 @@ class docBuilder:
def serialize_xrefs_alpha(self, output):
letter = None
- ids = self.idx.identifiers.keys()
+ ids = list(self.idx.identifiers.keys())
ids.sort()
for id in ids:
if id[0] != letter:
@@ -2462,7 +2462,7 @@ class docBuilder:
output.write(" </letter>\n")
def serialize_xrefs_references(self, output):
- typ = self.idx.identifiers.keys()
+ typ = list(self.idx.identifiers.keys())
typ.sort()
for id in typ:
idf = self.idx.identifiers[id]
@@ -2474,7 +2474,7 @@ class docBuilder:
def serialize_xrefs_index(self, output):
index = self.xref
- typ = index.keys()
+ typ = list(index.keys())
typ.sort()
letter = None
count = 0
@@ -2542,34 +2542,34 @@ class docBuilder:
def serialize(self):
filename = "%s/%s-api.xml" % (self.path, self.name)
if not quiet:
- print "Saving XML description %s" % (filename)
+ print("Saving XML description %s" % (filename))
output = open(filename, "w")
output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
output.write("<api name='%s'>\n" % self.name)
output.write(" <files>\n")
- headers = self.headers.keys()
+ headers = list(self.headers.keys())
headers.sort()
for file in headers:
self.serialize_exports(output, file)
output.write(" </files>\n")
output.write(" <symbols>\n")
- macros = self.idx.macros.keys()
+ macros = list(self.idx.macros.keys())
macros.sort()
for macro in macros:
self.serialize_macro(output, macro)
- enums = self.idx.enums.keys()
+ enums = list(self.idx.enums.keys())
enums.sort()
for enum in enums:
self.serialize_enum(output, enum)
- typedefs = self.idx.typedefs.keys()
+ typedefs = list(self.idx.typedefs.keys())
typedefs.sort()
for typedef in typedefs:
self.serialize_typedef(output, typedef)
- variables = self.idx.variables.keys()
+ variables = list(self.idx.variables.keys())
variables.sort()
for variable in variables:
self.serialize_variable(output, variable)
- functions = self.idx.functions.keys()
+ functions = list(self.idx.functions.keys())
functions.sort()
for function in functions:
self.serialize_function(output, function)
@@ -2578,12 +2578,13 @@ class docBuilder:
output.close()
if self.errors > 0:
- print >>sys.stderr, "apibuild.py: %d error(s) encountered during generation" % self.errors
+ print("apibuild.py: %d error(s) encountered during generation" % self.errors,
+ file=sys.stderr)
sys.exit(3)
filename = "%s/%s-refs.xml" % (self.path, self.name)
if not quiet:
- print "Saving XML Cross References %s" % (filename)
+ print("Saving XML Cross References %s" % (filename))
output = open(filename, "w")
output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
output.write("<apirefs name='%s'>\n" % self.name)
@@ -2596,7 +2597,7 @@ class app:
def warning(self, msg):
global warnings
warnings = warnings + 1
- print msg
+ print(msg)
def rebuild(self, name):
if name not in ["libvirt", "libvirt-qemu", "libvirt-lxc", "libvirt-admin"]:
@@ -2609,7 +2610,7 @@ class app:
builddir = None
if glob.glob(srcdir + "/../src/libvirt.c") != [] :
if not quiet:
- print "Rebuilding API description for %s" % name
+ print("Rebuilding API description for %s" % name)
dirs = [srcdir + "/../src",
srcdir + "/../src/util",
srcdir + "/../include/libvirt"]
@@ -2619,7 +2620,7 @@ class app:
builder = docBuilder(name, srcdir, dirs, [])
elif glob.glob("src/libvirt.c") != [] :
if not quiet:
- print "Rebuilding API description for %s" % name
+ print("Rebuilding API description for %s" % name)
builder = docBuilder(name, srcdir,
["src", "src/util", "include/libvirt"],
[])

View File

@ -1,7 +1,7 @@
Index: libvirt-4.1.0/examples/apparmor/libvirt-lxc
Index: libvirt-4.2.0/examples/apparmor/libvirt-lxc
===================================================================
--- libvirt-4.1.0.orig/examples/apparmor/libvirt-lxc
+++ libvirt-4.1.0/examples/apparmor/libvirt-lxc
--- libvirt-4.2.0.orig/examples/apparmor/libvirt-lxc
+++ libvirt-4.2.0/examples/apparmor/libvirt-lxc
@@ -2,39 +2,15 @@
#include <abstractions/base>

View File

@ -11,11 +11,11 @@ Signed-off-by: Chunyan Liu <cyliu@suse.com>
src/qemu/qemu_driver.c | 7 +++++++
1 file changed, 7 insertions(+)
Index: libvirt-4.1.0/src/qemu/qemu_driver.c
Index: libvirt-4.2.0/src/qemu/qemu_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/qemu/qemu_driver.c
+++ libvirt-4.1.0/src/qemu/qemu_driver.c
@@ -17275,6 +17275,14 @@ qemuDomainBlockCopyCommon(virDomainObjPt
--- libvirt-4.2.0.orig/src/qemu/qemu_driver.c
+++ libvirt-4.2.0/src/qemu/qemu_driver.c
@@ -17285,6 +17285,14 @@ qemuDomainBlockCopyCommon(virDomainObjPt
goto endjob;
}

View File

@ -1,30 +0,0 @@
commit c66e344e38269227c93e598f599108a65b066fc0
Author: Jim Fehlig <jfehlig@suse.com>
Date: Fri Mar 16 15:00:17 2018 -0600
libxl: dont dereference NULL libxlDomainObjPrivatePtr
In libxlDomainMigrationPrepare it is possible to dereference a NULL
libxlDomainObjPrivatePtr in early error paths. Check for a valid
'priv' before using it.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
@@ -804,8 +804,10 @@ libxlDomainMigrationPrepare(virConnectPt
}
VIR_FREE(socks);
virObjectUnref(args);
- virPortAllocatorRelease(priv->migrationPort);
- priv->migrationPort = 0;
+ if (priv) {
+ virPortAllocatorRelease(priv->migrationPort);
+ priv->migrationPort = 0;
+ }
/* Remove virDomainObj from domain list */
if (vm) {

View File

@ -1,117 +0,0 @@
commit c6f1d5190bbe62dae6b32081c0edd141ee19e82f
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Mar 6 16:44:34 2018 +0000
rpc: simplify calling convention of virNetServerClientDispatchFunc
Currently virNetServerClientDispatchFunc implementations are only
responsible for free'ing the "msg" parameter upon success. Simplify the
calling convention by making it their unconditional responsibility to
free the "msg", and close the client if desired.
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/rpc/virnetserver.c
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserver.c
+++ libvirt-4.1.0/src/rpc/virnetserver.c
@@ -182,15 +182,14 @@ static void virNetServerHandleJob(void *
VIR_FREE(job);
}
-static int virNetServerDispatchNewMessage(virNetServerClientPtr client,
- virNetMessagePtr msg,
- void *opaque)
+static void virNetServerDispatchNewMessage(virNetServerClientPtr client,
+ virNetMessagePtr msg,
+ void *opaque)
{
virNetServerPtr srv = opaque;
virNetServerProgramPtr prog = NULL;
unsigned int priority = 0;
size_t i;
- int ret = -1;
VIR_DEBUG("server=%p client=%p message=%p",
srv, client, msg);
@@ -207,7 +206,7 @@ static int virNetServerDispatchNewMessag
virNetServerJobPtr job;
if (VIR_ALLOC(job) < 0)
- goto cleanup;
+ goto error;
job->client = client;
job->msg = msg;
@@ -218,21 +217,24 @@ static int virNetServerDispatchNewMessag
}
virObjectRef(client);
- ret = virThreadPoolSendJob(srv->workers, priority, job);
-
- if (ret < 0) {
+ if (virThreadPoolSendJob(srv->workers, priority, job) < 0) {
virObjectUnref(client);
VIR_FREE(job);
virObjectUnref(prog);
+ goto error;
}
} else {
- ret = virNetServerProcessMsg(srv, client, prog, msg);
+ if (virNetServerProcessMsg(srv, client, prog, msg) < 0)
+ goto error;
}
- cleanup:
virObjectUnlock(srv);
+ return;
- return ret;
+ error:
+ virNetMessageFree(msg);
+ virNetServerClientClose(client);
+ virObjectUnlock(srv);
}
/**
Index: libvirt-4.1.0/src/rpc/virnetserverclient.c
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserverclient.c
+++ libvirt-4.1.0/src/rpc/virnetserverclient.c
@@ -1315,11 +1315,11 @@ static void virNetServerClientDispatchRe
/* Send off to for normal dispatch to workers */
if (msg) {
- if (!client->dispatchFunc ||
- client->dispatchFunc(client, msg, client->dispatchOpaque) < 0) {
+ if (!client->dispatchFunc) {
virNetMessageFree(msg);
client->wantClose = true;
- return;
+ } else {
+ client->dispatchFunc(client, msg, client->dispatchOpaque);
}
}
Index: libvirt-4.1.0/src/rpc/virnetserverclient.h
===================================================================
--- libvirt-4.1.0.orig/src/rpc/virnetserverclient.h
+++ libvirt-4.1.0/src/rpc/virnetserverclient.h
@@ -36,9 +36,12 @@ typedef virNetServer *virNetServerPtr;
typedef struct _virNetServerClient virNetServerClient;
typedef virNetServerClient *virNetServerClientPtr;
-typedef int (*virNetServerClientDispatchFunc)(virNetServerClientPtr client,
- virNetMessagePtr msg,
- void *opaque);
+/* This function owns the "msg" pointer it is passed and
+ * must arrange for virNetMessageFree to be called on it
+ */
+typedef void (*virNetServerClientDispatchFunc)(virNetServerClientPtr client,
+ virNetMessagePtr msg,
+ void *opaque);
typedef int (*virNetServerClientFilterFunc)(virNetServerClientPtr client,
virNetMessagePtr msg,

View File

@ -1,66 +0,0 @@
commit eefabb38c34cb61edcb4a233ebc7c764547e515e
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Tue Mar 6 17:12:20 2018 +0000
rpc: switch virtlockd and virtlogd to use single-threaded dispatch
Currently both virtlogd and virtlockd use a single worker thread for
dispatching RPC messages. Even this is overkill and their RPC message
handling callbacks all run in short, finite time and so blocking the
main loop is not an issue like you'd see in libvirtd with long running
QEMU commands.
By setting max_workers==0, we can turn off the worker thread and run
these daemons single threaded. This in turn fixes a serious problem in
the virtlockd daemon whereby it loses all fcntl() locks at re-exec due
to multiple threads existing. fcntl() locks only get preserved if the
process is single threaded at time of exec().
Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/locking/lock_daemon.c
===================================================================
--- libvirt-4.1.0.orig/src/locking/lock_daemon.c
+++ libvirt-4.1.0/src/locking/lock_daemon.c
@@ -165,7 +165,7 @@ virLockDaemonNew(virLockDaemonConfigPtr
goto error;
if (!(srv = virNetServerNew("virtlockd", 1,
- 1, 1, 0, config->max_clients,
+ 0, 0, 0, config->max_clients,
config->max_clients, -1, 0,
NULL,
virLockDaemonClientNew,
@@ -180,7 +180,7 @@ virLockDaemonNew(virLockDaemonConfigPtr
srv = NULL;
if (!(srv = virNetServerNew("admin", 1,
- 1, 1, 0, config->admin_max_clients,
+ 0, 0, 0, config->admin_max_clients,
config->admin_max_clients, -1, 0,
NULL,
remoteAdmClientNew,
Index: libvirt-4.1.0/src/logging/log_daemon.c
===================================================================
--- libvirt-4.1.0.orig/src/logging/log_daemon.c
+++ libvirt-4.1.0/src/logging/log_daemon.c
@@ -154,7 +154,7 @@ virLogDaemonNew(virLogDaemonConfigPtr co
goto error;
if (!(srv = virNetServerNew("virtlogd", 1,
- 1, 1, 0, config->max_clients,
+ 0, 0, 0, config->max_clients,
config->max_clients, -1, 0,
NULL,
virLogDaemonClientNew,
@@ -169,7 +169,7 @@ virLogDaemonNew(virLogDaemonConfigPtr co
srv = NULL;
if (!(srv = virNetServerNew("admin", 1,
- 1, 1, 0, config->admin_max_clients,
+ 0, 0, 0, config->admin_max_clients,
config->admin_max_clients, -1, 0,
NULL,
remoteAdmClientNew,

View File

@ -1,27 +0,0 @@
commit f5eacf2a9ad2b7ba07dd0fc745c098cd2d26b6ee
Author: Jim Fehlig <jfehlig@suse.com>
Date: Tue Mar 13 11:05:36 2018 -0600
libxl: MigratePerform: properly cleanup after libxlDomObjFromDomain
libxlDomObjFromDomain to returns locked and ref counted virDomainObj but
libxlDomainMigratePerform3Params only unlocks the object on exit. Convert
it to use the virDomainObjEndAPI function for cleanup.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -6086,8 +6086,7 @@ libxlDomainMigratePerform3Params(virDoma
ret = 0;
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return ret;
}

View File

@ -1,29 +0,0 @@
commit fb327ac2c3d721b4002852c520d9f39a35183e0d
Author: Jim Fehlig <jfehlig@suse.com>
Date: Wed Mar 14 16:42:39 2018 -0600
lockd: fix typo in virtlockd-admin.socket
Commit ce7ae55ea1 introduced a typo in virtlockd-admin socket file
/usr/lib/systemd/system/virtlockd-admin.socket:7: Unknown lvalue
'Server' in section 'Socket'
Change 'Server' to 'Service'.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Index: libvirt-4.1.0/src/locking/virtlockd-admin.socket.in
===================================================================
--- libvirt-4.1.0.orig/src/locking/virtlockd-admin.socket.in
+++ libvirt-4.1.0/src/locking/virtlockd-admin.socket.in
@@ -4,7 +4,7 @@ Before=libvirtd.service
[Socket]
ListenStream=@localstatedir@/run/libvirt/virtlockd-admin-sock
-Server=virtlockd.service
+Service=virtlockd.service
[Install]
WantedBy=sockets.target

View File

@ -1,51 +0,0 @@
commit fbf31e1a4cd19d6f6e33e0937a009775cd7d9513
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Thu Mar 1 14:55:26 2018 +0000
qemu: avoid denial of service reading from QEMU guest agent (CVE-2018-1064)
We read from the agent until seeing a \r\n pair to indicate a completed
reply or event. To avoid memory denial-of-service though, we must have a
size limit on amount of data we buffer. 10 MB is large enough that it
ought to cope with normal agent replies, and small enough that we're not
consuming unreasonable mem.
This is identical to the flaw we had reading from the QEMU monitor
as CVE-2018-5748, so rather embarrassing that we forgot to fix
the agent code at the same time.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Index: libvirt-4.1.0/src/qemu/qemu_agent.c
===================================================================
--- libvirt-4.1.0.orig/src/qemu/qemu_agent.c
+++ libvirt-4.1.0/src/qemu/qemu_agent.c
@@ -53,6 +53,15 @@ VIR_LOG_INIT("qemu.qemu_agent");
#define DEBUG_IO 0
#define DEBUG_RAW_IO 0
+/* We read from QEMU until seeing a \r\n pair to indicate a
+ * completed reply or event. To avoid memory denial-of-service
+ * though, we must have a size limit on amount of data we
+ * buffer. 10 MB is large enough that it ought to cope with
+ * normal QEMU replies, and small enough that we're not
+ * consuming unreasonable mem.
+ */
+#define QEMU_AGENT_MAX_RESPONSE (10 * 1024 * 1024)
+
/* When you are the first to uncomment this,
* don't forget to uncomment the corresponding
* part in qemuAgentIOProcessEvent as well.
@@ -535,6 +544,12 @@ qemuAgentIORead(qemuAgentPtr mon)
int ret = 0;
if (avail < 1024) {
+ if (mon->bufferLength >= QEMU_AGENT_MAX_RESPONSE) {
+ virReportSystemError(ERANGE,
+ _("No complete agent response found in %d bytes"),
+ QEMU_AGENT_MAX_RESPONSE);
+ return -1;
+ }
if (VIR_REALLOC_N(mon->buffer,
mon->bufferLength + 1024) < 0)
return -1;

View File

@ -1,60 +0,0 @@
commit fe51dbda56b5e51e17b238210a19e3c9887a3f15
Author: John Ferlan <jferlan@redhat.com>
Date: Fri Mar 9 11:48:00 2018 -0500
libxl: Use virDomainObjListFindBy{UUID|ID}Ref
For libxlDomainLookupByID and libxlDomainLookupByUUID let's
return a locked and referenced @vm object so that callers can
then use the common and more consistent virDomainObjEndAPI in
order to handle cleanup rather than needing to know that the
returned object is locked and calling virObjectUnlock.
The LookupByName already returns the ref counted and locked object,
so this will make things more consistent.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -1090,7 +1090,7 @@ libxlDomainLookupByID(virConnectPtr conn
virDomainObjPtr vm;
virDomainPtr dom = NULL;
- vm = virDomainObjListFindByID(driver->domains, id);
+ vm = virDomainObjListFindByIDRef(driver->domains, id);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
@@ -1102,8 +1102,7 @@ libxlDomainLookupByID(virConnectPtr conn
dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return dom;
}
@@ -1114,7 +1113,7 @@ libxlDomainLookupByUUID(virConnectPtr co
virDomainObjPtr vm;
virDomainPtr dom = NULL;
- vm = virDomainObjListFindByUUID(driver->domains, uuid);
+ vm = virDomainObjListFindByUUIDRef(driver->domains, uuid);
if (!vm) {
virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
@@ -1126,8 +1125,7 @@ libxlDomainLookupByUUID(virConnectPtr co
dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
cleanup:
- if (vm)
- virObjectUnlock(vm);
+ virDomainObjEndAPI(&vm);
return dom;
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a2fa4826f311a936be8b7d4c8d76516c29417a593b1d1bb8641a8caaa316439
size 15046956

View File

@ -1,10 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEcBAABAgAGBQJanQlIAAoJEBVYiyZZa+pdrxsIAJN6V0s6j1gTS76KO0njYtJP
zaoOrTgI5D26I5ZsLQq8f7z+IB9g+2c5O2dl7Za0vNRKbDMDwj2+4W+Lm50swcVm
p4vJPGWD3zYst+yIWW2rny7+nZ14h51Q7henlIDt4CSFDhQ6rh8ngcaVpB9CdrUM
34hIzxgUVd9PPIVoWfMcFLkeQypIfqJArsF8RLMogOcyapwXPXVOn2oxaVbqYsVt
XkwIw7NFBY4bdjeZZo6dzvC78sjk2a9cutUjg3/odomhN/9PN/KVIfCJCSLmSfwI
+FmVfQD+s0rx0asvqGV8bLVkpmWTVegYjyZPu2hB3RzAAfVbEYBXLVjE57Xf/do=
=3Whv
-----END PGP SIGNATURE-----

3
libvirt-4.2.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3a98ea4417811a24d2cf7be776c102919ae6376d28820b153686b018cb8f015b
size 15180120

10
libvirt-4.2.0.tar.xz.asc Normal file
View File

@ -0,0 +1,10 @@
-----BEGIN PGP SIGNATURE-----
iQEcBAABAgAGBQJawJF8AAoJEBVYiyZZa+pdMlMH/jVktHPj/ZxVyP+sUrlknhPw
IONmqaXw2bqsRvQnIMC2jIap+XQgwElQqYarcgwMvn0DODpo58mKq19fYBqEAQTx
jvpdCfoNMQ3ki2dxJ9fu+8TYq+oGv/axDYWe6TepV032oE/3C77KwPxxzTeIJe2p
bir0LS8SPNXHiGa+Yr6TwPnByq49qp+0EfIjTA8vgnFemU9iGqh85waSAeU1zHRC
EMSQevtDtW6hMn6yRHywZurvWIyyb8n0VQfgsgiX0gy2JnNpnOSwmtENJJQ86qQS
uMNu1RtdYwGe8CmZZvC2HbelXOvMbtdkr2mP8yWACh8DlNo7mTowp6hXIsJPxxA=
=Rmql
-----END PGP SIGNATURE-----

View File

@ -2,10 +2,10 @@ Add POWER8 v2.0 and v2.1 to cpu map XML
From: <ro@suse.de>
Index: libvirt-4.1.0/src/cpu/cpu_map.xml
Index: libvirt-4.2.0/src/cpu/cpu_map.xml
===================================================================
--- libvirt-4.1.0.orig/src/cpu/cpu_map.xml
+++ libvirt-4.1.0/src/cpu/cpu_map.xml
--- libvirt-4.2.0.orig/src/cpu/cpu_map.xml
+++ libvirt-4.2.0/src/cpu/cpu_map.xml
@@ -2349,6 +2349,8 @@
<pvr value='0x004b0000' mask='0xffff0000'/>
<pvr value='0x004c0000' mask='0xffff0000'/>

View File

@ -1,7 +1,7 @@
Index: libvirt-4.1.0/configure.ac
Index: libvirt-4.2.0/configure.ac
===================================================================
--- libvirt-4.1.0.orig/configure.ac
+++ libvirt-4.1.0/configure.ac
--- libvirt-4.2.0.orig/configure.ac
+++ libvirt-4.2.0/configure.ac
@@ -258,6 +258,7 @@ LIBVIRT_ARG_LIBSSH
LIBVIRT_ARG_LIBXML
LIBVIRT_ARG_MACVTAP
@ -18,7 +18,7 @@ Index: libvirt-4.1.0/configure.ac
LIBVIRT_CHECK_NUMACTL
LIBVIRT_CHECK_NWFILTER
LIBVIRT_CHECK_OPENWSMAN
@@ -996,6 +998,7 @@ LIBVIRT_RESULT_LIBXL
@@ -994,6 +996,7 @@ LIBVIRT_RESULT_LIBXL
LIBVIRT_RESULT_LIBXML
LIBVIRT_RESULT_MACVTAP
LIBVIRT_RESULT_NETCF
@ -26,36 +26,10 @@ Index: libvirt-4.1.0/configure.ac
LIBVIRT_RESULT_NSS
LIBVIRT_RESULT_NUMACTL
LIBVIRT_RESULT_OPENWSMAN
Index: libvirt-4.1.0/src/Makefile.am
Index: libvirt-4.2.0/tools/virsh.c
===================================================================
--- libvirt-4.1.0.orig/src/Makefile.am
+++ libvirt-4.1.0/src/Makefile.am
@@ -857,6 +857,10 @@ if WITH_NETCF
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_netcf.c
endif WITH_NETCF
+if WITH_NETCONTROL
+INTERFACE_DRIVER_SOURCES += \
+ interface/interface_backend_netcf.c
+endif WITH_NETCONTROL
if WITH_UDEV
INTERFACE_DRIVER_SOURCES += \
interface/interface_backend_udev.c
@@ -1228,6 +1232,10 @@ if WITH_NETCF
libvirt_driver_interface_la_CFLAGS += $(NETCF_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
endif WITH_NETCF
+if WITH_NETCONTROL
+libvirt_driver_interface_la_CFLAGS += $(NETCONTROL_CFLAGS)
+libvirt_driver_interface_la_LIBADD += $(NETCONTROL_LIBS)
+endif WITH_NETCONTROL
if WITH_UDEV
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)
Index: libvirt-4.1.0/tools/virsh.c
===================================================================
--- libvirt-4.1.0.orig/tools/virsh.c
+++ libvirt-4.1.0/tools/virsh.c
--- libvirt-4.2.0.orig/tools/virsh.c
+++ libvirt-4.2.0/tools/virsh.c
@@ -578,6 +578,8 @@ virshShowVersion(vshControl *ctl ATTRIBU
vshPrint(ctl, " Interface");
# if defined(WITH_NETCF)
@ -65,10 +39,10 @@ Index: libvirt-4.1.0/tools/virsh.c
# elif defined(WITH_UDEV)
vshPrint(ctl, " udev");
# endif
Index: libvirt-4.1.0/src/interface/interface_backend_netcf.c
Index: libvirt-4.2.0/src/interface/interface_backend_netcf.c
===================================================================
--- libvirt-4.1.0.orig/src/interface/interface_backend_netcf.c
+++ libvirt-4.1.0/src/interface/interface_backend_netcf.c
--- libvirt-4.2.0.orig/src/interface/interface_backend_netcf.c
+++ libvirt-4.2.0/src/interface/interface_backend_netcf.c
@@ -23,7 +23,12 @@
#include <config.h>
@ -152,10 +126,10 @@ Index: libvirt-4.1.0/src/interface/interface_backend_netcf.c
if (virRegisterConnectDriver(&interfaceConnectDriver, false) < 0)
return -1;
if (virSetSharedInterfaceDriver(&interfaceDriver) < 0)
Index: libvirt-4.1.0/src/interface/interface_driver.c
Index: libvirt-4.2.0/src/interface/interface_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/interface/interface_driver.c
+++ libvirt-4.1.0/src/interface/interface_driver.c
--- libvirt-4.2.0.orig/src/interface/interface_driver.c
+++ libvirt-4.2.0/src/interface/interface_driver.c
@@ -30,8 +30,15 @@ interfaceRegister(void)
if (netcfIfaceRegister() == 0)
return 0;
@ -173,10 +147,10 @@ Index: libvirt-4.1.0/src/interface/interface_driver.c
if (udevIfaceRegister() == 0)
return 0;
#endif /* WITH_UDEV */
Index: libvirt-4.1.0/m4/virt-netcontrol.m4
Index: libvirt-4.2.0/m4/virt-netcontrol.m4
===================================================================
--- /dev/null
+++ libvirt-4.1.0/m4/virt-netcontrol.m4
+++ libvirt-4.2.0/m4/virt-netcontrol.m4
@@ -0,0 +1,39 @@
+dnl The libnetcontrol library
+dnl
@ -217,3 +191,27 @@ Index: libvirt-4.1.0/m4/virt-netcontrol.m4
+AC_DEFUN([LIBVIRT_RESULT_NETCONTROL],[
+ LIBVIRT_RESULT_LIB([NETCONTROL])
+])
Index: libvirt-4.2.0/src/interface/Makefile.inc.am
===================================================================
--- libvirt-4.2.0.orig/src/interface/Makefile.inc.am
+++ libvirt-4.2.0/src/interface/Makefile.inc.am
@@ -4,6 +4,7 @@ INTERFACE_DRIVER_SOURCES = \
$(NULL)
INTERFACE_DRIVER_NETCF_SOURCES = interface/interface_backend_netcf.c
+INTERFACE_DRIVER_NETCONTROL_SOURCES = interface/interface_backend_netcf.c
INTERFACE_DRIVER_UDEV_SOURCES = interface/interface_backend_udev.c
DRIVER_SOURCE_FILES += $(INTERFACE_DRIVER_SOURCES)
@@ -33,6 +34,11 @@ libvirt_driver_interface_la_CFLAGS += $(
libvirt_driver_interface_la_LIBADD += $(NETCF_LIBS)
libvirt_driver_interface_la_SOURCES += $(INTERFACE_DRIVER_NETCF_SOURCES)
endif WITH_NETCF
+if WITH_NETCONTROL
+libvirt_driver_interface_la_CFLAGS += $(NETCONTROL_CFLAGS)
+libvirt_driver_interface_la_LIBADD += $(NETCONTROL_LIBS)
+libvirt_driver_interface_la_SOURCES += $(INTERFACE_DRIVER_NETCONTROL_SOURCES)
+endif WITH_NETCONTROL
if WITH_UDEV
libvirt_driver_interface_la_CFLAGS += $(UDEV_CFLAGS)
libvirt_driver_interface_la_LIBADD += $(UDEV_LIBS)

View File

@ -1,3 +1,40 @@
-------------------------------------------------------------------
Thu Apr 5 21:08:11 UTC 2018 - jfehlig@suse.com
- util: improvements in error handling
09877303-virSocketAddrParseInternal.patch,
412afdb8-intro-virSocketAddrParseAny.patch
bsc#1080957
-------------------------------------------------------------------
Thu Apr 5 15:22:16 UTC 2018 - jfehlig@suse.com
- Update to libvirt 4.2.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
6b3d716e-keycodemap-py3.patch,
33c6eb96-fix-libvirtd-reload-deadlock.patch,
464889ff-rpc-aquire-ref-dispatch.patch,
c6f1d519-rpc-simplify-dispatch.patch,
06e7ebb6-rpc-invoke-dispatch-unlocked.patch,
86cae503-rpc-fix-pre-exec.patch,
eefabb38-rpc-virtlockd-virtlogd-single-thread.patch,
fbf31e1a-CVE-2018-1064.patch,
fb327ac2-virtlockd-admin-socket.patch,
64370c4b-libxl-MigrateBegin.patch,
99486799-libxl-MigrateConfirm.patch,
f5eacf2a-libxl-MigratePerform.patch,
4e6fcdb6-libxl-libxlDomObjFromDomain-cleanup.patch,
fe51dbda-libxl-use-FindByRef.patch,
60b3fcd9-libxl-MigratePrepare.patch,
3c89868c-libxl-lock-after-ListRemove.patch,
13e81fc6-libxl-EndJob-on-error.patch,
594b8b99-libxl-DefineXMLFlags-API-pattern.patch,
c66e344e-libxl-dont-deref-NULL.patch,
83edaf44-libxl-dont-hardcode-sched-weight.patch,
apibuild-py3.patch
-------------------------------------------------------------------
Wed Mar 21 22:43:28 UTC 2018 - jfehlig@suse.com

View File

@ -175,7 +175,7 @@
Name: libvirt
Url: http://libvirt.org/
Version: 4.1.0
Version: 4.2.0
Release: 0
Summary: Library providing a simple virtualization API
License: LGPL-2.1-or-later
@ -270,7 +270,6 @@ BuildRequires: iptables
BuildRequires: cyrus-sasl-devel
BuildRequires: ebtables
BuildRequires: polkit >= 0.93
BuildRequires: polkit-devel >= 0.93
BuildRequires: radvd
# For mount/umount in FS driver
BuildRequires: util-linux
@ -325,26 +324,8 @@ Source6: libvirtd-relocation-server.xml
Source99: baselibs.conf
Source100: %{name}-rpmlintrc
# Upstream patches
Patch0: 6b3d716e-keycodemap-py3.patch
Patch1: 33c6eb96-fix-libvirtd-reload-deadlock.patch
Patch2: 464889ff-rpc-aquire-ref-dispatch.patch
Patch3: c6f1d519-rpc-simplify-dispatch.patch
Patch4: 06e7ebb6-rpc-invoke-dispatch-unlocked.patch
Patch5: 86cae503-rpc-fix-pre-exec.patch
Patch6: eefabb38-rpc-virtlockd-virtlogd-single-thread.patch
Patch7: fbf31e1a-CVE-2018-1064.patch
Patch8: fb327ac2-virtlockd-admin-socket.patch
Patch9: 64370c4b-libxl-MigrateBegin.patch
Patch10: 99486799-libxl-MigrateConfirm.patch
Patch11: f5eacf2a-libxl-MigratePerform.patch
Patch12: 4e6fcdb6-libxl-libxlDomObjFromDomain-cleanup.patch
Patch13: fe51dbda-libxl-use-FindByRef.patch
Patch14: 60b3fcd9-libxl-MigratePrepare.patch
Patch15: 3c89868c-libxl-lock-after-ListRemove.patch
Patch16: 13e81fc6-libxl-EndJob-on-error.patch
Patch17: 594b8b99-libxl-DefineXMLFlags-API-pattern.patch
Patch18: c66e344e-libxl-dont-deref-NULL.patch
Patch19: 83edaf44-libxl-dont-hardcode-sched-weight.patch
Patch0: 09877303-virSocketAddrParseInternal.patch
Patch1: 412afdb8-intro-virSocketAddrParseAny.patch
# Patches pending upstream review
Patch100: libxl-dom-reset.patch
Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch
@ -357,7 +338,6 @@ Patch154: libxl-set-migration-constraints.patch
Patch155: libxl-set-cach-mode.patch
Patch156: 0001-Extract-stats-functions-from-the-qemu-driver.patch
Patch157: 0002-lxc-implement-connectGetAllDomainStats.patch
Patch158: apibuild-py3.patch
# Our patches
Patch200: suse-libvirtd-disable-tls.patch
Patch201: suse-libvirtd-sysconfig-settings.patch
@ -947,29 +927,8 @@ libvirt plugin for NSS for translating domain names into IP addresses.
%prep
%setup -q
# 6b3d716e-keycodemap-py3.patch patches the keycodemapdb git submodule
pushd src/keycodemapdb
%patch0 -p1
popd
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch100 -p1
%patch101 -p1
%patch150 -p1
@ -980,7 +939,6 @@ popd
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch158 -p1
%patch200 -p1
%patch201 -p1
%patch202 -p1

View File

@ -8,10 +8,10 @@ Date: Mon Jun 23 15:51:20 2014 -0600
option, but domainReset can be implemented in the libxl driver by
forcibly destroying the domain and starting it again.
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
Index: libvirt-4.2.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
--- libvirt-4.2.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.2.0/src/libxl/libxl_driver.c
@@ -1375,6 +1375,61 @@ libxlDomainReboot(virDomainPtr dom, unsi
}
@ -74,7 +74,7 @@ Index: libvirt-4.1.0/src/libxl/libxl_driver.c
libxlDomainDestroyFlags(virDomainPtr dom,
unsigned int flags)
{
@@ -6476,6 +6531,7 @@ static virHypervisorDriver libxlHypervis
@@ -6487,6 +6542,7 @@ static virHypervisorDriver libxlHypervis
.domainShutdown = libxlDomainShutdown, /* 0.9.0 */
.domainShutdownFlags = libxlDomainShutdownFlags, /* 0.9.10 */
.domainReboot = libxlDomainReboot, /* 0.9.0 */

View File

@ -8,10 +8,10 @@ as the default <emulator>, instead of the qemu-xen one.
See FATE#320638 for details.
Index: libvirt-4.1.0/src/libxl/libxl_capabilities.c
Index: libvirt-4.2.0/src/libxl/libxl_capabilities.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_capabilities.c
+++ libvirt-4.1.0/src/libxl/libxl_capabilities.c
--- libvirt-4.2.0.orig/src/libxl/libxl_capabilities.c
+++ libvirt-4.2.0/src/libxl/libxl_capabilities.c
@@ -38,6 +38,7 @@
#include "libxl_capabilities.h"
#include "cpu/cpu_x86.h"

View File

@ -3,10 +3,10 @@ https://bugzilla.novell.com/show_bug.cgi?id=879425
src/libxl/libxl_conf.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
Index: libvirt-4.1.0/src/libxl/libxl_conf.c
Index: libvirt-4.2.0/src/libxl/libxl_conf.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_conf.c
+++ libvirt-4.1.0/src/libxl/libxl_conf.c
--- libvirt-4.2.0.orig/src/libxl/libxl_conf.c
+++ libvirt-4.2.0/src/libxl/libxl_conf.c
@@ -771,6 +771,30 @@ libxlDiskSetDiscard(libxl_device_disk *x
#endif
}

View File

@ -16,10 +16,10 @@ Signed-off-by: Jim Fehlig <jfehlig@suse.com>
tools/virsh.pod | 8 ++++++++
6 files changed, 125 insertions(+), 6 deletions(-)
Index: libvirt-4.1.0/include/libvirt/libvirt-domain.h
Index: libvirt-4.2.0/include/libvirt/libvirt-domain.h
===================================================================
--- libvirt-4.1.0.orig/include/libvirt/libvirt-domain.h
+++ libvirt-4.1.0/include/libvirt/libvirt-domain.h
--- libvirt-4.2.0.orig/include/libvirt/libvirt-domain.h
+++ libvirt-4.2.0/include/libvirt/libvirt-domain.h
@@ -1008,6 +1008,31 @@ typedef enum {
*/
# define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT "auto_converge.increment"
@ -52,11 +52,11 @@ Index: libvirt-4.1.0/include/libvirt/libvirt-domain.h
/* Domain migration. */
virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn,
unsigned long flags, const char *dname,
Index: libvirt-4.1.0/src/libxl/libxl_driver.c
Index: libvirt-4.2.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.1.0/src/libxl/libxl_driver.c
@@ -6076,6 +6076,9 @@ libxlDomainMigratePerform3Params(virDoma
--- libvirt-4.2.0.orig/src/libxl/libxl_driver.c
+++ libvirt-4.2.0/src/libxl/libxl_driver.c
@@ -6087,6 +6087,9 @@ libxlDomainMigratePerform3Params(virDoma
const char *dname = NULL;
const char *uri = NULL;
int ret = -1;
@ -66,7 +66,7 @@ Index: libvirt-4.1.0/src/libxl/libxl_driver.c
#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
virReportUnsupportedError();
@@ -6092,6 +6095,18 @@ libxlDomainMigratePerform3Params(virDoma
@@ -6103,6 +6106,18 @@ libxlDomainMigratePerform3Params(virDoma
virTypedParamsGetString(params, nparams,
VIR_MIGRATE_PARAM_DEST_NAME,
&dname) < 0 ||
@ -85,31 +85,31 @@ Index: libvirt-4.1.0/src/libxl/libxl_driver.c
virTypedParamsGetString(params, nparams,
VIR_MIGRATE_PARAM_URI,
&uri) < 0)
@@ -6106,11 +6121,11 @@ libxlDomainMigratePerform3Params(virDoma
@@ -6117,11 +6132,11 @@ libxlDomainMigratePerform3Params(virDoma
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
if (libxlDomainMigrationPerformP2P(driver, vm, dom->conn, dom_xml,
- dconnuri, uri, dname, flags) < 0)
+ dconnuri, uri, dname, &props) < 0)
if (libxlDomainMigrationSrcPerformP2P(driver, vm, dom->conn, dom_xml,
- dconnuri, uri, dname, flags) < 0)
+ dconnuri, uri, dname, &props) < 0)
goto cleanup;
} else {
if (libxlDomainMigrationPerform(driver, vm, dom_xml, dconnuri,
- uri, dname, flags) < 0)
+ uri, dname, &props) < 0)
if (libxlDomainMigrationSrcPerform(driver, vm, dom_xml, dconnuri,
- uri, dname, flags) < 0)
+ uri, dname, &props) < 0)
goto cleanup;
}
Index: libvirt-4.1.0/src/libxl/libxl_migration.c
Index: libvirt-4.2.0/src/libxl/libxl_migration.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.1.0/src/libxl/libxl_migration.c
@@ -359,18 +359,39 @@ libxlMigrateReceive(virNetSocketPtr sock
--- libvirt-4.2.0.orig/src/libxl/libxl_migration.c
+++ libvirt-4.2.0/src/libxl/libxl_migration.c
@@ -359,18 +359,39 @@ libxlMigrateDstReceive(virNetSocketPtr s
static int
libxlDoMigrateSend(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
- unsigned long flags,
+ const libxlDomainMigrationProps *props,
int sockfd)
libxlDoMigrateSrcSend(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
- unsigned long flags,
+ const libxlDomainMigrationProps *props,
int sockfd)
{
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+#ifdef LIBXL_HAVE_DOMAIN_SUSPEND_SUSE
@ -145,34 +145,34 @@ Index: libvirt-4.1.0/src/libxl/libxl_migration.c
if (ret != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to send migration data to destination host"));
@@ -908,7 +929,7 @@ struct libxlTunnelControl {
@@ -906,7 +927,7 @@ struct libxlTunnelControl {
static int
libxlMigrationStartTunnel(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
- unsigned long flags,
+ const libxlDomainMigrationProps *props,
virStreamPtr st,
struct libxlTunnelControl **tnl)
libxlMigrationSrcStartTunnel(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
- unsigned long flags,
+ const libxlDomainMigrationProps *props,
virStreamPtr st,
struct libxlTunnelControl **tnl)
{
@@ -941,7 +962,7 @@ libxlMigrationStartTunnel(libxlDriverPri
@@ -939,7 +960,7 @@ libxlMigrationSrcStartTunnel(libxlDriver
virObjectUnlock(vm);
/* Send data to pipe */
- ret = libxlDoMigrateSend(driver, vm, flags, tc->dataFD[1]);
+ ret = libxlDoMigrateSend(driver, vm, props, tc->dataFD[1]);
- ret = libxlDoMigrateSrcSend(driver, vm, flags, tc->dataFD[1]);
+ ret = libxlDoMigrateSrcSend(driver, vm, props, tc->dataFD[1]);
virObjectLock(vm);
out:
@@ -976,7 +997,7 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr
const char *dconnuri ATTRIBUTE_UNUSED,
const char *dname,
const char *uri,
- unsigned int flags)
+ const libxlDomainMigrationProps *props)
@@ -975,7 +996,7 @@ libxlDoMigrateSrcP2P(libxlDriverPrivateP
const char *dconnuri ATTRIBUTE_UNUSED,
const char *dname,
const char *uri,
- unsigned int flags)
+ const libxlDomainMigrationProps *props)
{
virDomainPtr ddomain = NULL;
virTypedParameterPtr params = NULL;
@@ -1016,11 +1037,11 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr
@@ -1015,11 +1036,11 @@ libxlDoMigrateSrcP2P(libxlDriverPrivateP
/* We don't require the destination to have P2P support
* as it looks to be normal migration from the receiver perpective.
*/
@ -186,7 +186,7 @@ Index: libvirt-4.1.0/src/libxl/libxl_migration.c
if (!(st = virStreamNew(dconn, 0)))
goto cleanup;
ret = dconn->driver->domainMigratePrepareTunnel3Params
@@ -1034,7 +1055,7 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr
@@ -1033,7 +1054,7 @@ libxlDoMigrateSrcP2P(libxlDriverPrivateP
if (ret == -1)
goto cleanup;
@ -195,27 +195,27 @@ Index: libvirt-4.1.0/src/libxl/libxl_migration.c
if (uri_out) {
if (virTypedParamsReplaceString(&params, &nparams,
VIR_MIGRATE_PARAM_URI, uri_out) < 0) {
@@ -1049,11 +1070,11 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr
@@ -1048,11 +1069,11 @@ libxlDoMigrateSrcP2P(libxlDriverPrivateP
}
VIR_DEBUG("Perform3 uri=%s", NULLSTR(uri_out));
- if (flags & VIR_MIGRATE_TUNNELLED)
- ret = libxlMigrationStartTunnel(driver, vm, flags, st, &tc);
- ret = libxlMigrationSrcStartTunnel(driver, vm, flags, st, &tc);
+ if (props->virFlags & VIR_MIGRATE_TUNNELLED)
+ ret = libxlMigrationStartTunnel(driver, vm, props, st, &tc);
+ ret = libxlMigrationSrcStartTunnel(driver, vm, props, st, &tc);
else
ret = libxlDomainMigrationPerform(driver, vm, NULL, NULL,
- uri_out, NULL, flags);
+ uri_out, NULL, props);
ret = libxlDomainMigrationSrcPerform(driver, vm, NULL, NULL,
- uri_out, NULL, flags);
+ uri_out, NULL, props);
if (ret < 0)
orig_err = virSaveLastError();
@@ -1084,14 +1105,14 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr
@@ -1083,14 +1104,14 @@ libxlDoMigrateSrcP2P(libxlDriverPrivateP
orig_err = virSaveLastError();
VIR_DEBUG("Confirm3 cancelled=%d vm=%p", cancelled, vm);
- ret = libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
+ ret = libxlDomainMigrationConfirm(driver, vm, props->virFlags, cancelled);
- ret = libxlDomainMigrationSrcConfirm(driver, vm, flags, cancelled);
+ ret = libxlDomainMigrationSrcConfirm(driver, vm, props->virFlags, cancelled);
if (ret < 0)
VIR_WARN("Guest %s probably left in 'paused' state on source",
@ -224,49 +224,49 @@ Index: libvirt-4.1.0/src/libxl/libxl_migration.c
cleanup:
- if (flags & VIR_MIGRATE_TUNNELLED) {
+ if (props->virFlags & VIR_MIGRATE_TUNNELLED) {
libxlMigrationStopTunnel(tc);
libxlMigrationSrcStopTunnel(tc);
virObjectUnref(st);
}
@@ -1138,7 +1159,7 @@ libxlDomainMigrationPerformP2P(libxlDriv
const char *dconnuri,
const char *uri_str ATTRIBUTE_UNUSED,
const char *dname,
- unsigned int flags)
+ const libxlDomainMigrationProps *props)
@@ -1137,7 +1158,7 @@ libxlDomainMigrationSrcPerformP2P(libxlD
const char *dconnuri,
const char *uri_str ATTRIBUTE_UNUSED,
const char *dname,
- unsigned int flags)
+ const libxlDomainMigrationProps *props)
{
int ret = -1;
bool useParams;
@@ -1173,7 +1194,7 @@ libxlDomainMigrationPerformP2P(libxlDriv
@@ -1172,7 +1193,7 @@ libxlDomainMigrationSrcPerformP2P(libxlD
}
ret = libxlDoMigrateP2P(driver, vm, sconn, xmlin, dconn, dconnuri,
- dname, uri_str, flags);
+ dname, uri_str, props);
ret = libxlDoMigrateSrcP2P(driver, vm, sconn, xmlin, dconn, dconnuri,
- dname, uri_str, flags);
+ dname, uri_str, props);
cleanup:
orig_err = virSaveLastError();
@@ -1195,7 +1216,7 @@ libxlDomainMigrationPerform(libxlDriverP
const char *dconnuri ATTRIBUTE_UNUSED,
const char *uri_str,
const char *dname ATTRIBUTE_UNUSED,
- unsigned int flags)
+ const libxlDomainMigrationProps *props)
@@ -1194,7 +1215,7 @@ libxlDomainMigrationSrcPerform(libxlDriv
const char *dconnuri ATTRIBUTE_UNUSED,
const char *uri_str,
const char *dname ATTRIBUTE_UNUSED,
- unsigned int flags)
+ const libxlDomainMigrationProps *props)
{
libxlDomainObjPrivatePtr priv = vm->privateData;
char *hostname = NULL;
@@ -1235,7 +1256,7 @@ libxlDomainMigrationPerform(libxlDriverP
@@ -1234,7 +1255,7 @@ libxlDomainMigrationSrcPerform(libxlDriv
/* suspend vm and send saved data to dst through socket fd */
virObjectUnlock(vm);
- ret = libxlDoMigrateSend(driver, vm, flags, sockfd);
+ ret = libxlDoMigrateSend(driver, vm, props, sockfd);
- ret = libxlDoMigrateSrcSend(driver, vm, flags, sockfd);
+ ret = libxlDoMigrateSrcSend(driver, vm, props, sockfd);
virObjectLock(vm);
if (ret < 0)
Index: libvirt-4.1.0/src/libxl/libxl_migration.h
Index: libvirt-4.2.0/src/libxl/libxl_migration.h
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_migration.h
+++ libvirt-4.1.0/src/libxl/libxl_migration.h
--- libvirt-4.2.0.orig/src/libxl/libxl_migration.h
+++ libvirt-4.2.0/src/libxl/libxl_migration.h
@@ -39,6 +39,10 @@
VIR_MIGRATE_PARAM_URI, VIR_TYPED_PARAM_STRING, \
VIR_MIGRATE_PARAM_DEST_NAME, VIR_TYPED_PARAM_STRING, \
@ -278,9 +278,9 @@ Index: libvirt-4.1.0/src/libxl/libxl_migration.h
NULL
char *
@@ -70,6 +74,14 @@ libxlDomainMigrationPrepare(virConnectPt
int cookieinlen,
unsigned int flags);
@@ -70,6 +74,14 @@ libxlDomainMigrationDstPrepare(virConnec
int cookieinlen,
unsigned int flags);
+typedef struct {
+ unsigned int virFlags;
@ -291,31 +291,31 @@ Index: libvirt-4.1.0/src/libxl/libxl_migration.h
+} libxlDomainMigrationProps;
+
int
libxlDomainMigrationPerformP2P(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
@@ -78,7 +90,7 @@ libxlDomainMigrationPerformP2P(libxlDriv
libxlDomainMigrationSrcPerformP2P(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
@@ -78,7 +90,7 @@ libxlDomainMigrationSrcPerformP2P(libxlD
const char *dconnuri,
const char *uri_str,
const char *dname,
- unsigned int flags);
+ const libxlDomainMigrationProps *props);
int
libxlDomainMigrationSrcPerform(libxlDriverPrivatePtr driver,
@@ -87,7 +99,7 @@ libxlDomainMigrationSrcPerform(libxlDriv
const char *dconnuri,
const char *uri_str,
const char *dname,
- unsigned int flags);
+ const libxlDomainMigrationProps *props);
int
libxlDomainMigrationPerform(libxlDriverPrivatePtr driver,
@@ -87,7 +99,7 @@ libxlDomainMigrationPerform(libxlDriverP
const char *dconnuri,
const char *uri_str,
const char *dname,
- unsigned int flags);
+ const libxlDomainMigrationProps *props);
virDomainPtr
libxlDomainMigrationFinish(virConnectPtr dconn,
Index: libvirt-4.1.0/tools/virsh-domain.c
libxlDomainMigrationDstFinish(virConnectPtr dconn,
Index: libvirt-4.2.0/tools/virsh-domain.c
===================================================================
--- libvirt-4.1.0.orig/tools/virsh-domain.c
+++ libvirt-4.1.0/tools/virsh-domain.c
@@ -10540,6 +10540,22 @@ static const vshCmdOptDef opts_migrate[]
--- libvirt-4.2.0.orig/tools/virsh-domain.c
+++ libvirt-4.2.0/tools/virsh-domain.c
@@ -10545,6 +10545,22 @@ static const vshCmdOptDef opts_migrate[]
.type = VSH_OT_BOOL,
.help = N_("use TLS for migration")
},
@ -338,7 +338,7 @@ Index: libvirt-4.1.0/tools/virsh-domain.c
{.name = NULL}
};
@@ -10563,6 +10579,7 @@ doMigrate(void *opaque)
@@ -10568,6 +10584,7 @@ doMigrate(void *opaque)
unsigned long long ullOpt = 0;
int rv;
virConnectPtr dconn = data->dconn;
@ -346,7 +346,7 @@ Index: libvirt-4.1.0/tools/virsh-domain.c
sigemptyset(&sigmask);
sigaddset(&sigmask, SIGINT);
@@ -10682,6 +10699,27 @@ doMigrate(void *opaque)
@@ -10687,6 +10704,27 @@ doMigrate(void *opaque)
goto save_error;
}
@ -374,11 +374,11 @@ Index: libvirt-4.1.0/tools/virsh-domain.c
if (vshCommandOptStringReq(ctl, cmd, "xml", &opt) < 0)
goto out;
if (opt) {
Index: libvirt-4.1.0/tools/virsh.pod
Index: libvirt-4.2.0/tools/virsh.pod
===================================================================
--- libvirt-4.1.0.orig/tools/virsh.pod
+++ libvirt-4.1.0/tools/virsh.pod
@@ -1849,6 +1849,14 @@ Providing I<--tls> causes the migration
--- libvirt-4.2.0.orig/tools/virsh.pod
+++ libvirt-4.2.0/tools/virsh.pod
@@ -1850,6 +1850,14 @@ Providing I<--tls> causes the migration
the migration of the domain. Usage requires proper TLS setup for both source
and target.

View File

@ -7,10 +7,10 @@ and npiv.
For more details, see bsc#954872 and FATE#319810
Index: libvirt-4.1.0/src/libxl/libxl_conf.c
Index: libvirt-4.2.0/src/libxl/libxl_conf.c
===================================================================
--- libvirt-4.1.0.orig/src/libxl/libxl_conf.c
+++ libvirt-4.1.0/src/libxl/libxl_conf.c
--- libvirt-4.2.0.orig/src/libxl/libxl_conf.c
+++ libvirt-4.2.0/src/libxl/libxl_conf.c
@@ -771,6 +771,25 @@ libxlDiskSetDiscard(libxl_device_disk *x
#endif
}

View File

@ -13,10 +13,10 @@ device with the same name that is being created.
src/lxc/lxc_process.c | 1 +
3 files changed, 4 insertions(+)
Index: libvirt-4.1.0/src/lxc/lxc_controller.c
Index: libvirt-4.2.0/src/lxc/lxc_controller.c
===================================================================
--- libvirt-4.1.0.orig/src/lxc/lxc_controller.c
+++ libvirt-4.1.0/src/lxc/lxc_controller.c
--- libvirt-4.2.0.orig/src/lxc/lxc_controller.c
+++ libvirt-4.2.0/src/lxc/lxc_controller.c
@@ -73,6 +73,7 @@
#include "rpc/virnetdaemon.h"
#include "virstring.h"
@ -33,10 +33,10 @@ Index: libvirt-4.1.0/src/lxc/lxc_controller.c
return ret;
}
Index: libvirt-4.1.0/src/lxc/lxc_driver.c
Index: libvirt-4.2.0/src/lxc/lxc_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/lxc/lxc_driver.c
+++ libvirt-4.1.0/src/lxc/lxc_driver.c
--- libvirt-4.2.0.orig/src/lxc/lxc_driver.c
+++ libvirt-4.2.0/src/lxc/lxc_driver.c
@@ -75,6 +75,7 @@
#include "virtime.h"
#include "virtypedparam.h"
@ -45,7 +45,7 @@ Index: libvirt-4.1.0/src/lxc/lxc_driver.c
#include "virstring.h"
#include "viraccessapicheck.h"
#include "viraccessapichecklxc.h"
@@ -4021,6 +4022,7 @@ lxcDomainAttachDeviceNetLive(virConnectP
@@ -4035,6 +4036,7 @@ lxcDomainAttachDeviceNetLive(virConnectP
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_ETHERNET:
ignore_value(virNetDevVethDelete(veth));
@ -53,7 +53,7 @@ Index: libvirt-4.1.0/src/lxc/lxc_driver.c
break;
case VIR_DOMAIN_NET_TYPE_DIRECT:
@@ -4464,6 +4466,7 @@ lxcDomainDetachDeviceNetLive(virDomainOb
@@ -4478,6 +4480,7 @@ lxcDomainDetachDeviceNetLive(virDomainOb
virDomainAuditNet(vm, detach, NULL, "detach", false);
goto cleanup;
}
@ -61,10 +61,10 @@ Index: libvirt-4.1.0/src/lxc/lxc_driver.c
break;
/* It'd be nice to support this, but with macvlan
Index: libvirt-4.1.0/src/lxc/lxc_process.c
Index: libvirt-4.2.0/src/lxc/lxc_process.c
===================================================================
--- libvirt-4.1.0.orig/src/lxc/lxc_process.c
+++ libvirt-4.1.0/src/lxc/lxc_process.c
--- libvirt-4.2.0.orig/src/lxc/lxc_process.c
+++ libvirt-4.2.0/src/lxc/lxc_process.c
@@ -51,6 +51,7 @@
#include "viratomic.h"
#include "virprocess.h"

View File

@ -17,10 +17,10 @@ Signed-off-by: Martin Wilck <mwilck@suse.com>
tests/networkxml2confdata/dhcp6host-routed-network.conf | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
Index: libvirt-4.1.0/src/network/bridge_driver.c
Index: libvirt-4.2.0/src/network/bridge_driver.c
===================================================================
--- libvirt-4.1.0.orig/src/network/bridge_driver.c
+++ libvirt-4.1.0/src/network/bridge_driver.c
--- libvirt-4.2.0.orig/src/network/bridge_driver.c
+++ libvirt-4.2.0/src/network/bridge_driver.c
@@ -1470,7 +1470,14 @@ networkDnsmasqConfContents(virNetworkObj
if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) {
if (ipdef->nranges || ipdef->nhosts) {
@ -37,10 +37,10 @@ Index: libvirt-4.1.0/src/network/bridge_driver.c
}
if (ipdef->tftproot) {
Index: libvirt-4.1.0/tests/networkxml2confdata/dhcp6host-routed-network.conf
Index: libvirt-4.2.0/tests/networkxml2confdata/dhcp6host-routed-network.conf
===================================================================
--- libvirt-4.1.0.orig/tests/networkxml2confdata/dhcp6host-routed-network.conf
+++ libvirt-4.1.0/tests/networkxml2confdata/dhcp6host-routed-network.conf
--- libvirt-4.2.0.orig/tests/networkxml2confdata/dhcp6host-routed-network.conf
+++ libvirt-4.2.0/tests/networkxml2confdata/dhcp6host-routed-network.conf
@@ -10,7 +10,6 @@ bind-dynamic
interface=virbr1
dhcp-range=192.168.122.1,static

View File

@ -2,10 +2,10 @@ Canonicalize hostarch name ppc64le to ppc64
See bnc#894956
Index: libvirt-4.1.0/src/util/virarch.c
Index: libvirt-4.2.0/src/util/virarch.c
===================================================================
--- libvirt-4.1.0.orig/src/util/virarch.c
+++ libvirt-4.1.0/src/util/virarch.c
--- libvirt-4.2.0.orig/src/util/virarch.c
+++ libvirt-4.2.0/src/util/virarch.c
@@ -169,6 +169,8 @@ virArch virArchFromHost(void)
arch = VIR_ARCH_I686;
} else if (STREQ(ut.machine, "amd64")) {

View File

@ -1,11 +1,11 @@
Index: libvirt-4.1.0/examples/apparmor/libvirt-qemu
Index: libvirt-4.2.0/examples/apparmor/libvirt-qemu
===================================================================
--- libvirt-4.1.0.orig/examples/apparmor/libvirt-qemu
+++ libvirt-4.1.0/examples/apparmor/libvirt-qemu
@@ -193,3 +193,6 @@
# silence refusals to open lttng files (see LP: #1432644)
deny /dev/shm/lttng-ust-wait-* r,
deny /run/shm/lttng-ust-wait-* r,
--- libvirt-4.2.0.orig/examples/apparmor/libvirt-qemu
+++ libvirt-4.2.0/examples/apparmor/libvirt-qemu
@@ -197,3 +197,6 @@
# required for sasl GSSAPI plugin
/etc/gss/mech.d/ r,
/etc/gss/mech.d/* r,
+
+ # Temporary screendump rule -- See bsc#904426
+ /var/cache/libvirt/qemu/qemu.screendump.* rw,

View File

@ -8,10 +8,10 @@ Subject: [PATCH] support managed pci devices in xen driver
src/xenxs/xen_xm.c | 28 +++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 15 deletions(-)
Index: libvirt-4.1.0/src/xenconfig/xen_common.c
Index: libvirt-4.2.0/src/xenconfig/xen_common.c
===================================================================
--- libvirt-4.1.0.orig/src/xenconfig/xen_common.c
+++ libvirt-4.1.0/src/xenconfig/xen_common.c
--- libvirt-4.2.0.orig/src/xenconfig/xen_common.c
+++ libvirt-4.2.0/src/xenconfig/xen_common.c
@@ -394,6 +394,8 @@ xenParsePCI(virConfPtr conf, virDomainDe
{
virConfValuePtr list = virConfGetValue(conf, "pci");
@ -66,10 +66,10 @@ Index: libvirt-4.1.0/src/xenconfig/xen_common.c
hostdev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
hostdev->source.subsys.u.pci.addr.domain = domainID;
hostdev->source.subsys.u.pci.addr.bus = busID;
Index: libvirt-4.1.0/src/xenconfig/xen_sxpr.c
Index: libvirt-4.2.0/src/xenconfig/xen_sxpr.c
===================================================================
--- libvirt-4.1.0.orig/src/xenconfig/xen_sxpr.c
+++ libvirt-4.1.0/src/xenconfig/xen_sxpr.c
--- libvirt-4.2.0.orig/src/xenconfig/xen_sxpr.c
+++ libvirt-4.2.0/src/xenconfig/xen_sxpr.c
@@ -1057,6 +1057,7 @@ xenParseSxprPCI(virDomainDefPtr def,
int busID;
int slotID;

View File

@ -8,10 +8,10 @@ It was also noticed that the per-domain profiles need a libnl rule
to squelch a denial when starting confined domains.
Found while investigating bsc#1058847
Index: libvirt-4.1.0/examples/apparmor/usr.lib.libvirt.virt-aa-helper
Index: libvirt-4.2.0/examples/apparmor/usr.lib.libvirt.virt-aa-helper
===================================================================
--- libvirt-4.1.0.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper
+++ libvirt-4.1.0/examples/apparmor/usr.lib.libvirt.virt-aa-helper
--- libvirt-4.2.0.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper
+++ libvirt-4.2.0/examples/apparmor/usr.lib.libvirt.virt-aa-helper
@@ -17,7 +17,7 @@ profile virt-aa-helper /usr/{lib,lib64}/
owner @{PROC}/[0-9]*/status r,
@{PROC}/filesystems r,
@ -21,10 +21,10 @@ Index: libvirt-4.1.0/examples/apparmor/usr.lib.libvirt.virt-aa-helper
# for hostdev
/sys/devices/ r,
Index: libvirt-4.1.0/examples/apparmor/libvirt-qemu
Index: libvirt-4.2.0/examples/apparmor/libvirt-qemu
===================================================================
--- libvirt-4.1.0.orig/examples/apparmor/libvirt-qemu
+++ libvirt-4.1.0/examples/apparmor/libvirt-qemu
--- libvirt-4.2.0.orig/examples/apparmor/libvirt-qemu
+++ libvirt-4.2.0/examples/apparmor/libvirt-qemu
@@ -62,6 +62,7 @@
#/dev/fb* rw,

View File

@ -1,9 +1,9 @@
Adjust libvirt-guests service to conform to SUSE standards
Index: libvirt-4.1.0/tools/libvirt-guests.init.in
Index: libvirt-4.2.0/tools/libvirt-guests.init.in
===================================================================
--- libvirt-4.1.0.orig/tools/libvirt-guests.init.in
+++ libvirt-4.1.0/tools/libvirt-guests.init.in
--- libvirt-4.2.0.orig/tools/libvirt-guests.init.in
+++ libvirt-4.2.0/tools/libvirt-guests.init.in
@@ -4,27 +4,27 @@
# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
#
@ -46,10 +46,10 @@ Index: libvirt-4.1.0/tools/libvirt-guests.init.in
+
exec @libexecdir@/libvirt-guests.sh "$@"
Index: libvirt-4.1.0/tools/libvirt-guests.sh.in
Index: libvirt-4.2.0/tools/libvirt-guests.sh.in
===================================================================
--- libvirt-4.1.0.orig/tools/libvirt-guests.sh.in
+++ libvirt-4.1.0/tools/libvirt-guests.sh.in
--- libvirt-4.2.0.orig/tools/libvirt-guests.sh.in
+++ libvirt-4.2.0/tools/libvirt-guests.sh.in
@@ -16,14 +16,13 @@
# License along with this library. If not, see
# <http://www.gnu.org/licenses/>.
@ -209,10 +209,10 @@ Index: libvirt-4.1.0/tools/libvirt-guests.sh.in
esac
-exit $RETVAL
+rc_exit
Index: libvirt-4.1.0/tools/libvirt-guests.sysconf
Index: libvirt-4.2.0/tools/libvirt-guests.sysconf
===================================================================
--- libvirt-4.1.0.orig/tools/libvirt-guests.sysconf
+++ libvirt-4.1.0/tools/libvirt-guests.sysconf
--- libvirt-4.2.0.orig/tools/libvirt-guests.sysconf
+++ libvirt-4.2.0/tools/libvirt-guests.sysconf
@@ -1,19 +1,29 @@
+## Path: System/Virtualization/libvirt-guests
+

View File

@ -3,10 +3,10 @@ Disable TLS by default
On SUSE distros, the default is for libvirtd to listen only on the
Unix Domain Socket. The libvirt client still provides remote access
via a SSH tunnel.
Index: libvirt-4.1.0/src/remote/libvirtd.conf
Index: libvirt-4.2.0/src/remote/libvirtd.conf
===================================================================
--- libvirt-4.1.0.orig/src/remote/libvirtd.conf
+++ libvirt-4.1.0/src/remote/libvirtd.conf
--- libvirt-4.2.0.orig/src/remote/libvirtd.conf
+++ libvirt-4.2.0/src/remote/libvirtd.conf
@@ -18,8 +18,8 @@
# It is necessary to setup a CA and issue server certificates before
# using this capability.
@ -18,10 +18,10 @@ Index: libvirt-4.1.0/src/remote/libvirtd.conf
# Listen for unencrypted TCP connections on the public TCP/IP port.
# NB, must pass the --listen flag to the libvirtd process for this to
Index: libvirt-4.1.0/src/remote/remote_daemon_config.c
Index: libvirt-4.2.0/src/remote/remote_daemon_config.c
===================================================================
--- libvirt-4.1.0.orig/src/remote/remote_daemon_config.c
+++ libvirt-4.1.0/src/remote/remote_daemon_config.c
--- libvirt-4.2.0.orig/src/remote/remote_daemon_config.c
+++ libvirt-4.2.0/src/remote/remote_daemon_config.c
@@ -110,7 +110,7 @@ daemonConfigNew(bool privileged ATTRIBUT
if (VIR_ALLOC(data) < 0)
return NULL;
@ -31,10 +31,10 @@ Index: libvirt-4.1.0/src/remote/remote_daemon_config.c
data->listen_tcp = 0;
if (VIR_STRDUP(data->tls_port, LIBVIRTD_TLS_PORT) < 0 ||
Index: libvirt-4.1.0/src/remote/test_libvirtd.aug.in
Index: libvirt-4.2.0/src/remote/test_libvirtd.aug.in
===================================================================
--- libvirt-4.1.0.orig/src/remote/test_libvirtd.aug.in
+++ libvirt-4.1.0/src/remote/test_libvirtd.aug.in
--- libvirt-4.2.0.orig/src/remote/test_libvirtd.aug.in
+++ libvirt-4.2.0/src/remote/test_libvirtd.aug.in
@@ -2,7 +2,7 @@ module Test_libvirtd =
::CONFIG::

View File

@ -7,10 +7,10 @@ On SUSE distros, we promote libvirt and all the libvirt-based
tools. If a user installs libvirt on their SUSE Xen host, then
libvirt should be king and override xendomains. See bsc#1015348
Index: libvirt-4.1.0/src/remote/libvirtd.service.in
Index: libvirt-4.2.0/src/remote/libvirtd.service.in
===================================================================
--- libvirt-4.1.0.orig/src/remote/libvirtd.service.in
+++ libvirt-4.1.0/src/remote/libvirtd.service.in
--- libvirt-4.2.0.orig/src/remote/libvirtd.service.in
+++ libvirt-4.2.0/src/remote/libvirtd.service.in
@@ -16,6 +16,8 @@ After=apparmor.service
After=local-fs.target
After=remote-fs.target

View File

@ -1,9 +1,9 @@
Adjust libvirtd sysconfig file to conform to SUSE standards
Index: libvirt-4.1.0/src/remote/libvirtd.sysconf
Index: libvirt-4.2.0/src/remote/libvirtd.sysconf
===================================================================
--- libvirt-4.1.0.orig/src/remote/libvirtd.sysconf
+++ libvirt-4.1.0/src/remote/libvirtd.sysconf
--- libvirt-4.2.0.orig/src/remote/libvirtd.sysconf
+++ libvirt-4.2.0/src/remote/libvirtd.sysconf
@@ -1,16 +1,25 @@
+## Path: System/Virtualization/libvirt
+

View File

@ -1,9 +1,9 @@
Adjust paths of OVMF firmwares on SUSE distros
Index: libvirt-4.1.0/src/qemu/qemu.conf
Index: libvirt-4.2.0/src/qemu/qemu.conf
===================================================================
--- libvirt-4.1.0.orig/src/qemu/qemu.conf
+++ libvirt-4.1.0/src/qemu/qemu.conf
--- libvirt-4.2.0.orig/src/qemu/qemu.conf
+++ libvirt-4.2.0/src/qemu/qemu.conf
@@ -743,10 +743,9 @@ security_default_confined = 0
# for x86_64 and i686, but it's AAVMF for aarch64. The libvirt default
# follows this scheme.
@ -18,10 +18,10 @@ Index: libvirt-4.1.0/src/qemu/qemu.conf
#]
# The backend to use for handling stdout/stderr output from
Index: libvirt-4.1.0/src/qemu/qemu_conf.c
Index: libvirt-4.2.0/src/qemu/qemu_conf.c
===================================================================
--- libvirt-4.1.0.orig/src/qemu/qemu_conf.c
+++ libvirt-4.1.0/src/qemu/qemu_conf.c
--- libvirt-4.2.0.orig/src/qemu/qemu_conf.c
+++ libvirt-4.2.0/src/qemu/qemu_conf.c
@@ -127,10 +127,9 @@ void qemuDomainCmdlineDefFree(qemuDomain
#ifndef DEFAULT_LOADER_NVRAM

View File

@ -7,10 +7,10 @@ suse-qemu-conf-secdriver.patch, suse-qemu-conf-lockmgr.patch,
etc.), but for now they are all lumped together in this
single patch.
Index: libvirt-4.1.0/src/qemu/qemu.conf
Index: libvirt-4.2.0/src/qemu/qemu.conf
===================================================================
--- libvirt-4.1.0.orig/src/qemu/qemu.conf
+++ libvirt-4.1.0/src/qemu/qemu.conf
--- libvirt-4.2.0.orig/src/qemu/qemu.conf
+++ libvirt-4.2.0/src/qemu/qemu.conf
@@ -380,11 +380,20 @@
# isolation, but it cannot appear in a list of drivers.
#

View File

@ -1,9 +1,9 @@
Adjust virtlockd sysconfig file to conform to SUSE standards
Index: libvirt-4.1.0/src/locking/virtlockd.sysconf
Index: libvirt-4.2.0/src/locking/virtlockd.sysconf
===================================================================
--- libvirt-4.1.0.orig/src/locking/virtlockd.sysconf
+++ libvirt-4.1.0/src/locking/virtlockd.sysconf
--- libvirt-4.2.0.orig/src/locking/virtlockd.sysconf
+++ libvirt-4.2.0/src/locking/virtlockd.sysconf
@@ -1,3 +1,7 @@
+## Path: System/Virtualization/virtlockd
+

View File

@ -1,9 +1,9 @@
Adjust virtlogd sysconfig file to conform to SUSE standards
Index: libvirt-4.1.0/src/logging/virtlogd.sysconf
Index: libvirt-4.2.0/src/logging/virtlogd.sysconf
===================================================================
--- libvirt-4.1.0.orig/src/logging/virtlogd.sysconf
+++ libvirt-4.1.0/src/logging/virtlogd.sysconf
--- libvirt-4.2.0.orig/src/logging/virtlogd.sysconf
+++ libvirt-4.2.0/src/logging/virtlogd.sysconf
@@ -1,3 +1,7 @@
+## Path: System/Virtualization/virtlogd
+

View File

@ -1,7 +1,7 @@
Index: libvirt-4.1.0/src/xenconfig/xen_sxpr.c
Index: libvirt-4.2.0/src/xenconfig/xen_sxpr.c
===================================================================
--- libvirt-4.1.0.orig/src/xenconfig/xen_sxpr.c
+++ libvirt-4.1.0/src/xenconfig/xen_sxpr.c
--- libvirt-4.2.0.orig/src/xenconfig/xen_sxpr.c
+++ libvirt-4.2.0/src/xenconfig/xen_sxpr.c
@@ -387,7 +387,7 @@ xenParseSxprVifRate(const char *rate, un
static int
xenParseSxprDisks(virDomainDefPtr def,

View File

@ -6,10 +6,10 @@ and 'file'. This was implicitly done prior to commit 9673418c.
https://bugzilla.suse.com/show_bug.cgi?id=938228
Index: libvirt-4.1.0/src/xenconfig/xen_sxpr.c
Index: libvirt-4.2.0/src/xenconfig/xen_sxpr.c
===================================================================
--- libvirt-4.1.0.orig/src/xenconfig/xen_sxpr.c
+++ libvirt-4.1.0/src/xenconfig/xen_sxpr.c
--- libvirt-4.2.0.orig/src/xenconfig/xen_sxpr.c
+++ libvirt-4.2.0/src/xenconfig/xen_sxpr.c
@@ -501,10 +501,11 @@ xenParseSxprDisks(virDomainDefPtr def,
omnipotent, we can revisit this, perhaps stat()'ing
the src file in question */