1. 15 8月, 2018 1 次提交
  2. 10 7月, 2018 1 次提交
  3. 29 6月, 2018 1 次提交
  4. 18 6月, 2018 1 次提交
  5. 15 6月, 2018 1 次提交
  6. 02 6月, 2018 1 次提交
  7. 01 6月, 2018 1 次提交
  8. 26 1月, 2018 2 次提交
    • F
      usb-storage: Fix share-rw option parsing · 395b9539
      Fam Zheng 提交于
      Because usb-storage creates an internal scsi device, we should propagate
      options. We already do so for bootindex etc, but failed to take care of
      share-rw. Fix it in an apparent way: add a new parameter to
      scsi_bus_legacy_add_drive and pass in s->conf.share_rw.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NDarren Kenny <darren.kenny@oracle.com>
      Message-id: 20180117005222.4781-1-famz@redhat.com
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      395b9539
    • T
      usb: Remove legacy -usbdevice options (host, serial, disk and net) · 99761176
      Thomas Huth 提交于
      The option have been marked as deprecated since QEMU 2.10, and so far
      nobody complained that the host, serial, disk and net options are urgently
      required anymore. So let's now get rid at least of this legacy pile, to
      simplify the usb code quite a bit.
      
      This patch removes the usbdevices host, serial, disk and net. These devices
      use their own complicated parameter parsing mechanisms, so they are just
      ugly to maintain, without real benefit for the users (the users can use the
      corresponding "-device" parameters instead which have the same complexity
      as the "-usbdevice" devices here).
      
      Note that the other rather simple -usbdevice options (mouse, tablet, etc.)
      are not removed yet (the code is really simple here, so it does not hurt
      much to keep it), as well as the two devices "braille" and "bt" which are
      easier to use with -usbdevice than with -device.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Message-id: 1515519171-20315-1-git-send-email-thuth@redhat.com
      
      [kraxel] delete some usb_host_device_open() leftovers.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      99761176
  9. 19 12月, 2017 2 次提交
  10. 01 3月, 2017 2 次提交
  11. 13 7月, 2016 2 次提交
    • K
      block/qdev: Allow configuring WCE with qdev properties · f6166a06
      Kevin Wolf 提交于
      As cache.writeback is a BlockBackend property and as such more related
      to the guest device than the BlockDriverState, we already removed it
      from the blockdev-add interface. This patch adds the new way to set it,
      as a qdev property of the corresponding guest device.
      
      For example: -drive if=none,file=test.img,node-name=img
                   -device ide-hd,drive=img,write-cache=off
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      f6166a06
    • K
      block/qdev: Allow node name for drive properties · 8daea510
      Kevin Wolf 提交于
      If a node name instead of a BlockBackend name is specified as the driver
      for a guest device, an anonymous BlockBackend is created now.
      
      The order of operations in release_drive() must be reversed in order to
      avoid a use-after-free bug because now blk_detach_dev() frees the last
      reference if an anonymous BlockBackend is used.
      
      usb-storage uses a hack where it forwards its BlockBackend as a property
      to another device that it internally creates. This hack must be updated
      so that it doesn't drop its original BB before it can be passed to the
      other device. This used to work because we always had the monitor
      reference around, but with node-names the device reference is the only
      one now.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      8daea510
  12. 22 6月, 2016 2 次提交
  13. 20 6月, 2016 1 次提交
  14. 23 3月, 2016 2 次提交
    • V
      util: move declarations out of qemu-common.h · f348b6d1
      Veronia Bahaa 提交于
      Move declarations out of qemu-common.h for functions declared in
      utils/ files: e.g. include/qemu/path.h for utils/path.c.
      Move inline functions out of qemu-common.h and into new files (e.g.
      include/qemu/bcd.h)
      Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f348b6d1
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  15. 09 2月, 2016 2 次提交
    • E
      qom: Swap 'name' next to visitor in ObjectPropertyAccessor · d7bce999
      Eric Blake 提交于
      Similar to the previous patch, it's nice to have all functions
      in the tree that involve a visitor and a name for conversion to
      or from QAPI to consistently stick the 'name' parameter next
      to the Visitor parameter.
      
      Done by manually changing include/qom/object.h and qom/object.c,
      then running this Coccinelle script and touching up the fallout
      (Coccinelle insisted on adding some trailing whitespace).
      
          @ rule1 @
          identifier fn;
          typedef Object, Visitor, Error;
          identifier obj, v, opaque, name, errp;
          @@
           void fn
          - (Object *obj, Visitor *v, void *opaque, const char *name,
          + (Object *obj, Visitor *v, const char *name, void *opaque,
             Error **errp) { ... }
      
          @@
          identifier rule1.fn;
          expression obj, v, opaque, name, errp;
          @@
           fn(obj, v,
          -   opaque, name,
          +   name, opaque,
              errp)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-20-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      d7bce999
    • E
      qapi: Swap visit_* arguments for consistent 'name' placement · 51e72bc1
      Eric Blake 提交于
      JSON uses "name":value, but many of our visitor interfaces were
      called with visit_type_FOO(v, &value, name, errp).  This can be
      a bit confusing to have to mentally swap the parameter order to
      match JSON order.  It's particularly bad for visit_start_struct(),
      where the 'name' parameter is smack in the middle of the
      otherwise-related group of 'obj, kind, size' parameters! It's
      time to do a global swap of the parameter ordering, so that the
      'name' parameter is always immediately after the Visitor argument.
      
      Additional reason in favor of the swap: the existing include/qjson.h
      prefers listing 'name' first in json_prop_*(), and I have plans to
      unify that file with the qapi visitors; listing 'name' first in
      qapi will minimize churn to the (admittedly few) qjson.h clients.
      
      Later patches will then fix docs, object.h, visitor-impl.h, and
      those clients to match.
      
      Done by first patching scripts/qapi*.py by hand to make generated
      files do what I want, then by running the following Coccinelle
      script to affect the rest of the code base:
       $ spatch --sp-file script `git grep -l '\bvisit_' -- '**/*.[ch]'`
      I then had to apply some touchups (Coccinelle insisted on TAB
      indentation in visitor.h, and botched the signature of
      visit_type_enum() by rewriting 'const char *const strings[]' to
      the syntactically invalid 'const char*const[] strings').  The
      movement of parameters is sufficient to provoke compiler errors
      if any callers were missed.
      
          // Part 1: Swap declaration order
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_start_struct
          -(TV v, TObj OBJ, T1 ARG1, const char *name, T2 ARG2, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type bool, TV, T1;
          identifier ARG1;
          @@
           bool visit_optional
          -(TV v, T1 ARG1, const char *name)
          +(TV v, const char *name, T1 ARG1)
           { ... }
      
          @@
          type TV, TErr, TObj, T1;
          identifier OBJ, ARG1;
          @@
           void visit_get_next_type
          -(TV v, TObj OBJ, T1 ARG1, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj, T1, T2;
          identifier OBJ, ARG1, ARG2;
          @@
           void visit_type_enum
          -(TV v, TObj OBJ, T1 ARG1, T2 ARG2, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, T1 ARG1, T2 ARG2, TErr errp)
           { ... }
      
          @@
          type TV, TErr, TObj;
          identifier OBJ;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
           void VISIT_TYPE
          -(TV v, TObj OBJ, const char *name, TErr errp)
          +(TV v, const char *name, TObj OBJ, TErr errp)
           { ... }
      
          // Part 2: swap caller order
          @@
          expression V, NAME, OBJ, ARG1, ARG2, ERR;
          identifier VISIT_TYPE =~ "^visit_type_";
          @@
          (
          -visit_start_struct(V, OBJ, ARG1, NAME, ARG2, ERR)
          +visit_start_struct(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -visit_optional(V, ARG1, NAME)
          +visit_optional(V, NAME, ARG1)
          |
          -visit_get_next_type(V, OBJ, ARG1, NAME, ERR)
          +visit_get_next_type(V, NAME, OBJ, ARG1, ERR)
          |
          -visit_type_enum(V, OBJ, ARG1, ARG2, NAME, ERR)
          +visit_type_enum(V, NAME, OBJ, ARG1, ARG2, ERR)
          |
          -VISIT_TYPE(V, OBJ, NAME, ERR)
          +VISIT_TYPE(V, NAME, OBJ, ERR)
          )
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1454075341-13658-19-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      51e72bc1
  16. 29 1月, 2016 1 次提交
    • P
      usb: Clean up includes · e532b2e0
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1453832250-766-20-git-send-email-peter.maydell@linaro.org
      e532b2e0
  17. 24 10月, 2015 1 次提交
  18. 23 6月, 2015 1 次提交
  19. 08 5月, 2015 1 次提交
  20. 17 3月, 2015 3 次提交
    • M
      usb/dev-storage: Avoid qerror_report_err() outside QMP handlers · c326529b
      Markus Armbruster 提交于
      qerror_report_err() is a transitional interface to help with
      converting existing monitor commands to QMP.  It should not be used
      elsewhere.
      
      usb_msd_password_cb() is only called from within an HMP command
      handler.  Replace by error_report_err().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      c326529b
    • M
      usb/dev-storage: Fix QMP device_add missing encryption key failure · 7afcc1f9
      Markus Armbruster 提交于
      When the image is encrypted, QMP device_add creates the device, defers
      actually attaching it to when the key becomes available, then returns
      an error.  This is wrong.  device_add must either create the device
      and succeed, or do nothing and fail.
      
      The bug is in usb_msd_realize_storage().  It posts an error with
      qerror_report_err(), and returns success.  Device realization relies
      on the return value, and completes.  The QMP monitor, however, relies
      on the posted error, and sends it in an error reply.
      
      Reproducer:
      
          $ qemu-system-x86_64 -nodefaults -display none -usb -qmp stdio -drive if=none,id=foo,file=geheim.qcow2
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 2, "major": 2}, "package": ""}, "capabilities": []}}
          { "execute": "qmp_capabilities" }
          {"return": {}}
          { "execute": "device_add", "arguments": { "driver": "usb-storage", "id": "bar", "drive": "foo" } }
          {"error": {"class": "DeviceEncrypted", "desc": "'foo' (geheim.qcow2) is encrypted"}}
      
      Even though we got an error back, the device got created just fine.
      To demonstrate, let's unplug it again:
      
          {"execute":"device_del","arguments": { "id": "bar" } }
          {"timestamp": {"seconds": 1426003440, "microseconds": 237181}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/bar/bar.0/legacy[0]"}}
          {"timestamp": {"seconds": 1426003440, "microseconds": 238231}, "event": "DEVICE_DELETED", "data": {"device": "bar", "path": "/machine/peripheral/bar"}}
          {"return": {}}
      
      Fix by making usb_msd_realize_storage() fail properly.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      7afcc1f9
    • M
      monitor usb: Inline monitor_read_bdrv_key_start()'s first part · 9b14e0ef
      Markus Armbruster 提交于
      monitor_read_bdrv_key_start() does several things:
      
      1. If no key is needed, call completion_cb() and succeed
      
      2. If we're in QMP context, call qerror_report_err() and fail
      
      3. Start reading the key in the monitor.
      
      This is two things too many.  Inline 1. and 2. into its callers
      monitor_read_block_device_key() and usb_msd_realize_storage().
      
      Since monitor_read_block_device_key() only ever runs in HMP context,
      drop 2. there.
      
      The next commit will clean up the result in usb_msd_realize_storage().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      9b14e0ef
  21. 10 3月, 2015 2 次提交
    • E
      BlockConf: Call backend functions to detect geometry and blocksizes · 0eb28a42
      Ekaterina Tumanova 提交于
      geometry: hd_geometry_guess function autodetects the drive geometry.
      This patch adds a block backend call, that probes the backing device
      geometry. If the inner driver method is implemented and succeeds
      (currently only for DASDs), the blkconf_geometry will pass-through
      the backing device geometry. Otherwise will fallback to old logic.
      
      blocksize: This patch initializes blocksize properties to 0.
      In order to set the property a blkconf_blocksizes was introduced.
      If user didn't set physical or logical blocksize, it will
      retrieve its value from a driver (only succeeds for DASD), otherwise
      it will set default 512 value.
      
      The blkconf_blocksizes call was added to all users of BlkConf.
      Signed-off-by: NEkaterina Tumanova <tumanova@linux.vnet.ibm.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 1424087278-49393-6-git-send-email-tumanova@linux.vnet.ibm.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0eb28a42
    • M
      hw: Propagate errors through qdev_prop_set_drive() · 9b3d111a
      Markus Armbruster 提交于
      Three kinds of callers:
      
      1. On failure, report the error and abort
      
         Passing &error_abort does the job.  No functional change.
      
      2. On failure, report the error and exit()
      
         This is qdev_prop_set_drive_nofail().  Error reporting moves from
         qdev_prop_set_drive() to its caller.  Because hiding away the error
         in the monitor right before exit() isn't helpful, replace
         qerror_report_err() by error_report_err().  Shouldn't make a
         difference, because qdev_prop_set_drive_nofail() should never be
         used in QMP context.
      
      3. On failure, report the error and recover
      
         This is usb_msd_init() and scsi_bus_legacy_add_drive().  Error
         reporting and freeing the error object moves from
         qdev_prop_set_drive() to its callers.
      
         Because usb_msd_init() can't run in QMP context, replace
         qerror_report_err() by error_report_err() there.
      
         No functional change.
      
         scsi_bus_legacy_add_drive() calling qerror_report_err() is of
         course inappropriate, but this commit merely makes it more obvious.
         The next one will clean it up.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Message-Id: <1425925048-15482-3-git-send-email-armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9b3d111a
  22. 26 2月, 2015 1 次提交
  23. 18 2月, 2015 2 次提交
  24. 20 10月, 2014 2 次提交
  25. 15 10月, 2014 4 次提交