diff --git a/0001-libxl-add-support-for-BlockResize-API.patch b/0001-libxl-add-support-for-BlockResize-API.patch index 55ca2c0..9762c11 100644 --- a/0001-libxl-add-support-for-BlockResize-API.patch +++ b/0001-libxl-add-support-for-BlockResize-API.patch @@ -23,7 +23,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c =================================================================== --- libvirt-8.0.0.orig/src/libxl/libxl_driver.c +++ libvirt-8.0.0/src/libxl/libxl_driver.c -@@ -5241,6 +5241,95 @@ libxlDomainMemoryStats(virDomainPtr dom, +@@ -5264,6 +5264,95 @@ libxlDomainMemoryStats(virDomainPtr dom, #undef LIBXL_SET_MEMSTAT @@ -119,7 +119,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c static int libxlDomainGetJobInfo(virDomainPtr dom, virDomainJobInfoPtr info) -@@ -6554,6 +6643,7 @@ static virHypervisorDriver libxlHypervis +@@ -6577,6 +6666,7 @@ static virHypervisorDriver libxlHypervis .domainGetNumaParameters = libxlDomainGetNumaParameters, /* 1.1.1 */ .nodeGetFreeMemory = libxlNodeGetFreeMemory, /* 0.9.0 */ .nodeGetCellsFreeMemory = libxlNodeGetCellsFreeMemory, /* 1.1.1 */ diff --git a/e0241f33-libxl-mark-allocated-graphics-ports.patch b/e0241f33-libxl-mark-allocated-graphics-ports.patch new file mode 100644 index 0000000..3ce8ea4 --- /dev/null +++ b/e0241f33-libxl-mark-allocated-graphics-ports.patch @@ -0,0 +1,60 @@ +commit e0241f334d4e8da2e36cda48c225d5a6edcc3a50 +Author: Jim Fehlig +Date: Tue Feb 1 17:03:11 2022 -0700 + + libxl: Set auto-allocated graphics ports to used on reconnect + + The libxl driver reconnects to all running VMs when libvirtd is restarted, + but it failed to mark auto-allocated graphics ports as set in the port + allocator. If many VMs are running that use port auto-allocation and + libvirtd is restarted, the port allocator is likely to hand out a port + already in use when a new VM is created that uses auto-allocation. VM + creation will fail due to the port clash. + + When reconnecting to running VMs after a libvirtd restart, let the port + allocator know about previously allocated ports. + + Signed-off-by: Jim Fehlig + Reviewed-by: Ján Tomko + +Index: libvirt-8.0.0/src/libxl/libxl_driver.c +=================================================================== +--- libvirt-8.0.0.orig/src/libxl/libxl_driver.c ++++ libvirt-8.0.0/src/libxl/libxl_driver.c +@@ -393,6 +393,7 @@ libxlReconnectDomain(virDomainObj *vm, + virHostdevManager *hostdev_mgr = driver->hostdevMgr; + unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI; + int ret = -1; ++ size_t i; + + hostdev_flags |= VIR_HOSTDEV_SP_USB; + +@@ -447,6 +448,28 @@ libxlReconnectDomain(virDomainObj *vm, + + libxlReconnectNotifyNets(vm->def); + ++ /* Set any auto-allocated graphics ports to used */ ++ for (i = 0; i < vm->def->ngraphics; i++) { ++ virDomainGraphicsDef *graphics = vm->def->graphics[i]; ++ ++ switch (graphics->type) { ++ case VIR_DOMAIN_GRAPHICS_TYPE_VNC: ++ if (graphics->data.vnc.autoport) ++ virPortAllocatorSetUsed(graphics->data.vnc.port); ++ break; ++ case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: ++ if (graphics->data.spice.autoport) ++ virPortAllocatorSetUsed(graphics->data.spice.port); ++ break; ++ case VIR_DOMAIN_GRAPHICS_TYPE_SDL: ++ case VIR_DOMAIN_GRAPHICS_TYPE_RDP: ++ case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP: ++ case VIR_DOMAIN_GRAPHICS_TYPE_EGL_HEADLESS: ++ case VIR_DOMAIN_GRAPHICS_TYPE_LAST: ++ break; ++ } ++ } ++ + if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) + VIR_WARN("Cannot update XML for running Xen guest %s", vm->def->name); + diff --git a/libvirt.changes b/libvirt.changes index 6a41f5b..a8432d2 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Feb 7 21:32:20 UTC 2022 - James Fehlig + +- libxl: Mark auto-allocated graphics ports to used on reconnect + e0241f33-libxl-mark-allocated-graphics-ports.patch + bsc#1191668 + ------------------------------------------------------------------- Wed Jan 26 19:13:24 UTC 2022 - James Fehlig diff --git a/libvirt.spec b/libvirt.spec index 3d7afde..84fe889 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -306,6 +306,7 @@ Patch1: 16172741-libvirt-guests-manpage.patch Patch2: 8eb44616-remove-sysconfig-files.patch Patch3: 31e937fb-libxl-save-lock-indicator.patch Patch4: 105dace2-revert-virProcessGetStatInfo.patch +Patch5: e0241f33-libxl-mark-allocated-graphics-ports.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch diff --git a/libxl-dom-reset.patch b/libxl-dom-reset.patch index b034d2c..4896174 100644 --- a/libxl-dom-reset.patch +++ b/libxl-dom-reset.patch @@ -12,7 +12,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c =================================================================== --- libvirt-8.0.0.orig/src/libxl/libxl_driver.c +++ libvirt-8.0.0/src/libxl/libxl_driver.c -@@ -1338,6 +1338,63 @@ libxlDomainReboot(virDomainPtr dom, unsi +@@ -1361,6 +1361,63 @@ libxlDomainReboot(virDomainPtr dom, unsi } static int @@ -76,7 +76,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c libxlDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { -@@ -6432,6 +6489,7 @@ static virHypervisorDriver libxlHypervis +@@ -6455,6 +6512,7 @@ static virHypervisorDriver libxlHypervis .domainShutdown = libxlDomainShutdown, /* 0.9.0 */ .domainShutdownFlags = libxlDomainShutdownFlags, /* 0.9.10 */ .domainReboot = libxlDomainReboot, /* 0.9.0 */ diff --git a/libxl-set-migration-constraints.patch b/libxl-set-migration-constraints.patch index 6546950..28236ae 100644 --- a/libxl-set-migration-constraints.patch +++ b/libxl-set-migration-constraints.patch @@ -75,7 +75,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c =================================================================== --- libvirt-8.0.0.orig/src/libxl/libxl_driver.c +++ libvirt-8.0.0/src/libxl/libxl_driver.c -@@ -5973,6 +5973,9 @@ libxlDomainMigratePerform3Params(virDoma +@@ -5996,6 +5996,9 @@ libxlDomainMigratePerform3Params(virDoma const char *dname = NULL; const char *uri = NULL; int ret = -1; @@ -85,7 +85,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME virReportUnsupportedError(); -@@ -5989,6 +5992,15 @@ libxlDomainMigratePerform3Params(virDoma +@@ -6012,6 +6015,15 @@ libxlDomainMigratePerform3Params(virDoma virTypedParamsGetString(params, nparams, VIR_MIGRATE_PARAM_DEST_NAME, &dname) < 0 || @@ -101,7 +101,7 @@ Index: libvirt-8.0.0/src/libxl/libxl_driver.c virTypedParamsGetString(params, nparams, VIR_MIGRATE_PARAM_URI, &uri) < 0) -@@ -6003,11 +6015,11 @@ libxlDomainMigratePerform3Params(virDoma +@@ -6026,11 +6038,11 @@ libxlDomainMigratePerform3Params(virDoma if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) { if (libxlDomainMigrationSrcPerformP2P(driver, vm, dom->conn, dom_xml,