qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] cccb79: QemuOpts: Convert qemu_opt_set_bool()


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] cccb79: QemuOpts: Convert qemu_opt_set_bool() to Error, fi...
Date: Tue, 03 Mar 2015 02:30:08 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: cccb7967bdf19f9d31e65d2d07d4d311e07545c4
      
https://github.com/qemu/qemu/commit/cccb7967bdf19f9d31e65d2d07d4d311e07545c4
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M blockdev.c
    M include/qemu/option.h
    M tests/test-qemu-opts.c
    M util/qemu-option.c
    M util/qemu-sockets.c
    M vl.c

  Log Message:
  -----------
  QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use

Return the Error object instead of reporting it with
qerror_report_err().

Change callers that assume the function can't fail to pass
&error_abort, so that should the assumption ever break, it'll break
noisily.

Turns out all callers outside its unit test assume that.  We could
drop the Error ** argument, but that would make the interface less
regular, so don't.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 39101f2511f6adf1ae4380f8d729dba1213b9d7a
      
https://github.com/qemu/qemu/commit/39101f2511f6adf1ae4380f8d729dba1213b9d7a
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M block.c
    M block/nbd.c
    M block/qcow2.c
    M block/vvfat.c
    M include/qemu/option.h
    M qemu-img.c
    M tests/test-qemu-opts.c
    M util/qemu-option.c
    M vl.c

  Log Message:
  -----------
  QemuOpts: Convert qemu_opt_set_number() to Error, fix its use

Return the Error object instead of reporting it with
qerror_report_err().

Change callers that assume the function can't fail to pass
&error_abort, so that should the assumption ever break, it'll break
noisily.

Turns out all callers outside its unit test assume that.  We could
drop the Error ** argument, but that would make the interface less
regular, so don't.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 79087c782e1549a6f9c8303aafc0b74f4e637756
      
https://github.com/qemu/qemu/commit/79087c782e1549a6f9c8303aafc0b74f4e637756
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M include/qemu/option.h
    M net/net.c
    M tests/test-qemu-opts.c
    M util/qemu-option.c
    M vl.c

  Log Message:
  -----------
  QemuOpts: Convert qemu_opts_set() to Error, fix its use

Return the Error object instead of reporting it with
qerror_report_err().

Change callers that assume the function can't fail to pass
&error_abort, so that should the assumption ever break, it'll break
noisily.

Turns out all callers outside its unit test assume that.  We could
drop the Error ** argument, but that would make the interface less
regular, so don't.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 6750e795b167e3defab36502e61b8c57ede119eb
      
https://github.com/qemu/qemu/commit/6750e795b167e3defab36502e61b8c57ede119eb
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M qemu-img.c

  Log Message:
  -----------
  qemu-img: Suppress unhelpful extra errors in convert, resize

add_old_style_options() for img_convert() and img_resize() use
qemu_opt_set(), which reports errors with qerror_report_err().  Its
error messages aren't helpful here, the caller reports one that
actually makes sense.  Reproducer:

    $ qemu-img convert -B raw in.img out.img
    qemu-img: Invalid parameter 'backing_file'
    qemu-img: Backing file not supported for file format 'raw'

Switch to qemu_opt_set_err() to get rid of the unwanted messages.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 6be4194b9215ed29f258543ce34a1b4b2003864d
      
https://github.com/qemu/qemu/commit/6be4194b9215ed29f258543ce34a1b4b2003864d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M block.c

  Log Message:
  -----------
  block: Suppress unhelpful extra errors in bdrv_img_create()

bdrv_img_create() uses qemu_opt_set(), which reports errors with
qerror_report_err().  Its error messages aren't helpful here, the
caller reports one that actually makes sense.  I don't know how to
trigger the error conditions, though.

Switch to qemu_opt_set_err() to get rid of the unwanted messages.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: f43e47dbf6de24db20ec9b588bb6cc762093dd69
      
https://github.com/qemu/qemu/commit/f43e47dbf6de24db20ec9b588bb6cc762093dd69
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M block.c
    M block/qcow2.c
    M block/vvfat.c
    M blockdev.c
    M hw/pci/pci-hotplug-old.c
    M hw/usb/dev-network.c
    M hw/usb/dev-storage.c
    M hw/watchdog/watchdog.c
    M include/qemu/option.h
    M net/net.c
    M qdev-monitor.c
    M qemu-char.c
    M qemu-img.c
    M tests/test-qemu-opts.c
    M util/qemu-config.c
    M util/qemu-option.c
    M util/qemu-sockets.c
    M vl.c

  Log Message:
  -----------
  QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use

qemu_opt_set() is a wrapper around qemu_opt_set() that reports the
error with qerror_report_err().

Most of its users assume the function can't fail.  Make them use
qemu_opt_set_err() with &error_abort, so that should the assumption
ever break, it'll break noisily.

Just two users remain, in util/qemu-config.c.  Switch them to
qemu_opt_set_err() as well, then rename qemu_opt_set_err() to
qemu_opt_set().

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: d93ae3cfb9ec36ea53d8ff24af812db6dd9bb62a
      
