qemu-devel
[Top][All Lists]
Advanced

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

[PATCH v3 00/13] RFC: [for 5.0]: HMP monitor handlers cleanups


From: Maxim Levitsky
Subject: [PATCH v3 00/13] RFC: [for 5.0]: HMP monitor handlers cleanups
Date: Mon, 27 Jan 2020 12:36:34 +0200

This patch series is bunch of cleanups
to the hmp monitor code.

This series only touched blockdev related hmp handlers.

No functional changes expected other that
light error message changes by the last patch.

This was inspired by this bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1719169

Basically some users still parse hmp error messages,
and they would like to have them prefixed with 'Error:'

In commit 66363e9a43f649360a3f74d2805c9f864da027eb we added
the hmp_handle_error which does exactl that but some hmp handlers
don't use it.

In this patch series, I moved all the block related hmp handlers
into blockdev-hmp-cmds.c, and then made them use this function
to report the errors.

I hope I didn't change too much code, I just felt that if
I touch this code, I can also make it easier to find these
handlers, that were scattered over 3 different files.

Changes from V1:
   * move the handlers to block/monitor/block-hmp-cmds.c
   * tiny cleanup for the commit messages

Changes from V2:
   * Moved all the function prototypes to new header (blockdev-hmp-cmds.h)
   * Set the license of blockdev-hmp-cmds.c to GPLv2+
   * Moved hmp_snapshot_* functions to blockdev-hmp-cmds.c
   * Moved hmp_drive_add_node to blockdev-hmp-cmds.c
     (this change needed some new exports, thus in separate new patch)
   * Moved hmp_qemu_io and hmp_eject to blockdev-hmp-cmds.c
   * Added 'error:' prefix to vreport, and updated the iotests
     This is invasive change, but really feels like the right one
   * Added minor refactoring patch that drops an unused #include

Best regards,
        Maxim Levitsky

Maxim Levitsky (13):
  usb/dev-storage: remove unused include
  monitor/hmp: uninline add_init_drive
  monitor/hmp: rename device-hotplug.c to block/monitor/block-hmp-cmds.c
  monitor/hmp: move hmp_drive_del and hmp_commit to block-hmp-cmds.c
  monitor/hmp: move hmp_drive_mirror and hmp_drive_backup to
    block-hmp-cmds.c
  monitor/hmp: move hmp_block_job* to block-hmp-cmds.c
  monitor/hmp: move hmp_snapshot_* to block-hmp-cmds.c
  monitor/hmp: move hmp_nbd_server* to block-hmp-cmds.c
  monitor/hmp: move remaining hmp_block* functions to block-hmp-cmds.c
  monitor/hmp: move hmp_info_block* to block-hmp-cmds.c
  monitor: Move hmp_drive_add_node to block-hmp-cmds.c
  add 'error' prefix to vreport
  monitor/hmp: Prefer to use hmp_handle_error for error reporting in
    block hmp commands

 MAINTAINERS                        |   1 +
 Makefile.objs                      |   2 +-
 block/Makefile.objs                |   1 +
 block/monitor/Makefile.objs        |   1 +
 block/monitor/block-hmp-cmds.c     | 980 +++++++++++++++++++++++++++++
 blockdev.c                         | 137 +---
 device-hotplug.c                   |  91 ---
 hw/usb/dev-storage.c               |   1 -
 include/block/block-hmp-commands.h |  42 ++
 include/block/block_int.h          |   5 +-
 include/monitor/hmp.h              |  24 -
 include/sysemu/blockdev.h          |   4 -
 include/sysemu/sysemu.h            |   3 -
 monitor/hmp-cmds.c                 | 771 +----------------------
 monitor/misc.c                     |   1 +
 tests/qemu-iotests/020.out         |   2 +-
 tests/qemu-iotests/026.out         | 260 ++++----
 tests/qemu-iotests/036.out         |  16 +-
 tests/qemu-iotests/043.out         |   6 +-
 tests/qemu-iotests/049.out         |  30 +-
 tests/qemu-iotests/051.pc.out      | 150 ++---
 tests/qemu-iotests/054.out         |   4 +-
 tests/qemu-iotests/060.out         |  20 +-
 tests/qemu-iotests/061.out         |  26 +-
 tests/qemu-iotests/069.out         |   2 +-
 tests/qemu-iotests/071.out         |   4 +-
 tests/qemu-iotests/074.out         |   4 +-
 tests/qemu-iotests/079.out         |   2 +-
 tests/qemu-iotests/080.out         |  72 +--
 tests/qemu-iotests/081.out         |   2 +-
 tests/qemu-iotests/082.out         |  38 +-
 tests/qemu-iotests/083.out         |  68 +-
 tests/qemu-iotests/098.out         |   8 +-
 tests/qemu-iotests/103.out         |  14 +-
 tests/qemu-iotests/106.out         |   4 +-
 tests/qemu-iotests/111.out         |   2 +-
 tests/qemu-iotests/112.out         |  24 +-
 tests/qemu-iotests/113.out         |   6 +-
 tests/qemu-iotests/114.out         |   2 +-
 tests/qemu-iotests/122.out         |   4 +-
 tests/qemu-iotests/133.out         |  30 +-
 tests/qemu-iotests/137.out         |  28 +-
 tests/qemu-iotests/140.out         |   2 +-
 tests/qemu-iotests/142.out         |  38 +-
 tests/qemu-iotests/143.out         |   2 +-
 tests/qemu-iotests/153.out         | 118 ++--
 tests/qemu-iotests/162.out         |  10 +-
 tests/qemu-iotests/172.out         |  16 +-
 tests/qemu-iotests/178.out.qcow2   |  30 +-
 tests/qemu-iotests/178.out.raw     |  26 +-
 tests/qemu-iotests/182.out         |   2 +-
 tests/qemu-iotests/187.out         |   6 +-
 tests/qemu-iotests/188.out         |   2 +-
 tests/qemu-iotests/197.out         |   2 +-
 tests/qemu-iotests/205             |   2 +-
 tests/qemu-iotests/215.out         |   2 +-
 tests/qemu-iotests/217.out         |   2 +-
 tests/qemu-iotests/226.out         |  12 +-
 tests/qemu-iotests/232.out         |  12 +-
 tests/qemu-iotests/233.out         |  24 +-
 tests/qemu-iotests/242.out         |   2 +-
 tests/qemu-iotests/244.out         |  14 +-
 tests/qemu-iotests/249.out         |   6 +-
 tests/qemu-iotests/261.out         |  24 +-
 tests/qemu-iotests/267.out         |  16 +-
 tests/qemu-iotests/common.filter   |   2 +-
 util/qemu-error.c                  |   1 +
 67 files changed, 1640 insertions(+), 1625 deletions(-)
 create mode 100644 block/monitor/Makefile.objs
 create mode 100644 block/monitor/block-hmp-cmds.c
 delete mode 100644 device-hotplug.c
 create mode 100644 include/block/block-hmp-commands.h

-- 
2.17.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]