[libvirt] [PATCH 2/3 v5] qemu: allow the client to choose the vmcore's format

Martin Kletzander mkletzan at redhat.com
Wed Jun 13 13:00:46 UTC 2012


On 06/13/2012 02:57 PM, Martin Kletzander wrote:
> On 06/12/2012 05:06 AM, Wen Congyang wrote:
>> This patch updates qemu driver to allow the client to choose the
>> vmcore's format: memory only or including device state.
>> ---
>>  include/libvirt/libvirt.h.in |    1 +
>>  src/qemu/qemu_capabilities.c |    5 +++
>>  src/qemu/qemu_capabilities.h |    1 +
>>  src/qemu/qemu_domain.c       |    1 +
>>  src/qemu/qemu_domain.h       |    1 +
>>  src/qemu/qemu_driver.c       |   60 ++++++++++++++++++++++++++++++++---------
>>  6 files changed, 56 insertions(+), 13 deletions(-)
>>
>> diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
>> index fcb6695..120ed14 100644
>> --- a/include/libvirt/libvirt.h.in
>> +++ b/include/libvirt/libvirt.h.in
>> @@ -927,6 +927,7 @@ typedef enum {
>>      VIR_DUMP_LIVE         = (1 << 1), /* live dump */
>>      VIR_DUMP_BYPASS_CACHE = (1 << 2), /* avoid file system cache pollution */
>>      VIR_DUMP_RESET        = (1 << 3), /* reset domain after dump finishes */
>> +    VIR_DUMP_MEMORY_ONLY  = (1 << 4), /* use dump-guest-memory */
>>  } virDomainCoreDumpFlags;
>>  
>>  /* Domain migration flags. */
>> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
>> index b410648..6eee8cd 100644
>> --- a/src/qemu/qemu_capabilities.c
>> +++ b/src/qemu/qemu_capabilities.c
>> @@ -164,6 +164,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
>>                "no-user-config",
>>  
>>                "hda-micro", /* 95 */
>> +              "dump-guest-memory",
>>  
>>      );
>>  
>> @@ -1237,6 +1238,10 @@ qemuCapsComputeCmdFlags(const char *help,
>>  
>>      if (version >= 11000)
>>          qemuCapsSet(flags, QEMU_CAPS_CPU_HOST);
>> +
>> +    if (version >= 1001050)
>> +        qemuCapsSet(flags, QEMU_CAPS_DUMP_GUEST_MEMORY);
>> +
>>      return 0;
>>  }
>>  
> 
> Sorry for bothering you with this, but I tried newest qemu and it shows
> the proper list of commands with query-commands in qmp. Instead of this
> one hunk, I'd use this:
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index 6ca01c5..7d2da21 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -991,6 +991,8 @@ qemuMonitorJSONCheckCommands(qemuMonitorPtr mon,
>              qemuCapsSet(qemuCaps, QEMU_CAPS_BLOCKJOB_SYNC);
>          else if (STREQ(name, "block-job-cancel"))
>              qemuCapsSet(qemuCaps, QEMU_CAPS_BLOCKJOB_ASYNC);
> +        else if (STREQ(name, "dump-guest-memory"))
> +            qemuCapsSet(qemuCaps, QEMU_CAPS_DUMP_GUEST_MEMORY);
>      }
> 
>      ret = 0;
> 

[...]

> , so ACK with that one hunk changed.
> 
> Martin
> 

To make it easier for you, you can squash this patch into it (this is
what I tested it with).

---
 src/qemu/qemu_capabilities.c |    3 ---
 src/qemu/qemu_monitor_json.c |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6eee8cd..7b368aa 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1239,9 +1239,6 @@ qemuCapsComputeCmdFlags(const char *help,
     if (version >= 11000)
         qemuCapsSet(flags, QEMU_CAPS_CPU_HOST);

-    if (version >= 1001050)
-        qemuCapsSet(flags, QEMU_CAPS_DUMP_GUEST_MEMORY);
-
     return 0;
 }

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 6ca01c5..7d2da21 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -991,6 +991,8 @@ qemuMonitorJSONCheckCommands(qemuMonitorPtr mon,
             qemuCapsSet(qemuCaps, QEMU_CAPS_BLOCKJOB_SYNC);
         else if (STREQ(name, "block-job-cancel"))
             qemuCapsSet(qemuCaps, QEMU_CAPS_BLOCKJOB_ASYNC);
+        else if (STREQ(name, "dump-guest-memory"))
+            qemuCapsSet(qemuCaps, QEMU_CAPS_DUMP_GUEST_MEMORY);
     }

     ret = 0;
-- 
1.7.8.6




More information about the libvir-list mailing list