diff --git a/0001-libxl-add-support-for-BlockResize-API.patch b/0001-libxl-add-support-for-BlockResize-API.patch deleted file mode 100644 index 896f92b..0000000 --- a/0001-libxl-add-support-for-BlockResize-API.patch +++ /dev/null @@ -1,145 +0,0 @@ -From 914c37ca3f0af956e69179d49e87e8390560c2b3 Mon Sep 17 00:00:00 2001 -From: Jim Fehlig -Date: Tue, 5 Jul 2022 11:36:37 -0600 -Subject: libxl: add support for BlockResize API - -Add support in the libxl driver for the BlockResize API. Use libxl's -libxl_qemu_monitor_command API to issue the block_resize command to qemu. - -Signed-off-by: Jim Fehlig ---- - src/libxl/libxl_api_wrapper.h | 15 ++++++ - src/libxl/libxl_driver.c | 90 +++++++++++++++++++++++++++++++++++ - 2 files changed, 105 insertions(+) - -Index: libvirt-9.1.0/src/libxl/libxl_api_wrapper.h -=================================================================== ---- libvirt-9.1.0.orig/src/libxl/libxl_api_wrapper.h -+++ libvirt-9.1.0/src/libxl/libxl_api_wrapper.h -@@ -215,3 +215,18 @@ libxlSetMemoryTargetWrapper(libxl_ctx *c - - return ret; - } -+ -+static inline int -+libxlQemuMonitorCommandWrapper(libxl_ctx *ctx, uint32_t domid, -+ const char *command_line, char **output) -+{ -+ int ret; -+ -+#if LIBXL_API_VERSION < 0x041300 -+ ret = libxl_qemu_monitor_command(ctx, domid, command_line, output); -+#else -+ ret = libxl_qemu_monitor_command(ctx, domid, command_line, output, NULL); -+#endif -+ -+ return ret; -+} -Index: libvirt-9.1.0/src/libxl/libxl_driver.c -=================================================================== ---- libvirt-9.1.0.orig/src/libxl/libxl_driver.c -+++ libvirt-9.1.0/src/libxl/libxl_driver.c -@@ -5403,6 +5403,95 @@ libxlDomainMemoryStats(virDomainPtr dom, - - #undef LIBXL_SET_MEMSTAT - -+/** -+ * Resize a block device while a guest is running. Resize to a lower size -+ * is supported, but should be used with extreme caution. Note that it -+ * only supports to resize image files, it can't resize block devices -+ * like LVM volumes. -+ */ -+static int -+libxlDomainBlockResize(virDomainPtr dom, -+ const char *path, -+ unsigned long long size, -+ unsigned int flags) -+{ -+ libxlDriverPrivate *driver = dom->conn->privateData; -+ libxlDriverConfig *cfg; -+ virDomainObj *vm; -+ int ret = -1; -+ virDomainDiskDef *disk = NULL; -+ g_autofree char *moncmd = NULL; -+ g_autofree char *monreply = NULL; -+ -+ virCheckFlags(VIR_DOMAIN_BLOCK_RESIZE_BYTES, -1); -+ -+ if (path[0] == '\0') { -+ virReportError(VIR_ERR_INVALID_ARG, -+ "%s", _("empty path")); -+ return -1; -+ } -+ -+ /* We prefer operating on bytes. */ -+ if ((flags & VIR_DOMAIN_BLOCK_RESIZE_BYTES) == 0) { -+ if (size > ULLONG_MAX / 1024) { -+ virReportError(VIR_ERR_OVERFLOW, -+ _("size must be less than %llu"), -+ ULLONG_MAX / 1024); -+ return -1; -+ } -+ size *= 1024; -+ } -+ -+ cfg = libxlDriverConfigGet(driver); -+ if (!(vm = libxlDomObjFromDomain(dom))) -+ goto cleanup; -+ -+ if (virDomainBlockResizeEnsureACL(dom->conn, vm->def) < 0) -+ goto cleanup; -+ -+ if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0) -+ goto cleanup; -+ -+ if (!virDomainObjIsActive(vm)) { -+ virReportError(VIR_ERR_OPERATION_INVALID, -+ "%s", _("domain is not running")); -+ goto endjob; -+ } -+ -+ if (!(disk = virDomainDiskByName(vm->def, path, false))) { -+ virReportError(VIR_ERR_INVALID_ARG, -+ _("invalid path: %s"), path); -+ goto endjob; -+ } -+ -+ /* qcow2 and qed must be sized on 512 byte blocks/sectors, -+ * so adjust size if necessary to round up. -+ */ -+ if (disk->src->format == VIR_STORAGE_FILE_QCOW2 || -+ disk->src->format == VIR_STORAGE_FILE_QED) -+ size = VIR_ROUND_UP(size, 512); -+ -+ moncmd = g_strdup_printf("block_resize %s %lluB", disk->dst, size); -+ -+ if (libxlQemuMonitorCommandWrapper(cfg->ctx, vm->def->id, -+ moncmd, &monreply) != 0) { -+ virReportError(VIR_ERR_OPERATION_FAILED, -+ _("block_resize command failed for device '%s' on domain '%d'"), -+ disk->dst, vm->def->id); -+ goto endjob; -+ } -+ -+ ret = 0; -+ -+ endjob: -+ virDomainObjEndJob(vm); -+ -+ cleanup: -+ virDomainObjEndAPI(&vm); -+ virObjectUnref(cfg); -+ return ret; -+} -+ - static int - libxlDomainGetJobInfo(virDomainPtr dom, - virDomainJobInfoPtr info) -@@ -6723,6 +6812,7 @@ static virHypervisorDriver libxlHypervis - .domainGetNumaParameters = libxlDomainGetNumaParameters, /* 1.1.1 */ - .nodeGetFreeMemory = libxlNodeGetFreeMemory, /* 0.9.0 */ - .nodeGetCellsFreeMemory = libxlNodeGetCellsFreeMemory, /* 1.1.1 */ -+ .domainBlockResize = libxlDomainBlockResize, /* 4.2.0 */ - .domainGetJobInfo = libxlDomainGetJobInfo, /* 1.3.1 */ - .domainGetJobStats = libxlDomainGetJobStats, /* 1.3.1 */ - .domainMemoryStats = libxlDomainMemoryStats, /* 1.3.0 */ diff --git a/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch b/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch deleted file mode 100644 index a888451..0000000 --- a/0001-util-Don-t-spawn-pkttyagent-when-stdin-is-not-a-tty.patch +++ /dev/null @@ -1,34 +0,0 @@ -From be595e5e9e9bc8fa3fdd94358b1c92bd8b30b0eb Mon Sep 17 00:00:00 2001 -From: Jim Fehlig -Date: Tue, 5 Jul 2022 11:21:45 -0600 -Subject: util: Don't spawn pkttyagent when stdin is not a tty - -My idea was that running pkttyagent unconditionally, modulo checks that -pkttyagent itself does to make sure it does not fail, is not going to be an -issue turned out to be wrong. Adding back the original check for stdin being a -tty helps in some testing scenarios as reported by Jim Fehlig and does not -really cause any issues. I originally wanted it in because it also made -pkttyagent auth work with redirected input into virsh (with a connection that -requires polkit authentication and without a session-wide polkit tty agent, -basically making pkttyagent necessary to succeed). But anyone running virsh -like that is asking for problems already anyway =) - -Signed-off-by: Martin Kletzander ---- - src/util/virpolkit.c | 3 +++ - 1 file changed, 3 insertions(+) - -Index: libvirt-9.1.0/src/util/virpolkit.c -=================================================================== ---- libvirt-9.1.0.orig/src/util/virpolkit.c -+++ libvirt-9.1.0/src/util/virpolkit.c -@@ -235,6 +235,9 @@ virPolkitAgentAvailable(void) - const char *termid = ctermid(NULL); - VIR_AUTOCLOSE fd = -1; - -+ if (!isatty(STDIN_FILENO)) -+ return false; -+ - if (!virFileIsExecutable(PKTTYAGENT)) - return false; - diff --git a/4959490e-support-SUSE-edk2-firmware-paths.patch b/4959490e-support-SUSE-edk2-firmware-paths.patch deleted file mode 100644 index dd45d4a..0000000 --- a/4959490e-support-SUSE-edk2-firmware-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -From f49281168b3201d0ffe731554a49923914b0e67c Mon Sep 17 00:00:00 2001 -From: Jim Fehlig -Date: Thu, 23 Feb 2023 11:02:46 -0700 -Subject: [PATCH] security: Add support for SUSE edk2 firmware paths - -SUSE installs edk2 firmwares for both x86_64 and aarch64 in /usr/share/qemu. -Add support for this path in virt-aa-helper and allow locking files within -the path in the libvirt qemu abstraction. - -Signed-off-by: Jim Fehlig -Reviewed-by: Michal Privoznik -Reviewed-by: Andrea Bolognani -(cherry picked from commit b94a82ce9a3a27db2e6f76eacdb64428d11cbe6f) ---- - src/security/apparmor/libvirt-qemu | 2 +- - src/security/virt-aa-helper.c | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -Index: libvirt-9.1.0/src/security/apparmor/libvirt-qemu -=================================================================== ---- libvirt-9.1.0.orig/src/security/apparmor/libvirt-qemu -+++ libvirt-9.1.0/src/security/apparmor/libvirt-qemu -@@ -91,7 +91,7 @@ - /usr/share/proll/** r, - /usr/share/qemu-efi/** r, - /usr/share/qemu-kvm/** r, -- /usr/share/qemu/** r, -+ /usr/share/qemu/** rk, - /usr/share/seabios/** r, - /usr/share/sgabios/** r, - /usr/share/slof/** r, -Index: libvirt-9.1.0/src/security/virt-aa-helper.c -=================================================================== ---- libvirt-9.1.0.orig/src/security/virt-aa-helper.c -+++ libvirt-9.1.0/src/security/virt-aa-helper.c -@@ -481,6 +481,7 @@ valid_path(const char *path, const bool - "/usr/share/AAVMF/", /* for AAVMF images */ - "/usr/share/qemu-efi/", /* for AAVMF images */ - "/usr/share/qemu-efi-aarch64/", /* for AAVMF images */ -+ "/usr/share/qemu/", /* SUSE path for OVMF and AAVMF images */ - "/usr/lib/u-boot/", /* u-boot loaders for qemu */ - "/usr/lib/riscv64-linux-gnu/opensbi" /* RISC-V SBI implementation */ - }; diff --git a/705525cb-libxl-Support-custom-firmware-path-conversion.patch b/705525cb-libxl-Support-custom-firmware-path-conversion.patch deleted file mode 100644 index a6c81e3..0000000 --- a/705525cb-libxl-Support-custom-firmware-path-conversion.patch +++ /dev/null @@ -1,87 +0,0 @@ -From a4bec048bc68b2eeac0f3157a9b946b404f1cea1 Mon Sep 17 00:00:00 2001 -From: Jim Fehlig -Date: Mon, 13 Feb 2023 14:30:31 -0700 -Subject: [PATCH 2/2] libxl: Add support for custom firmware path in config - converter - -Signed-off-by: Jim Fehlig -Reviewed-by: Michal Privoznik -(cherry picked from commit 705525cbec0b2551d54a04d22b5605b04e0343c0) -References: bsc#1209161 ---- - src/libxl/xen_xl.c | 19 ++++++++++++++----- - tests/xlconfigdata/test-fullvirt-ovmf.cfg | 1 + - tests/xlconfigdata/test-fullvirt-ovmf.xml | 2 +- - 3 files changed, 16 insertions(+), 6 deletions(-) - -Index: libvirt-9.1.0/src/libxl/xen_xl.c -=================================================================== ---- libvirt-9.1.0.orig/src/libxl/xen_xl.c -+++ libvirt-9.1.0/src/libxl/xen_xl.c -@@ -104,18 +104,23 @@ xenParseXLOS(virConf *conf, virDomainDef - - if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { - g_autofree char *bios = NULL; -+ g_autofree char *bios_path = NULL; - g_autofree char *boot = NULL; - int val = 0; - - if (xenConfigGetString(conf, "bios", &bios, NULL) < 0) - return -1; -+ if (xenConfigGetString(conf, "bios_path_override", &bios_path, NULL) < 0) -+ return -1; - - if (bios && STREQ(bios, "ovmf")) { - def->os.loader = g_new0(virDomainLoaderDef, 1); - def->os.loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH; - def->os.loader->readonly = VIR_TRISTATE_BOOL_YES; -- -- def->os.loader->path = g_strdup(LIBXL_FIRMWARE_DIR "/ovmf.bin"); -+ if (bios_path) -+ def->os.loader->path = g_strdup(bios_path); -+ else -+ def->os.loader->path = g_strdup(LIBXL_FIRMWARE_DIR "/ovmf.bin"); - } else { - for (i = 0; i < caps->nguests; i++) { - if (caps->guests[i]->ostype == VIR_DOMAIN_OSTYPE_HVM && -@@ -1119,9 +1124,13 @@ xenFormatXLOS(virConf *conf, virDomainDe - if (xenConfigSetString(conf, "builder", "hvm") < 0) - return -1; - -- if (virDomainDefHasOldStyleUEFI(def) && -- xenConfigSetString(conf, "bios", "ovmf") < 0) -- return -1; -+ if (virDomainDefHasOldStyleUEFI(def)) { -+ if (xenConfigSetString(conf, "bios", "ovmf") < 0) -+ return -1; -+ if (def->os.loader->path && -+ (xenConfigSetString(conf, "bios_path_override", def->os.loader->path) < 0)) -+ return -1; -+ } - - if (def->os.slic_table && - xenConfigSetString(conf, "acpi_firmware", def->os.slic_table) < 0) -Index: libvirt-9.1.0/tests/xlconfigdata/test-fullvirt-ovmf.cfg -=================================================================== ---- libvirt-9.1.0.orig/tests/xlconfigdata/test-fullvirt-ovmf.cfg -+++ libvirt-9.1.0/tests/xlconfigdata/test-fullvirt-ovmf.cfg -@@ -22,5 +22,6 @@ parallel = "none" - serial = "none" - builder = "hvm" - bios = "ovmf" -+bios_path_override = "/usr/share/qemu/ovmf-x86_64-xen.bin" - boot = "d" - disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=qcow2,vdev=hdb,access=rw,backendtype=qdisk,target=/var/lib/libvirt/images/XenGuest2-home", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ] -Index: libvirt-9.1.0/tests/xlconfigdata/test-fullvirt-ovmf.xml -=================================================================== ---- libvirt-9.1.0.orig/tests/xlconfigdata/test-fullvirt-ovmf.xml -+++ libvirt-9.1.0/tests/xlconfigdata/test-fullvirt-ovmf.xml -@@ -6,7 +6,7 @@ - 1 - - hvm -- /LIBXL_FIRMWARE_DIR/ovmf.bin -+ /usr/share/qemu/ovmf-x86_64-xen.bin - - - diff --git a/README.packaging.txt b/README.packaging.txt new file mode 100644 index 0000000..8980b96 --- /dev/null +++ b/README.packaging.txt @@ -0,0 +1,12 @@ +This package is maintained in git at +https://github.com/openSUSE/libvirt + +Please submit a pull request for any changes. The spec file is also maintained +in git. + +To build a package from git, edit the _service to reference the desired branch +and call + +osc service localrun + +The package can then be build as usual with your prefered osc build options. diff --git a/_service b/_service index 008e519..202fdf7 100644 --- a/_service +++ b/_service @@ -1,7 +1,18 @@ - - + + git + https://oauth2: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@github.com/openSUSE/libvirt.git + factory + libvirt.spec + README.packaging.txt + @PARENT_TAG@ + [v]?([^-+a-z]+)(.*) + \1 disable - disable - \ No newline at end of file + + + *.tar + xz + + diff --git a/bf3be5b7-libxl-Support-custom-firmware-path.patch b/bf3be5b7-libxl-Support-custom-firmware-path.patch deleted file mode 100644 index 3997406..0000000 --- a/bf3be5b7-libxl-Support-custom-firmware-path.patch +++ /dev/null @@ -1,204 +0,0 @@ -From 4bb53ee6b832c4f8f6631ab7508c6bccd7a4241e Mon Sep 17 00:00:00 2001 -From: Jim Fehlig -Date: Fri, 10 Feb 2023 14:22:19 -0700 -Subject: [PATCH 1/2] libxl: Support specifying a custom firmware path - -libxl added support for specifying custom firmware paths long ago. The -functionality exists in all Xen version supported by libvirt. This patch -adds support for user-specified efi firmware paths in the libxl driver. - -Signed-off-by: Jim Fehlig -Reviewed-by: Michal Privoznik -(cherry picked from commit bf3be5b76e96f22edfe71738f97c02a01f3b8354) -References: bsc#1209161 ---- - src/libxl/libxl_conf.c | 14 ++-- - tests/libxlxml2domconfigdata/efi-hvm.json | 91 +++++++++++++++++++++++ - tests/libxlxml2domconfigdata/efi-hvm.xml | 36 +++++++++ - tests/libxlxml2domconfigtest.c | 1 + - 4 files changed, 134 insertions(+), 8 deletions(-) - -Index: libvirt-9.1.0/src/libxl/libxl_conf.c -=================================================================== ---- libvirt-9.1.0.orig/src/libxl/libxl_conf.c -+++ libvirt-9.1.0/src/libxl/libxl_conf.c -@@ -632,14 +632,10 @@ libxlMakeDomBuildInfo(virDomainDef *def, - b_info->ramdisk = g_strdup(def->os.initrd); - - /* -- * Currently libxl only allows specifying the type of BIOS. -- * If automatic firmware selection is enabled or the loader -- * type is PFLASH, we assume OVMF and set libxl_bios_type -- * to LIBXL_BIOS_TYPE_OVMF. The path to the OVMF firmware is -- * configured when building Xen using '--with-system-ovmf='. If -- * not specified, LIBXL_FIRMWARE_DIR/ovmf.bin is used. In the -- * future, Xen will support a user-specified firmware path. See -- * https://lists.xenproject.org/archives/html/xen-devel/2016-03/msg01628.html -+ * libxl allows specifying the type of firmware and an optional path. -+ * If the path is not explicitly specified, a default path for the given -+ * firmware type is used. For EFI, it's LIBXL_FIRMWARE_DIR/ovmf.bin. -+ * Currently libxl does not support specifying nvram for EFI firmwares. - */ - if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) { - if (def->os.loader == NULL) -@@ -651,9 +647,11 @@ libxlMakeDomBuildInfo(virDomainDef *def, - if (def->os.loader->readonly == VIR_TRISTATE_BOOL_ABSENT) - def->os.loader->readonly = VIR_TRISTATE_BOOL_YES; - b_info->u.hvm.bios = LIBXL_BIOS_TYPE_OVMF; -+ b_info->u.hvm.system_firmware = g_strdup(def->os.loader->path); - def->os.firmware = VIR_DOMAIN_OS_DEF_FIRMWARE_NONE; - } else if (virDomainDefHasOldStyleUEFI(def)) { - b_info->u.hvm.bios = LIBXL_BIOS_TYPE_OVMF; -+ b_info->u.hvm.system_firmware = g_strdup(def->os.loader->path); - } - - if (def->emulator) { -Index: libvirt-9.1.0/tests/libxlxml2domconfigdata/efi-hvm.json -=================================================================== ---- /dev/null -+++ libvirt-9.1.0/tests/libxlxml2domconfigdata/efi-hvm.json -@@ -0,0 +1,91 @@ -+{ -+ "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": 1234, -+ "device_model_version": "qemu_xen", -+ "device_model": "/bin/true", -+ "sched_params": { -+ -+ }, -+ "apic": "True", -+ "acpi": "True", -+ "type.hvm": { -+ "bios": "ovmf", -+ "pae": "True", -+ "system_firmware": "/usr/share/qemu/ovmf-x86_64-xen.bin", -+ "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-9.1.0/tests/libxlxml2domconfigdata/efi-hvm.xml -=================================================================== ---- /dev/null -+++ libvirt-9.1.0/tests/libxlxml2domconfigdata/efi-hvm.xml -@@ -0,0 +1,36 @@ -+ -+ test-hvm -+ None -+ 2147d599-9cc6-c0dc-92ab-4064b5446e9b -+ 1048576 -+ 1048576 -+ 4 -+ destroy -+ restart -+ destroy -+ -+ -+ hvm -+ /usr/share/qemu/ovmf-x86_64-xen.bin -+ -+ -+ -+ -+ -+ -+ -+ -+ /bin/true -+ -+ -+ -+ -+ -+ -+ -+ -+