From 9462ef64850052b070d1987a84af240f07e8a776bfb695441fd6dca61f2ea003 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 5 Apr 2018 21:47:55 +0000 Subject: [PATCH] Accepting request 593871 from home:jfehlig:branches:Virtualization - util: improvements in error handling 09877303-virSocketAddrParseInternal.patch, 412afdb8-intro-virSocketAddrParseAny.patch bsc#1080957 - 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 OBS-URL: https://build.opensuse.org/request/show/593871 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=683 --- ...stats-functions-from-the-qemu-driver.patch | 79 +- ...c-implement-connectGetAllDomainStats.patch | 10 +- 06e7ebb6-rpc-invoke-dispatch-unlocked.patch | 237 ----- 09877303-virSocketAddrParseInternal.patch | 23 + 13e81fc6-libxl-EndJob-on-error.patch | 25 - 33c6eb96-fix-libvirtd-reload-deadlock.patch | 115 -- 3c89868c-libxl-lock-after-ListRemove.patch | 132 --- 412afdb8-intro-virSocketAddrParseAny.patch | 159 +++ 464889ff-rpc-aquire-ref-dispatch.patch | 49 - ...-libxl-libxlDomObjFromDomain-cleanup.patch | 269 ----- ...b99-libxl-DefineXMLFlags-API-pattern.patch | 43 - 60b3fcd9-libxl-MigratePrepare.patch | 74 -- 64370c4b-libxl-MigrateBegin.patch | 82 -- 6b3d716e-keycodemap-py3.patch | 94 -- ...f44-libxl-dont-hardcode-sched-weight.patch | 265 ----- 86cae503-rpc-fix-pre-exec.patch | 40 - 99486799-libxl-MigrateConfirm.patch | 75 -- apibuild-py3.patch | 989 ------------------ apparmor-no-mount.patch | 6 +- blockcopy-check-dst-identical-device.patch | 8 +- c66e344e-libxl-dont-deref-NULL.patch | 30 - c6f1d519-rpc-simplify-dispatch.patch | 117 --- ...rpc-virtlockd-virtlogd-single-thread.patch | 66 -- f5eacf2a-libxl-MigratePerform.patch | 27 - fb327ac2-virtlockd-admin-socket.patch | 29 - fbf31e1a-CVE-2018-1064.patch | 51 - fe51dbda-libxl-use-FindByRef.patch | 60 -- libvirt-4.1.0.tar.xz | 3 - libvirt-4.1.0.tar.xz.asc | 10 - libvirt-4.2.0.tar.xz | 3 + libvirt-4.2.0.tar.xz.asc | 10 + libvirt-power8-models.patch | 6 +- libvirt-suse-netcontrol.patch | 80 +- libvirt.changes | 37 + libvirt.spec | 48 +- libxl-dom-reset.patch | 8 +- libxl-qemu-emulator-caps.patch | 6 +- libxl-set-cach-mode.patch | 6 +- libxl-set-migration-constraints.patch | 200 ++-- libxl-support-block-script.patch | 6 +- lxc-wait-after-eth-del.patch | 22 +- ...e-dhcp-authoritative-on-static-netwo.patch | 12 +- ppc64le-canonical-name.patch | 6 +- qemu-apparmor-screenshot.patch | 14 +- support-managed-pci-xen-driver.patch | 12 +- suse-apparmor-libnl-paths.patch | 12 +- suse-libvirt-guests-service.patch | 18 +- suse-libvirtd-disable-tls.patch | 18 +- suse-libvirtd-service-xen.patch | 6 +- suse-libvirtd-sysconfig-settings.patch | 6 +- suse-ovmf-paths.patch | 12 +- suse-qemu-conf.patch | 6 +- suse-virtlockd-sysconfig-settings.patch | 6 +- suse-virtlogd-sysconfig-settings.patch | 6 +- xen-pv-cdrom.patch | 6 +- xen-sxpr-disk-type.patch | 6 +- 56 files changed, 526 insertions(+), 3219 deletions(-) delete mode 100644 06e7ebb6-rpc-invoke-dispatch-unlocked.patch create mode 100644 09877303-virSocketAddrParseInternal.patch delete mode 100644 13e81fc6-libxl-EndJob-on-error.patch delete mode 100644 33c6eb96-fix-libvirtd-reload-deadlock.patch delete mode 100644 3c89868c-libxl-lock-after-ListRemove.patch create mode 100644 412afdb8-intro-virSocketAddrParseAny.patch delete mode 100644 464889ff-rpc-aquire-ref-dispatch.patch delete mode 100644 4e6fcdb6-libxl-libxlDomObjFromDomain-cleanup.patch delete mode 100644 594b8b99-libxl-DefineXMLFlags-API-pattern.patch delete mode 100644 60b3fcd9-libxl-MigratePrepare.patch delete mode 100644 64370c4b-libxl-MigrateBegin.patch delete mode 100644 6b3d716e-keycodemap-py3.patch delete mode 100644 83edaf44-libxl-dont-hardcode-sched-weight.patch delete mode 100644 86cae503-rpc-fix-pre-exec.patch delete mode 100644 99486799-libxl-MigrateConfirm.patch delete mode 100644 apibuild-py3.patch delete mode 100644 c66e344e-libxl-dont-deref-NULL.patch delete mode 100644 c6f1d519-rpc-simplify-dispatch.patch delete mode 100644 eefabb38-rpc-virtlockd-virtlogd-single-thread.patch delete mode 100644 f5eacf2a-libxl-MigratePerform.patch delete mode 100644 fb327ac2-virtlockd-admin-socket.patch delete mode 100644 fbf31e1a-CVE-2018-1064.patch delete mode 100644 fe51dbda-libxl-use-FindByRef.patch delete mode 100644 libvirt-4.1.0.tar.xz delete mode 100644 libvirt-4.1.0.tar.xz.asc create mode 100644 libvirt-4.2.0.tar.xz create mode 100644 libvirt-4.2.0.tar.xz.asc diff --git a/0001-Extract-stats-functions-from-the-qemu-driver.patch b/0001-Extract-stats-functions-from-the-qemu-driver.patch index 6b54edc..b8297e9 100644 --- a/0001-Extract-stats-functions-from-the-qemu-driver.patch +++ b/0001-Extract-stats-functions-from-the-qemu-driver.patch @@ -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 \ diff --git a/0002-lxc-implement-connectGetAllDomainStats.patch b/0002-lxc-implement-connectGetAllDomainStats.patch index 3ce0a8e..c66b042 100644 --- a/0002-lxc-implement-connectGetAllDomainStats.patch +++ b/0002-lxc-implement-connectGetAllDomainStats.patch @@ -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 */ diff --git a/06e7ebb6-rpc-invoke-dispatch-unlocked.patch b/06e7ebb6-rpc-invoke-dispatch-unlocked.patch deleted file mode 100644 index 6521958..0000000 --- a/06e7ebb6-rpc-invoke-dispatch-unlocked.patch +++ /dev/null @@ -1,237 +0,0 @@ -commit 06e7ebb60894ab43b5224752514049c1a286ee06 -Author: Daniel P. Berrangé -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=) at util/virthread.c:89 - #3 0x000055a6628a984b in virObjectLock (anyobj=) 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=, events=1, opaque=0x55a663a7b960) - at rpc/virnetserverclient.c:1507 - #11 0x000055a662899be0 in virEventPollDispatchHandles (fds=0x55a663a7bdc0, nfds=) - 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=, - #argv=0x7ffd105b4838) at logging/log_daemon.c:1235 - - Reviewed-by: John Ferlan - Reviewed-by: Jim Fehlig - Signed-off-by: Daniel P. Berrangé - -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); - } - - diff --git a/09877303-virSocketAddrParseInternal.patch b/09877303-virSocketAddrParseInternal.patch new file mode 100644 index 0000000..8ba3aee --- /dev/null +++ b/09877303-virSocketAddrParseInternal.patch @@ -0,0 +1,23 @@ +commit 09877303014e0297d2c2707be5167d932cc3f425 +Author: Jim Fehlig +Date: Mon Mar 26 13:00:25 2018 -0600 + + util: honor reportError parameter in virSocketAddrParseInternal + + Signed-off-by: Jim Fehlig + Reviewed-by: John Ferlan + +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; + } + diff --git a/13e81fc6-libxl-EndJob-on-error.patch b/13e81fc6-libxl-EndJob-on-error.patch deleted file mode 100644 index 2907cef..0000000 --- a/13e81fc6-libxl-EndJob-on-error.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 13e81fc6fad03aa6b6ecf4230f44b2ea55078229 -Author: Jim Fehlig -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 - Reviewed-by: John Ferlan - -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; - } diff --git a/33c6eb96-fix-libvirtd-reload-deadlock.patch b/33c6eb96-fix-libvirtd-reload-deadlock.patch deleted file mode 100644 index 40251b1..0000000 --- a/33c6eb96-fix-libvirtd-reload-deadlock.patch +++ /dev/null @@ -1,115 +0,0 @@ -commit 33c6eb9689eb51dfe31dd05b24b3b6b1c948c267 -Author: Jim Fehlig -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 "