Re: [PATCH v4 2/3] add qemu support to virDomainCoreDumpWithFormat API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/04/2014 07:44 PM, Daniel P. Berrange wrote:
> On Mon, Mar 03, 2014 at 10:27:25AM +0800, qiaonuohan wrote:
>> >  This patch makes qemu driver supprot virDomainCoreDumpWithFormat API.
>> >  ---
>> >    src/qemu/qemu_driver.c       | 45 +++++++++++++++++++++++++++++++++++---------
>> >    src/qemu/qemu_monitor.c      |  7 ++++---
>> >    src/qemu/qemu_monitor.h      |  3 ++-
>> >    src/qemu/qemu_monitor_json.c |  4 +++-
>> >    src/qemu/qemu_monitor_json.h |  3 ++-
>> >    tests/qemumonitorjsontest.c  |  2 +-
>> >    6 files changed, 48 insertions(+), 16 deletions(-)
>> >
>> >  diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> >  index c9a865e..f373f7c 100644
>> >  --- a/src/qemu/qemu_driver.c
>> >  +++ b/src/qemu/qemu_driver.c
>> >  @@ -3452,7 +3455,20 @@ doCoreDump(virQEMUDriverPtr driver,
>> >            goto cleanup;
>> >
>> >        if (dump_flags&  VIR_DUMP_MEMORY_ONLY) {
>> >  -        ret = qemuDumpToFd(driver, vm, fd, QEMU_ASYNC_JOB_DUMP);
>> >  +        if (dumpformat == VIR_DUMP_FORMAT_RAW)
>> >  +            memory_dump_format = "elf";
>> >  +        else if (dumpformat == VIR_DUMP_FORMAT_KDUMP_ZLIB)
>> >  +            memory_dump_format = "kdump-zlib";
>> >  +        else if (dumpformat == VIR_DUMP_FORMAT_KDUMP_LZO)
>> >  +            memory_dump_format = "kdump-lzo";
>> >  +        else if (dumpformat == VIR_DUMP_FORMAT_KDUMP_SNAPPY)
>> >  +            memory_dump_format = "kdump-snappy";
>> >  +        else {
>> >  +            virReportError(VIR_ERR_INVALID_ARG,
>> >  +                           _("unknown dumpformat '%d'"), dumpformat);
>> >  +        }
>> >  +        ret = qemuDumpToFd(driver, vm, fd, QEMU_ASYNC_JOB_DUMP,
>> >  +                           memory_dump_format);
>> >        } else {
>> >            ret = qemuMigrationToFile(driver, vm, fd, 0, path,
>> >                                      qemuCompressProgramName(compress), false,
> The else branch here should raise VIR_ERR_OPERATION_UNSUPPORTED
> if dumpformat != VIR_DUMP_FORMAT_RAW
>

So here is the place I should do the "implmentation restriction"(mentioned in
your last mail), then VIR_DUMP_FORMAT_RAW is the only choice when
VIR_DUMP_MEMORY_ONLY is not specified.

-- 
Regards
Qiao Nuohan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]