From efeb066606dcd8472a59912ba17c3237bec82477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 13 Jul 2024 05:21:30 +0200 Subject: [PATCH 1/4] Do not create vkb device for qubes-enabled HVM --- ...te-vkb-device-for-qubes-graphics-out.patch | 51 +++++++++++++++++++ libvirt.spec.in | 1 + 2 files changed, 52 insertions(+) create mode 100644 0024-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch diff --git a/0024-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch b/0024-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch new file mode 100644 index 0000000..5b8af6e --- /dev/null +++ b/0024-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch @@ -0,0 +1,51 @@ +From 93094ba9d1c79184ff0b0d3aa2a6a72a19c22152 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= + +Date: Sat, 13 Jul 2024 23:56:29 +0200 +Subject: [PATCH] libxl: don't create vkb device for qubes graphics output +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Qubes handles HID on its own, it doesn't use vkb device. + +Signed-off-by: Marek Marczykowski-Górecki +--- + src/libxl/libxl_conf.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c +index aa2062bef3..6e0cb7e0c9 100644 +--- a/src/libxl/libxl_conf.c ++++ b/src/libxl/libxl_conf.c +@@ -1640,6 +1640,7 @@ libxlMakeVfbList(virPortAllocatorRange *graphicsports, + { + virDomainGraphicsDef **l_vfbs = def->graphics; + int nvfbs = def->ngraphics; ++ int nvkbs = 0; + libxl_device_vfb *x_vfbs; + libxl_device_vkb *x_vkbs; + size_t i; +@@ -1651,7 +1652,8 @@ libxlMakeVfbList(virPortAllocatorRange *graphicsports, + x_vkbs = g_new0(libxl_device_vkb, nvfbs); + + for (i = 0; i < nvfbs; i++) { +- libxl_device_vkb_init(&x_vkbs[i]); ++ if (l_vfbs[i]->type != VIR_DOMAIN_GRAPHICS_TYPE_QUBES) ++ libxl_device_vkb_init(&x_vkbs[nvkbs++]); + + if (libxlMakeVfb(graphicsports, l_vfbs[i], &x_vfbs[i]) < 0) + goto error; +@@ -1659,7 +1661,8 @@ libxlMakeVfbList(virPortAllocatorRange *graphicsports, + + d_config->vfbs = x_vfbs; + d_config->vkbs = x_vkbs; +- d_config->num_vfbs = d_config->num_vkbs = nvfbs; ++ d_config->num_vfbs = nvfbs; ++ d_config->num_vkbs = nvkbs; + + return 0; + +-- +2.44.0 + diff --git a/libvirt.spec.in b/libvirt.spec.in index 42dfb8e..7ad3f19 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -301,6 +301,7 @@ Patch0020: 0020-libxl-adjust-ich6-sound-card-name.patch Patch0021: 0021-libxl-set-net-disk-trusted-parameter-based-on-backen.patch Patch0022: 0022-libxl-setup-shadow-memory-according-to-max-hotplug-m.patch Patch0023: 0023-Add-powerManagementFiltering-for-PCI-PM-control.patch +Patch0024: 0024-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch Requires: libvirt-daemon = %{epoch}:%{version}-%{release} %if %{with_network} From abdd546e5f64603bf6dd3ee484df9b59087e5136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 1 Aug 2024 17:02:25 +0200 Subject: [PATCH 2/4] Update to 10.5.0 6 patches are not needed anymore, rebase others. Update spec file based on libvirt-10.1.0-3.fc40.src, this includes libvirt-daemon split into libvirt-daemon + libvirt-daemon-common. For now disable 'ssh_proxy' feature directly in a configure call. At some point upstream spec will likely get proper with_ macros and maybe even another subpackage, but lets keep it simple until then. This also changes the download URL to download.libvirt.org. --- .qubesbuilder | 8 +- ...ript-attribute-to-disk-specification.patch | 22 +- 0002-libxl-use-disk-script-attribute.patch | 8 +- 0003-libxl-Stubdom-emulator-type.patch | 47 +- ...main-config-modification-in-virDomai.patch | 10 +- ...treset-attribute-to-PCI-host-devices.patch | 67 +- ...-stubdomain-if-any-while-pausing-a-d.patch | 16 +- ...round-for-missing-pcidev-group-assig.patch | 8 +- 0008-libxl-add-linux-stubdom-support.patch | 24 +- ...add-support-for-qubes-graphic-device.patch | 84 +- ...l-add-support-for-stubdom_mem-option.patch | 38 +- ...t-for-emulator-kernel-and-ramdisk-pa.patch | 46 +- ...libxl-Fix-setting-invtsc-in-Xen-4.14.patch | 8 +- ...distinct-error-on-unsupported-PM-sus.patch | 10 +- ...l-add-support-for-xengt-video-device.patch | 161 +- ...sk-trusted-parameter-based-on-backen.patch | 41 +- 0015-tests-Fix-libxlxml2domconfigtest.patch | 105 -- ...lace-meson.source_root-with-meson.pr.patch | 228 --- ...ow-memory-according-to-max-hotplug-m.patch | 12 +- ...nagementFiltering-for-PCI-PM-control.patch | 42 +- ...lace-external_program.path-with-exte.patch | 365 ---- ...lace-meson.build_root-with-meson.pro.patch | 277 --- ...te-vkb-device-for-qubes-graphics-out.patch | 12 +- ...-Bump-minimal-required-meson-version.patch | 48 - 0020-libxl-adjust-ich6-sound-card-name.patch | 54 - libvirt-python.spec.in | 11 +- libvirt.spec.in | 1506 ++++++++++------- version | 2 +- 28 files changed, 1241 insertions(+), 2019 deletions(-) rename 0021-libxl-set-net-disk-trusted-parameter-based-on-backen.patch => 0015-libxl-set-net-disk-trusted-parameter-based-on-backen.patch (90%) delete mode 100644 0015-tests-Fix-libxlxml2domconfigtest.patch delete mode 100644 0016-Revert-meson-Replace-meson.source_root-with-meson.pr.patch rename 0022-libxl-setup-shadow-memory-according-to-max-hotplug-m.patch => 0016-libxl-setup-shadow-memory-according-to-max-hotplug-m.patch (87%) rename 0023-Add-powerManagementFiltering-for-PCI-PM-control.patch => 0017-Add-powerManagementFiltering-for-PCI-PM-control.patch (83%) delete mode 100644 0017-Revert-meson-Replace-external_program.path-with-exte.patch delete mode 100644 0018-Revert-meson-Replace-meson.build_root-with-meson.pro.patch rename 0024-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch => 0018-libxl-don-t-create-vkb-device-for-qubes-graphics-out.patch (82%) delete mode 100644 0019-Revert-meson-Bump-minimal-required-meson-version.patch delete mode 100644 0020-libxl-adjust-ich6-sound-card-name.patch diff --git a/.qubesbuilder b/.qubesbuilder index 0a9d852..893c046 100644 --- a/.qubesbuilder +++ b/.qubesbuilder @@ -5,11 +5,11 @@ host: - libvirt-python.spec source: files: - - url: https://libvirt.org/sources/libvirt-@VERSION@.tar.xz - signature: https://libvirt.org/sources/libvirt-@VERSION@.tar.xz.asc + - url: https://download.libvirt.org/libvirt-@VERSION@.tar.xz + signature: https://download.libvirt.org/libvirt-@VERSION@.tar.xz.asc pubkeys: &id001 - redhat-jiri-denemark-key.asc - redhat-veillard-key.asc - - url: https://libvirt.org/sources/python/libvirt-python-@VERSION@.tar.gz - signature: https://libvirt.org/sources/python/libvirt-python-@VERSION@.tar.gz.asc + - url: https://download.libvirt.org/python/libvirt-python-@VERSION@.tar.gz + signature: https://download.libvirt.org/python/libvirt-python-@VERSION@.tar.gz.asc pubkeys: *id001 diff --git a/0001-conf-add-script-attribute-to-disk-specification.patch b/0001-conf-add-script-attribute-to-disk-specification.patch index 75eacf8..0dbcd1e 100644 --- a/0001-conf-add-script-attribute-to-disk-specification.patch +++ b/0001-conf-add-script-attribute-to-disk-specification.patch @@ -1,4 +1,4 @@ -From 8a2678d184a2a888a12a34370a255d69785a3779 Mon Sep 17 00:00:00 2001 +From 3afc6d4ba5838cf6cd2a31032442491401989094 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 5 Apr 2013 01:37:29 +0200 Subject: [PATCH] conf: add 'script' attribute to disk specification @@ -24,18 +24,18 @@ Signed-off-by: Marek Marczykowski-Górecki 3 files changed, 12 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 7dba65cfeb..93b411b96b 100644 +index cb1154b23f..bcc5e17204 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c -@@ -2287,6 +2287,7 @@ virDomainDiskDefFree(virDomainDiskDef *def) +@@ -2392,6 +2392,7 @@ virDomainDiskDefFree(virDomainDiskDef *def) g_free(def->domain_name); g_free(def->blkdeviotune.group_name); g_free(def->virtio); + g_free(def->script); virDomainDeviceInfoClear(&def->info); virObjectUnref(def->privateData); - -@@ -7927,6 +7928,7 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, + g_slist_free_full(def->iothreads, (GDestroyNotify) virDomainDiskIothreadDefFree); +@@ -8194,6 +8195,7 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, return NULL; def->domain_name = virXPathString("string(./backenddomain/@name)", ctxt); @@ -43,7 +43,7 @@ index 7dba65cfeb..93b411b96b 100644 def->serial = virXPathString("string(./serial)", ctxt); def->wwn = virXPathString("string(./wwn)", ctxt); def->vendor = virXPathString("string(./vendor)", ctxt); -@@ -22332,6 +22334,7 @@ virDomainDiskDefFormat(virBuffer *buf, +@@ -23016,6 +23018,7 @@ virDomainDiskDefFormat(virBuffer *buf, return -1; virBufferEscapeString(&childBuf, "\n", def->domain_name); @@ -52,10 +52,10 @@ index 7dba65cfeb..93b411b96b 100644 virDomainDiskGeometryDefFormat(&childBuf, def); virDomainDiskBlockIoDefFormat(&childBuf, def); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 8f8a54bc41..1d54075de3 100644 +index 2818a9f1f5..8f1245f202 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h -@@ -622,6 +622,7 @@ struct _virDomainDiskDef { +@@ -580,6 +580,7 @@ struct _virDomainDiskDef { unsigned int queue_size; virDomainDiskModel model; virDomainVirtioOptions *virtio; @@ -64,10 +64,10 @@ index 8f8a54bc41..1d54075de3 100644 bool diskElementAuth; bool diskElementEnc; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng -index d346442510..bdc0d4ff6d 100644 +index 844a931deb..faaf69bdee 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng -@@ -1518,6 +1518,14 @@ +@@ -1601,6 +1601,14 @@ @@ -83,5 +83,5 @@ index d346442510..bdc0d4ff6d 100644 -- -2.37.3 +2.45.2 diff --git a/0002-libxl-use-disk-script-attribute.patch b/0002-libxl-use-disk-script-attribute.patch index f9c8f5f..3152830 100644 --- a/0002-libxl-use-disk-script-attribute.patch +++ b/0002-libxl-use-disk-script-attribute.patch @@ -1,4 +1,4 @@ -From 84dc98be7c2821804cb5234e8e8827ff1407a1c6 Mon Sep 17 00:00:00 2001 +From afa10e786e8ebb608c39770637edf00a8a96a4d5 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 5 Apr 2013 01:41:04 +0200 Subject: [PATCH] libxl: use disk 'script' attribute @@ -18,10 +18,10 @@ Signed-off-by: Marek Marczykowski-Górecki 1 file changed, 2 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c -index 918303c8d0..134af3e767 100644 +index 62e1be6672..6cdbd9698a 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c -@@ -1080,6 +1080,8 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) +@@ -1092,6 +1092,8 @@ libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) x_disk->vdev = g_strdup(l_disk->dst); @@ -31,5 +31,5 @@ index 918303c8d0..134af3e767 100644 if (STREQ(driver, "tap") || STREQ(driver, "tap2")) { switch (format) { -- -2.37.3 +2.45.2 diff --git a/0003-libxl-Stubdom-emulator-type.patch b/0003-libxl-Stubdom-emulator-type.patch index 69335b7..ceb5f5e 100644 --- a/0003-libxl-Stubdom-emulator-type.patch +++ b/0003-libxl-Stubdom-emulator-type.patch @@ -1,4 +1,4 @@ -From 5d9fe9014e15a0abcbf645558253aad113cfb166 Mon Sep 17 00:00:00 2001 +From dded131cf0ffd4f7206f6d45a5494857a6dc15b8 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sun, 7 Apr 2013 19:48:52 +0200 Subject: [PATCH] libxl: Stubdom emulator type @@ -17,14 +17,14 @@ Signed-off-by: Marek Marczykowski-Górecki src/conf/domain_conf.c | 42 +++++++++++++++++++++++++++++-- src/conf/domain_conf.h | 10 ++++++++ src/conf/schemas/domaincommon.rng | 28 ++++++++++++++++++++- - src/libxl/libxl_conf.c | 18 +++++++++++++ - 5 files changed, 109 insertions(+), 3 deletions(-) + src/libxl/libxl_conf.c | 19 ++++++++++++++ + 5 files changed, 110 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst -index e28b805009..4deb290433 100644 +index 5c09b87d2b..1629b84407 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst -@@ -2405,6 +2405,20 @@ guest domain. All devices occur as children of the main ``devices`` element. +@@ -2475,6 +2475,20 @@ guest domain. All devices occur as children of the main ``devices`` element. specifies the recommended default emulator to use for each particular domain type / architecture combination. @@ -46,10 +46,10 @@ index e28b805009..4deb290433 100644 child ``alias`` element which then has ``name`` attribute where users can store identifier for the device. The identifier has to have "ua-" prefix and must be diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 93b411b96b..ae258b51d6 100644 +index bcc5e17204..c41bb3492e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c -@@ -1253,6 +1253,11 @@ VIR_ENUM_IMPL(virDomainDiskTray, +@@ -1281,6 +1281,11 @@ VIR_ENUM_IMPL(virDomainDiskTray, "open", ); @@ -61,7 +61,7 @@ index 93b411b96b..ae258b51d6 100644 VIR_ENUM_IMPL(virDomainRNGModel, VIR_DOMAIN_RNG_MODEL_LAST, "virtio", -@@ -3797,6 +3802,7 @@ void virDomainDefFree(virDomainDef *def) +@@ -4007,6 +4012,7 @@ void virDomainDefFree(virDomainDef *def) g_free(def->name); virBitmapFree(def->cpumask); g_free(def->emulator); @@ -69,7 +69,7 @@ index 93b411b96b..ae258b51d6 100644 g_free(def->description); g_free(def->title); g_free(def->kvm_features); -@@ -18337,6 +18343,17 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, +@@ -18933,6 +18939,17 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt, if (virDomainDefParseBootOptions(def, ctxt, xmlopt, flags) < 0) return NULL; @@ -79,7 +79,7 @@ index 93b411b96b..ae258b51d6 100644 + g_free(tmp); + if (def->emulator_type < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Unknown emulator type '%s'"), tmp); ++ _("Unknown emulator type '%1$s'"), tmp); + } + } + def->emulator_cmdline = virXPathString("string(./devices/emulator/@cmdline)", ctxt); @@ -87,13 +87,13 @@ index 93b411b96b..ae258b51d6 100644 /* analysis of the disk devices */ if ((n = virXPathNodeSet("./devices/disk", ctxt, &nodes)) < 0) return NULL; -@@ -20875,6 +20892,14 @@ virDomainDefCheckABIStabilityFlags(virDomainDef *src, +@@ -21514,6 +21531,14 @@ virDomainDefCheckABIStabilityFlags(virDomainDef *src, goto error; } + if (src->emulator_type != dst->emulator_type) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, -+ _("Target domain emulator type %s does not match source %s"), ++ _("Target domain emulator type %1$s does not match source %2$s"), + virDomainEmulatorTypeTypeToString(dst->emulator_type), + virDomainEmulatorTypeTypeToString(src->emulator_type)); + goto error; @@ -102,7 +102,7 @@ index 93b411b96b..ae258b51d6 100644 if (!virDomainDefFeaturesCheckABIStability(src, dst)) goto error; -@@ -27128,8 +27153,21 @@ virDomainDefFormatInternalSetRootName(virDomainDef *def, +@@ -28142,8 +28167,21 @@ virDomainDefFormatInternalSetRootName(virDomainDef *def, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -127,10 +127,10 @@ index 93b411b96b..ae258b51d6 100644 for (n = 0; n < def->ndisks; n++) if (virDomainDiskDefFormat(buf, def->disks[n], flags, xmlopt) < 0) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 1d54075de3..1de6504859 100644 +index 8f1245f202..d149eae979 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h -@@ -2546,6 +2546,13 @@ struct _virBlkioDevice { +@@ -2597,6 +2597,13 @@ struct _virBlkioDevice { unsigned long long wbps; }; @@ -144,7 +144,7 @@ index 1d54075de3..1de6504859 100644 typedef enum { VIR_DOMAIN_RNG_MODEL_VIRTIO, VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL, -@@ -2918,6 +2925,8 @@ struct _virDomainDef { +@@ -3043,6 +3050,8 @@ struct _virDomainDef { virDomainOSDef os; char *emulator; @@ -153,7 +153,7 @@ index 1d54075de3..1de6504859 100644 /* Most {caps_,hyperv_,kvm_,}feature options utilize a virTristateSwitch * to handle support. A few assign specific data values to the option. * See virDomainDefFeaturesCheckABIStability() for details. */ -@@ -4064,6 +4073,7 @@ VIR_ENUM_DECL(virDomainHyperv); +@@ -4247,6 +4256,7 @@ VIR_ENUM_DECL(virDomainHyperv); VIR_ENUM_DECL(virDomainKVM); VIR_ENUM_DECL(virDomainXen); VIR_ENUM_DECL(virDomainXenPassthroughMode); @@ -162,10 +162,10 @@ index 1d54075de3..1de6504859 100644 VIR_ENUM_DECL(virDomainRNGModel); VIR_ENUM_DECL(virDomainRNGBackend); diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng -index bdc0d4ff6d..bca958c55a 100644 +index faaf69bdee..69cdb2e8c8 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng -@@ -3863,7 +3863,33 @@ +@@ -4135,7 +4135,33 @@ --> @@ -201,10 +201,10 @@ index bdc0d4ff6d..bca958c55a 100644