Message ID | 20231030133712.2822276-2-armbru@redhat.com |
---|---|
State | New |
Headers | show |
Series | dump: Minor fixes & improvements | expand |
On Mon, Oct 30, 2023 at 5:37 PM Markus Armbruster <armbru@redhat.com> wrote: > > The name of the second parameter differs between QAPI schema and C > implementation: it's @protocol in the former and @file in the latter. > Potentially confusing. Change the C implementation to match the QAPI > schema. > > Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> > --- > dump/dump.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/dump/dump.c b/dump/dump.c > index d355ada62e..a1fad17f9c 100644 > --- a/dump/dump.c > +++ b/dump/dump.c > @@ -2061,11 +2061,12 @@ DumpQueryResult *qmp_query_dump(Error **errp) > return result; > } > > -void qmp_dump_guest_memory(bool paging, const char *file, > +void qmp_dump_guest_memory(bool paging, const char *protocol, > bool has_detach, bool detach, > - bool has_begin, int64_t begin, bool has_length, > - int64_t length, bool has_format, > - DumpGuestMemoryFormat format, Error **errp) > + bool has_begin, int64_t begin, > + bool has_length, int64_t length, > + bool has_format, DumpGuestMemoryFormat format, > + Error **errp) > { > ERRP_GUARD(); > const char *p; > @@ -2128,7 +2129,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, > } > > #if !defined(WIN32) > - if (strstart(file, "fd:", &p)) { > + if (strstart(protocol, "fd:", &p)) { > fd = monitor_get_fd(monitor_cur(), p, errp); > if (fd == -1) { > return; > @@ -2136,7 +2137,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, > } > #endif > > - if (strstart(file, "file:", &p)) { > + if (strstart(protocol, "file:", &p)) { > fd = qemu_open_old(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR); > if (fd < 0) { > error_setg_file_open(errp, errno, p); > -- > 2.41.0 >
diff --git a/dump/dump.c b/dump/dump.c index d355ada62e..a1fad17f9c 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2061,11 +2061,12 @@ DumpQueryResult *qmp_query_dump(Error **errp) return result; } -void qmp_dump_guest_memory(bool paging, const char *file, +void qmp_dump_guest_memory(bool paging, const char *protocol, bool has_detach, bool detach, - bool has_begin, int64_t begin, bool has_length, - int64_t length, bool has_format, - DumpGuestMemoryFormat format, Error **errp) + bool has_begin, int64_t begin, + bool has_length, int64_t length, + bool has_format, DumpGuestMemoryFormat format, + Error **errp) { ERRP_GUARD(); const char *p; @@ -2128,7 +2129,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, } #if !defined(WIN32) - if (strstart(file, "fd:", &p)) { + if (strstart(protocol, "fd:", &p)) { fd = monitor_get_fd(monitor_cur(), p, errp); if (fd == -1) { return; @@ -2136,7 +2137,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, } #endif - if (strstart(file, "file:", &p)) { + if (strstart(protocol, "file:", &p)) { fd = qemu_open_old(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR); if (fd < 0) { error_setg_file_open(errp, errno, p);
The name of the second parameter differs between QAPI schema and C implementation: it's @protocol in the former and @file in the latter. Potentially confusing. Change the C implementation to match the QAPI schema. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- dump/dump.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)