[PATCH 0/4] Add win-dmp crashdump format

*** BLURB HERE *** Michal Prívozník (4): include: Fix copy-paste error in comment to virDomainCoreDumpFormat enum lib: Add win-dmp crashdump format virsh: Expose new win-dmp dump format NEWS: Document new memory dump format NEWS.rst | 5 +++++ docs/manpages/virsh.rst | 5 +++-- include/libvirt/libvirt-domain.h | 3 ++- src/qemu/qemu_driver.c | 1 + tools/virsh-domain.c | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) -- 2.26.3

The comment to virDomainCoreDumpFormat enum says that new values can be introduced in the future "as new events are added". Well, it should have been "formats" instead of "events", obviously. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- include/libvirt/libvirt-domain.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index e99bfb7654..b33eede68b 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -694,7 +694,7 @@ typedef enum { # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_CORE_DUMP_FORMAT_LAST /* - * NB: this enum value will increase over time as new events are + * NB: this enum value will increase over time as new formats are * added to the libvirt API. It reflects the last state supported * by this version of the libvirt API. */ -- 2.26.3

QEMU gained support for 'win-dmp' format in it's release of 2.13, but Libvirt doesn't implement it yet. Fortunately, there not much needed: new value to virDomainCoreDumpFormat public enum, which unfortunately means that QEMU driver has to be updated in the same commit, because of VIR_ENUM_IMPL(). Luckily, we don't need any extra QEMU capability - the code already checks supported formats via 'query-dump-guest-memory-capability' just before issuing 'dump-guest-memory'. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- include/libvirt/libvirt-domain.h | 1 + src/qemu/qemu_driver.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index b33eede68b..7ef8ac51e5 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -691,6 +691,7 @@ typedef enum { * lzo compression */ VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY, /* kdump-compressed format, with * snappy compression */ + VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP, /* Windows full crashdump format */ # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_CORE_DUMP_FORMAT_LAST /* diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c90d52edc0..e10e699a1a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -143,6 +143,7 @@ VIR_ENUM_IMPL(qemuDumpFormat, "kdump-zlib", "kdump-lzo", "kdump-snappy", + "win-dmp", ); -- 2.26.3

On Thu, May 20, 2021 at 15:49:53 +0200, Michal Privoznik wrote:
QEMU gained support for 'win-dmp' format in it's release of 2.13,
qemu-2.13 doesn't exist. IIRC it was renamed to 3.0 soon after.
but Libvirt doesn't implement it yet. Fortunately, there not much
s/Libvirt/libvirt/
needed: new value to virDomainCoreDumpFormat public enum, which unfortunately means that QEMU driver has to be updated in the same commit, because of VIR_ENUM_IMPL().
Luckily, we don't need any extra QEMU capability - the code already checks supported formats via 'query-dump-guest-memory-capability' just before issuing 'dump-guest-memory'.

In previous commit the virDomainCoreDumpWithFormat() API gained new format. Expose it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- docs/manpages/virsh.rst | 5 +++-- tools/virsh-domain.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index ad91cd6356..87668f2b9a 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2554,9 +2554,10 @@ If *--memory-only* is specified, the file is elf file, and will only include domain's memory and cpu common register value. It is very useful if the domain uses host devices directly. *--format* *string* is used to specify the format of 'memory-only' -dump, and *string* can be one of them: elf, kdump-zlib(kdump-compressed +dump, and *string* can be one of: elf, kdump-zlib(kdump-compressed format with zlib-compressed), kdump-lzo(kdump-compressed format with -lzo-compressed), kdump-snappy(kdump-compressed format with snappy-compressed). +lzo-compressed), kdump-snappy(kdump-compressed format with snappy-compressed), +win-dmp(Windows full crashdump format). The progress may be monitored using ``domjobinfo`` virsh command and canceled with ``domjobabort`` command (sent by another virsh instance). Another option diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5a5215ab4c..dc9712bce5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5463,6 +5463,8 @@ doDump(void *opaque) dumpformat = VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY; } else if (STREQ(format, "elf")) { dumpformat = VIR_DOMAIN_CORE_DUMP_FORMAT_RAW; + } else if (STREQ(format, "win-dmp")) { + dumpformat = VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP; } else { vshError(ctl, _("format '%s' is not supported, expecting " "'kdump-zlib', 'kdump-lzo', 'kdump-snappy' " -- 2.26.3

Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- NEWS.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 85baad8852..8358cbd369 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -22,6 +22,11 @@ v7.4.0 (unreleased) * **Improvements** + * Add win-dmp crashdump format + + New ``win-dmp`` format for ``virDomainCoreDumpWithFormat`` API and/or virsh + ``dump --format`` was introduced. + * **Bug fixes** -- 2.26.3

On Thu, May 20, 2021 at 15:49:51 +0200, Michal Privoznik wrote:
*** BLURB HERE ***
Michal Prívozník (4): include: Fix copy-paste error in comment to virDomainCoreDumpFormat enum lib: Add win-dmp crashdump format virsh: Expose new win-dmp dump format NEWS: Document new memory dump format
Series: Reviewed-by: Peter Krempa <pkrempa@redhat.com>
participants (2)
-
Michal Privoznik
-
Peter Krempa