https://github.com/qemu/qemu/commit/d93ae3cfb9ec36ea53d8ff24af812db6dd9bb62a
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  QemuOpts: Propagate errors through opts_do_parse()

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 4f81273dd9e036f9009ab902a2617a1167cf796d
      
https://github.com/qemu/qemu/commit/4f81273dd9e036f9009ab902a2617a1167cf796d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M util/qemu-option.c

  Log Message:
  -----------
  QemuOpts: Propagate errors through opts_parse()

Since I'm touching qemu_opts_parse() anyway, write a function comment
for it.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: dc523cd348c47372faa7271c9aab2030f94c290d
      
https://github.com/qemu/qemu/commit/dc523cd348c47372faa7271c9aab2030f94c290d
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M block.c
    M include/qemu/option.h
    M qemu-char.c
    M qemu-img.c
    M util/qemu-option.c

  Log Message:
  -----------
  qemu-img: Suppress unhelpful extra errors in convert, amend

img_convert() and img_amend() use qemu_opts_do_parse(), which reports
errors with qerror_report_err().  Its error messages aren't helpful
here, the caller reports one that actually makes sense.  Reproducer:

    $ qemu-img convert -o backing_format=raw in.img out.img
    qemu-img: Invalid parameter 'backing_format'
    qemu-img: Invalid options for file format 'raw'

To fix, propagate errors through qemu_opts_do_parse().  This lifts the
error reporting into callers.  Drop it from img_convert() and
img_amend(), keep it in qemu_chr_parse_compat(), bdrv_img_create().

Since I'm touching qemu_opts_do_parse() anyway, write a function
comment for it.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: a8b18f8fd2d9f0df33c3739e76fedfd9355dfa8b
      
https://github.com/qemu/qemu/commit/a8b18f8fd2d9f0df33c3739e76fedfd9355dfa8b
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M blockdev.c
    M vl.c

  Log Message:
  -----------
  block: Simplify setting numeric options

Don't convert numbers to strings for use with qemu_opt_set(), simply
use qemu_opt_set_number() instead.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 62b3de693469508a58864bffefd3d54f897558b4
      
https://github.com/qemu/qemu/commit/62b3de693469508a58864bffefd3d54f897558b4
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M util/qemu-sockets.c

  Log Message:
  -----------
  qemu-sockets: Simplify setting numeric and boolean options

Don't convert numbers or bools to strings for use with qemu_opt_set(),
simply use qemu_opt_set_number() or qemu_opt_set_bool() instead.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 5bdb59a290cfc7332fdc23c6368310e0327e3828
      
https://github.com/qemu/qemu/commit/5bdb59a290cfc7332fdc23c6368310e0327e3828
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M hw/i386/pc.c

  Log Message:
  -----------
  pc: Use qemu_opt_set() instead of qemu_opts_parse()

Less code, same result.

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: b3adf5acb57dee14a74e57ab4f16cd1a83e5a7d2
      
https://github.com/qemu/qemu/commit/b3adf5acb57dee14a74e57ab4f16cd1a83e5a7d2
  Author: Markus Armbruster <address@hidden>
  Date:   2015-02-26 (Thu, 26 Feb 2015)

  Changed paths:
    M qtest.c

  Log Message:
  -----------
  qtest: Use qemu_opt_set() instead of qemu_opts_parse()

Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>


  Commit: 5efde22aa781d37df58f0060430f459491dcfd62
      
https://github.com/qemu/qemu/commit/5efde22aa781d37df58f0060430f459491dcfd62
  Author: Peter Maydell <address@hidden>
  Date:   2015-03-03 (Tue, 03 Mar 2015)

  Changed paths:
    M block.c
    M block/nbd.c
    M block/qcow2.c
    M block/vvfat.c
    M blockdev.c
    M hw/i386/pc.c
    M hw/pci/pci-hotplug-old.c
    M hw/usb/dev-network.c
    M hw/usb/dev-storage.c
    M hw/watchdog/watchdog.c
    M include/qemu/option.h
    M net/net.c
    M qdev-monitor.c
    M qemu-char.c
    M qemu-img.c
    M qtest.c
    M tests/test-qemu-opts.c
    M util/qemu-config.c
    M util/qemu-option.c
    M util/qemu-sockets.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-26' into 
staging

QemuOpts: Convert various setters to Error

# gpg: Signature made Thu Feb 26 13:56:43 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <address@hidden>"
# gpg:                 aka "Markus Armbruster <address@hidden>"

* remotes/armbru/tags/pull-error-2015-02-26:
  qtest: Use qemu_opt_set() instead of qemu_opts_parse()
  pc: Use qemu_opt_set() instead of qemu_opts_parse()
  qemu-sockets: Simplify setting numeric and boolean options
  block: Simplify setting numeric options
  qemu-img: Suppress unhelpful extra errors in convert, amend
  QemuOpts: Propagate errors through opts_parse()
  QemuOpts: Propagate errors through opts_do_parse()
  QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
  block: Suppress unhelpful extra errors in bdrv_img_create()
  qemu-img: Suppress unhelpful extra errors in convert, resize
  QemuOpts: Convert qemu_opts_set() to Error, fix its use
  QemuOpts: Convert qemu_opt_set_number() to Error, fix its use
  QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/0856579cac2f...5efde22aa781

reply via email to

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