1. 23 6月, 2015 4 次提交
    • M
      qerror: Finally unused, clean up · 4629ed1e
      Markus Armbruster 提交于
      Remove it except for two things in qerror.h:
      
      * Two #include to be cleaned up separately to avoid cluttering this
        patch.
      
      * The QERR_ macros.  Mark as obsolete.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
      4629ed1e
    • M
      qmp: Wean off qerror_report() · 485febc6
      Markus Armbruster 提交于
      The traditional QMP command handler interface
      
          int qmp_FOO(Monitor *mon, const QDict *params, QObject **ret_data);
      
      doesn't provide for returning an Error object.  Instead, the handler
      is expected to stash it in the monitor with qerror_report().
      
      When we rebased QMP on top of QAPI, we didn't change this interface.
      Instead, commit 776574d6 introduced "middle mode" as a temporary aid
      for converting existing QMP commands to QAPI one by one.  More than
      three years later, we're still using it.
      
      Middle mode has two effects:
      
      * Instead of the native input marshallers
      
            static void qmp_marshal_input_FOO(QDict *, QObject **, Error **)
      
        it generates input marshallers conforming to the traditional QMP
        command handler interface.
      
      * It suppresses generation of code to register them with
        qmp_register_command()
      
        This permits giving them internal linkage.
      
      As long as we need qmp-commands.hx, we can't use the registry behind
      qmp_register_command(), so the latter has to stay for now.
      
      The former has to go to get rid of qerror_report().  Changing all QMP
      commands to fit the QAPI mold in one go was impractical back when we
      started, but by now there are just a few stragglers left:
      do_qmp_capabilities(), qmp_qom_set(), qmp_qom_get(), qmp_object_add(),
      qmp_netdev_add(), do_device_add().
      
      Switch middle mode to generate native input marshallers, and adapt the
      stragglers.  Simplifies both the monitor code and the stragglers.
      
      Rename do_qmp_capabilities() to qmp_capabilities(), and
      do_device_add() to qmp_device_add, because that's how QMP command
      handlers are named today.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
      485febc6
    • M
      qerror: Clean up QERR_ macros to expand into a single string · c6bd8c70
      Markus Armbruster 提交于
      These macros expand into error class enumeration constant, comma,
      string.  Unclean.  Has been that way since commit 13f59ae8.
      
      The error class is always ERROR_CLASS_GENERIC_ERROR since the previous
      commit.
      
      Clean up as follows:
      
      * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and
        delete it from the QERR_ macro.  No change after preprocessing.
      
      * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into
        error_setg(...).  Again, no change after preprocessing.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
      c6bd8c70
    • M
      QemuOpts: Wean off qerror_report_err() · 70b94331
      Markus Armbruster 提交于
      qerror_report_err() is a transitional interface to help with
      converting existing monitor commands to QMP.  It should not be used
      elsewhere.
      
      The only remaining user in qemu-option.c is qemu_opts_parse().  Is it
      used in QMP context?  If not, we can simply replace
      qerror_report_err() by error_report_err().
      
      The uses in qemu-img.c, qemu-io.c, qemu-nbd.c and under tests/ are
      clearly not in QMP context.
      
      The uses in vl.c aren't either, because the only QMP command handlers
      there are qmp_query_status() and qmp_query_machines(), and they don't
      call it.
      
      Remaining uses:
      
      * drive_def(): Command line -drive and such, HMP drive_add and pci_add
      
      * hmp_chardev_add(): HMP chardev-add
      
      * monitor_parse_command(): HMP core
      
      * tmp_config_parse(): Command line -tpmdev
      
      * net_host_device_add(): HMP host_net_add
      
      * net_client_parse(): Command line -net and -netdev
      
      * qemu_global_option(): Command line -global
      
      * vnc_parse_func(): Command line -display, -vnc, default display, HMP
        change, QMP change.  Bummer.
      
      * qemu_pci_hot_add_nic(): HMP pci_add
      
      * usb_net_init(): Command line -usbdevice, HMP usb_add
      
      Propagate errors through qemu_opts_parse().  Create a convenience
      function qemu_opts_parse_noisily() that passes errors to
      error_report_err().  Switch all non-QMP users outside tests to it.
      
      That leaves vnc_parse_func().  Propagate errors through it.  Since I'm
      touching it anyway, rename it to vnc_parse().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
      70b94331
  2. 22 6月, 2015 8 次提交
  3. 15 6月, 2015 1 次提交
  4. 12 6月, 2015 1 次提交
    • S
      qmp/hmp: add rocker device support · fafa4d50
      Scott Feldman 提交于
      Add QMP/HMP support for rocker devices.  This is mostly for debugging purposes
      to see inside the device's tables and port configurations.  Some examples:
      
      (qemu) info rocker sw1
      name: sw1
      id: 0x0000013512005452
      ports: 4
      
      (qemu) info rocker-ports sw1
                  ena/    speed/ auto
            port  link    duplex neg?
           sw1.1  up     10G  FD  No
           sw1.2  up     10G  FD  No
           sw1.3  !ena   10G  FD  No
           sw1.4  !ena   10G  FD  No
      
      (qemu) info rocker-of-dpa-flows sw1
      prio tbl hits key(mask) --> actions
      2    60       pport 1 vlan 1 LLDP src 00:02:00:00:02:00 dst 01:80:c2:00:00:0e
      2    60       pport 1 vlan 1 ARP src 00:02:00:00:02:00 dst 00:02:00:00:03:00
      2    60       pport 2 vlan 2 IPv6 src 00:02:00:00:03:00 dst 33:33:ff:00:00:02 proto 58
      3    50       vlan 2 dst 33:33:ff:00:00:02 --> write group 0x32000001 goto tbl 60
      2    60       pport 2 vlan 2 IPv6 src 00:02:00:00:03:00 dst 33:33:ff:00:03:00 proto 58
      3    50  1    vlan 2 dst 33:33:ff:00:03:00 --> write group 0x32000001 goto tbl 60
      2    60       pport 2 vlan 2 ARP src 00:02:00:00:03:00 dst 00:02:00:00:02:00
      3    50  2    vlan 2 dst 00:02:00:00:02:00 --> write group 0x02000001 goto tbl 60
      2    60  1    pport 2 vlan 2 IP src 00:02:00:00:03:00 dst 00:02:00:00:02:00 proto 1
      3    50  2    vlan 1 dst 00:02:00:00:03:00 --> write group 0x01000002 goto tbl 60
      2    60  1    pport 1 vlan 1 IP src 00:02:00:00:02:00 dst 00:02:00:00:03:00 proto 1
      2    60       pport 1 vlan 1 IPv6 src 00:02:00:00:02:00 dst 33:33:ff:00:00:01 proto 58
      3    50       vlan 1 dst 33:33:ff:00:00:01 --> write group 0x31000000 goto tbl 60
      2    60       pport 1 vlan 1 IPv6 src 00:02:00:00:02:00 dst 33:33:ff:00:02:00 proto 58
      3    50  1    vlan 1 dst 33:33:ff:00:02:00 --> write group 0x31000000 goto tbl 60
      1    60  173  pport 2 vlan 2 LLDP src <any> dst 01:80:c2:00:00:0e --> write group 0x02000000
      1    60  6    pport 2 vlan 2 IPv6 src <any> dst <any> --> write group 0x02000000
      1    60  174  pport 1 vlan 1 LLDP src <any> dst 01:80:c2:00:00:0e --> write group 0x01000000
      1    60  174  pport 2 vlan 2 IP src <any> dst <any> --> write group 0x02000000
      1    60  6    pport 1 vlan 1 IPv6 src <any> dst <any> --> write group 0x01000000
      1    60  181  pport 2 vlan 2 ARP src <any> dst <any> --> write group 0x02000000
      1    10  715  pport 2 --> apply new vlan 2 goto tbl 20
      1    60  177  pport 1 vlan 1 ARP src <any> dst <any> --> write group 0x01000000
      1    60  174  pport 1 vlan 1 IP src <any> dst <any> --> write group 0x01000000
      1    10  717  pport 1 --> apply new vlan 1 goto tbl 20
      1    0   1432 pport 0(0xffff) --> goto tbl 10
      
      (qemu) info rocker-of-dpa-groups sw1
      id (decode) --> buckets
      0x32000001 (type L2 multicast vlan 2 index 1) --> groups [0x02000001,0x02000000]
      0x02000001 (type L2 interface vlan 2 pport 1) --> pop vlan out pport 1
      0x01000002 (type L2 interface vlan 1 pport 2) --> pop vlan out pport 2
      0x02000000 (type L2 interface vlan 2 pport 0) --> pop vlan out pport 0
      0x01000000 (type L2 interface vlan 1 pport 0) --> pop vlan out pport 0
      0x31000000 (type L2 multicast vlan 1 index 0) --> groups [0x01000002,0x01000000]
      
      [Added "query-" prefixes to rocker.json commands as suggested by Eric
      Blake <eblake@redhat.com>.
      --Stefan]
      Signed-off-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Message-id: 1433985681-56138-5-git-send-email-sfeldma@gmail.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fafa4d50
  5. 08 6月, 2015 1 次提交
  6. 02 6月, 2015 19 次提交
  7. 08 5月, 2015 1 次提交
  8. 30 4月, 2015 1 次提交
  9. 28 4月, 2015 2 次提交
  10. 27 4月, 2015 1 次提交
    • M
      monitor: Make client_migrate_info synchronous · 3b5704b2
      Markus Armbruster 提交于
      Live migration with spice works like this today:
      
        (1) client_migrate_info monitor cmd
        (2) spice server notifies client, client connects to target host.
        (3) qemu waits until spice client connect is finished.
        (4) send over vmstate (i.e. main part of live migration).
        (5) spice handover to target host.
      
      (3) is implemented by making client_migrate_info a async monitor
      command.  This is the only async monitor command we have.
      
      The original reason to implement this dance was that qemu did not accept
      new tcp connections while the incoming migration was running, so (2) and
      (4) could not be done in parallel.  That issue was fixed long ago though.
      Qemu version 1.3.0 (released Dec 2012) and newer happily accept tcp
      connects while the incoming migration runs.
      
      Time to drop step (3).  This patch does exactly that, by making the
      monitor command synchronous and removing the code needed to handle the
      async monitor command in ui/spice-core.c
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3b5704b2
  11. 26 4月, 2015 1 次提交
    • P
      Switch non-CPU callers from ld/st*_phys to address_space_ld/st* · 42874d3a
      Peter Maydell 提交于
      Switch all the uses of ld/st*_phys to address_space_ld/st*,
      except for those cases where the address space is the CPU's
      (ie cs->as). This was done with the following script which
      generates a Coccinelle patch.
      
      A few over-80-columns lines in the result were rewrapped by
      hand where Coccinelle failed to do the wrapping automatically,
      as well as one location where it didn't put a line-continuation
      '\' when wrapping lines on a change made to a match inside
      a macro definition.
      
      ===begin===
      #!/bin/sh -e
      # Usage:
      # ./ldst-phys.spatch.sh > ldst-phys.spatch
      # spatch -sp_file ldst-phys.spatch -dir . | sed -e '/^+/s/\t/        /g' > out.patch
      # patch -p1 < out.patch
      
      for FN in ub uw_le uw_be l_le l_be q_le q_be uw l q; do
      cat <<EOF
      @ cpu_matches_ld_${FN} @
      expression E1,E2;
      identifier as;
      @@
      
      ld${FN}_phys(E1->as,E2)
      
      @ other_matches_ld_${FN} depends on !cpu_matches_ld_${FN} @
      expression E1,E2;
      @@
      
      -ld${FN}_phys(E1,E2)
      +address_space_ld${FN}(E1,E2, MEMTXATTRS_UNSPECIFIED, NULL)
      
      EOF
      
      done
      
      for FN in b w_le w_be l_le l_be q_le q_be w l q; do
      cat <<EOF
      @ cpu_matches_st_${FN} @
      expression E1,E2,E3;
      identifier as;
      @@
      
      st${FN}_phys(E1->as,E2,E3)
      
      @ other_matches_st_${FN} depends on !cpu_matches_st_${FN} @
      expression E1,E2,E3;
      @@
      
      -st${FN}_phys(E1,E2,E3)
      +address_space_st${FN}(E1,E2,E3, MEMTXATTRS_UNSPECIFIED, NULL)
      
      EOF
      
      done
      ===endit===
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@xilinx.com>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      42874d3a