Skip to content
Snippets Groups Projects
  1. Jan 12, 2021
  2. Jan 11, 2021
  3. Jan 06, 2021
  4. Jan 04, 2021
    • Jiaxun Yang's avatar
      tests/acceptance: Test boot_linux_console for fuloong2e · 45702729
      Jiaxun Yang authored
      
      The kernel comes from debian archive so it's trusted.
      
      Invoking the test can be done as follows:
      
        $ avocado --show=app,console run -t machine:fuloong2e tests/acceptance/
         (1/1) tests/acceptance/boot_linux_console.py:BootLinuxConsole.test_mips64el_fuloong2e:
        console: [    0.000000] Initializing cgroup subsys cpuset
        console: [    0.000000] Initializing cgroup subsys cpu
        console: [    0.000000] Initializing cgroup subsys cpuacct
        console: [    0.000000] Linux version 3.16.0-6-loongson-2e (debian-kernel@lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 Debian 3.16.56-1+deb8u1 (2018-05-08)
        console: [    0.000000] memsize=256, highmemsize=0
        console: [    0.000000] CpuClock = 533080000
        console: [    0.000000] bootconsole [early0] enabled
        console: [    0.000000] CPU0 revision is: 00006302 (ICT Loongson-2)
        console: [    0.000000] FPU revision is: 00000501
        console: [    0.000000] Checking for the multiply/shift bug... no.
        console: [    0.000000] Checking for the daddiu bug... no.
        console: [    0.000000] Determined physical RAM map:
        console: [    0.000000]  memory: 0000000010000000 @ 0000000000000000 (usable)
        console: [    0.000000]  memory: 0000000004000000 @ 0000000010000000 (reserved)
        console: [    0.000000]  memory: 0000000003ffffff @ 000000001c000001 (reserved)
        console: [    0.000000] Initrd not found or empty - disabling initrd
        console: [    0.000000] Zone ranges:
        console: [    0.000000]   DMA      [mem 0x00000000-0x00ffffff]
        console: [    0.000000]   Normal   [mem 0x01000000-0x0fffffff]
        console: [    0.000000] Movable zone start for each node
        console: [    0.000000] Early memory node ranges
        console: [    0.000000]   node   0: [mem 0x00000000-0x0fffffff]
        console: [    0.000000] Reserving 0MB of memory at 0MB for crashkernel
        console: [    0.000000] Primary instruction cache 64kB, VIPT, direct mapped, linesize 32 bytes.
        console: [    0.000000] Primary data cache 64kB, 4-way, VIPT, no aliases, linesize 32 bytes
        console: [    0.000000] Unified secondary cache 512kB 4-way, linesize 32 bytes.
        console: [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16327
        console: [    0.000000] Kernel command line: printk.time=0 console=ttyS0
        PASS (2.27 s)
      
      Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
      Reviewed-by: default avatarWainer dos Santos Moschetta <wainersm@redhat.com>
      Reviewed-by: default avatarWillian Rampazzo <willianr@redhat.com>
      Reviewed-by: default avatarHuacai Chen <chenhuacai@kernel.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20201224031750.52146-9-jiaxun.yang@flygoat.com>
      [PMD: Added command line example]
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      45702729
  5. Jan 02, 2021
  6. Dec 22, 2020
  7. Dec 21, 2020
  8. Dec 19, 2020
    • Markus Armbruster's avatar
      qobject: Make QString immutable · 4ac76ba4
      Markus Armbruster authored
      
      The functions to modify a QString's string are all unused now.  Drop
      them, and make the string immutable.  Saves 16 bytes per QString on my
      system.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-21-armbru@redhat.com>
      4ac76ba4
    • Markus Armbruster's avatar
      qobject: Drop qstring_get_try_str() · b3119b08
      Markus Armbruster authored
      
      No users left outside tests/, and the ones in tests/ can just as well
      use qstring_get_str().  Do that, and drop the function.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-14-armbru@redhat.com>
      b3119b08
    • Markus Armbruster's avatar
      qobject: Change qobject_to_json()'s value to GString · eab3a467
      Markus Armbruster authored
      
      qobject_to_json() and qobject_to_json_pretty() build a GString, then
      covert it to QString.  Just one of the callers actually needs a
      QString: qemu_rbd_parse_filename().  A few others need a string they
      can modify: qmp_send_response(), qga's send_response(), to_json_str(),
      and qmp_fd_vsend_fds().  The remainder just need a string.
      
      Change qobject_to_json() and qobject_to_json_pretty() to return the
      GString.
      
      qemu_rbd_parse_filename() now has to convert to QString.  All others
      save a QString temporary.  to_json_str() actually becomes a bit
      simpler, because GString provides more convenient modification
      functions.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-6-armbru@redhat.com>
      eab3a467
    • Markus Armbruster's avatar
      qobject: Make qobject_to_json_pretty() take a pretty argument · 6589f459
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201211171152.146877-4-armbru@redhat.com>
      6589f459
    • Markus Armbruster's avatar
      test-visitor-serialization: Clean up test_primitives() · 28f1c1f6
      Markus Armbruster authored
      
      test_primitives() uses union member intmax_t max to compare the
      integer members.  Unspecified behavior.  Has worked fine for many
      years, though.  Clean it up.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-11-armbru@redhat.com>
      28f1c1f6
    • Markus Armbruster's avatar
      test-visitor-serialization: Drop insufficient precision workaround · 2a02c139
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-10-armbru@redhat.com>
      2a02c139
    • Markus Armbruster's avatar
      string-output-visitor: Fix to use sufficient precision · 54addb01
      Markus Armbruster authored
      
      The string output visitor should serialize numbers so that the string
      input visitor deserializes them back to the same number.  It fails to
      do so.
      
      print_type_number() uses format %f.  This is prone to nasty rounding
      errors.  For instance, numbers between 0 and 0.0000005 get flushed to
      zero.
      
      We currently use this visitor only for HMP info migrate, info network,
      info qtree, and info memdev.  No double values occur there as far as I
      can tell.
      
      Fix anyway by formatting with %.17g.  17 decimal digits always suffice
      for IEEE double.
      
      See also recent commit "qobject: Fix qnum_to_string() to use
      sufficient precision".
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-9-armbru@redhat.com>
      54addb01
    • Markus Armbruster's avatar
      test-string-output-visitor: Cover "unround" number · 7b205a73
      Markus Armbruster authored
      
      This demonstrates rounding error due to insufficient precision: double
      3.1415926535897932 gets converted to JSON 3.141593.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-8-armbru@redhat.com>
      7b205a73
    • Markus Armbruster's avatar
      qobject: Fix qnum_to_string() to use sufficient precision · f917eed3
      Markus Armbruster authored
      
      We should serialize numbers to JSON so that they deserialize back to
      the same number.  We fail to do so.
      
      The culprit is qnum_to_string(): it uses format %f with trailing '0'
      trimmed.  Results in pretty output for "nice" numbers, but is prone to
      nasty rounding errors.  For instance, numbers between 0 and 0.0000005
      get flushed to zero.
      
      Where exactly the incorrect rounding can bite is tiresome to gauge.
      Here's my take.
      
      * In QMP output, type 'number':
      
        - query-blockstats value avg_rd_queue_depth
      
        - QMP query-migrate values mbps, cache-miss-rate, encoding-rate,
          busy-rate, compression-rate.
      
        Relatively harmless, I guess.
      
      * In tracing QMP input.  Harmless.
      
      * In qemu-ga output, type 'number': guest-get-users value login-time.
        Harmless.
      
      * In output of HMP qom-get.  Harmless.
      
      Not affected, because double values don't actually occur there (I
      think):
      
      * QMP output, type 'any':
      
        * qom-get value
      
        * qom-list, qom-list-properties value default-value
      
        * query-cpu-model-comparison, query-cpu-model-baseline,
          query-cpu-model-expansion value props.
      
      * qemu-img --output json output.
      
      * "json:" pseudo-filenames generated by bdrv_refresh_filename().
      
      * The rbd block driver's "=keyvalue-pairs" hack.
      
      * In -object help on property default values.  Aside: use of JSON
        feels inappropriate here.
      
      * Output of HMP qom-get.
      
      * Argument conversion to QemuOpts for qdev_device_add() and HMP with
        qemu_opts_from_qdict()
      
        QMP and HMP device_add, virtio-net failover primary creation,
        xen-usb "usb-host" creation, HMP netdev_add, object_add.
      
      * The uses of qobject_input_visitor_new_flat_confused()
      
        As far as I can tell, none of the visited types contain double
        values.
      
      * Dumping ImageInfoSpecific with dump_qobject()
      
      Fix by formatting with %.17g.  17 decimal digits always suffice for
      IEEE double.
      
      The change to expected test output illustrates the effect: the
      rounding errors are gone, but some seemingly "nice" numbers now get
      converted to not so nice strings, e.g. 0.42 to "0.41999999999999998".
      This is because 0.42 is not representable exactly in double.  It's
      more accurate in this example than strictly necessary, though.
      
      If ugly accuracy bothers us, we can we can try using the least number
      of digits that still converts back to the same double.  In this
      example, "0.42" would do.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-7-armbru@redhat.com>
      f917eed3
    • Markus Armbruster's avatar
      tests/check-qnum: Cover qnum_to_string() for "unround" argument · 1a907691
      Markus Armbruster authored
      
      qnum_to_string() has a FIXME comment about rounding errors due to
      insufficient precision.  Cover it: 2.718281828459045 gets converted to
      "2.718282".  The next commit will fix it.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-6-armbru@redhat.com>
      1a907691
    • Markus Armbruster's avatar
      tests/check-qjson: Replace redundant large_number() · 780df5d4
      Markus Armbruster authored
      
      Move one of large_number()'s three checks to uint_number(), and the
      other two to float_number().
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-5-armbru@redhat.com>
      780df5d4
    • Markus Armbruster's avatar
      tests/check-qjson: Cover number 2^63 · 4aea8833
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-4-armbru@redhat.com>
      4aea8833
    • Markus Armbruster's avatar
      tests/check-qjson: Examine QNum more thoroughly · 1a68eb8c
      Markus Armbruster authored
      
      simple_number() checks only qnum_get_try_int().  Also check
      qnum_get_try_uint() and qnum_get_double().
      
      float_number() checks only qnum_get_double().  Also check
      qnum_get_try_int() and qnum_get_try_uint().
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-3-armbru@redhat.com>
      1a68eb8c
    • Markus Armbruster's avatar
      tests/check-qjson: Don't skip funny QNumber to JSON conversions · 3953f826
      Markus Armbruster authored
      
      simple_number() and float_number() convert from JSON to QNumber and
      back.
      
      simple_number() tests "-0", but skips the conversion back to JSON,
      because it yields "0", not "-0".  Works as intended, so better cover
      it: don't skip, but expect the funny result.
      
      float_number() tests "-32.20e-10", but skips the conversion back to
      JSON, because it yields "-0".  This is a known bug in
      qnum_to_string(), marked FIXME there.  Cover the bug: don't skip, but
      expect the funny result.
      
      While there, switch from g_assert() to g_assert_cmpstr() & friends for
      friendlier test failures.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20201210161452.2813491-2-armbru@redhat.com>
      3953f826
    • Eric Blake's avatar
      qapi: Use QAPI_LIST_PREPEND() where possible · 54aa3de7
      Eric Blake authored
      
      Anywhere we create a list of just one item or by prepending items
      (typically because order doesn't matter), we can use
      QAPI_LIST_PREPEND().  But places where we must keep the list in order
      by appending remain open-coded until later patches.
      
      Note that as a side effect, this also performs a cleanup of two minor
      issues in qga/commands-posix.c: the old code was performing
       new = g_malloc0(sizeof(*ret));
      which 1) is confusing because you have to verify whether 'new' and
      'ret' are variables with the same type, and 2) would conflict with C++
      compilation (not an actual problem for this file, but makes
      copy-and-paste harder).
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20201113011340.463563-5-eblake@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      [Straightforward conflicts due to commit a8aa94b5 "qga: update
      schema for guest-get-disks 'dependents' field" and commit a10b453a
      "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c"
      resolved.  Commit message tweaked.]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      54aa3de7
  9. Dec 18, 2020
    • Hanna Reitz's avatar
      iotests: Fix _send_qemu_cmd with bash 5.1 · 0e720781
      Hanna Reitz authored
      
      With bash 5.1, the output of the following script changes:
      
        a=("double  space")
        a=${a[@]:0:1}
        echo "$a"
      
      from "double space" to "double  space", i.e. all white space is
      preserved as-is.  This is probably what we actually want here (judging
      from the "...to accommodate pathnames with spaces" comment), but before
      5.1, we would have to quote the ${} slice to get the same behavior.
      
      In any case, without quoting, the reference output of many iotests is
      different between bash 5.1 and pre-5.1, which is not very good.  The
      output of 5.1 is what we want, so whatever we do to get pre-5.1 to the
      same result, it means we have to fix the reference output of basically
      all tests that invoke _send_qemu_cmd (except the ones that only use
      single spaces in the commands they invoke).
      
      Instead of quoting the ${} slice (cmd="${$@: 1:...}"), we can also just
      not use array slicing and replace the whole thing with a simple "cmd=$1;
      shift", which works because all callers quote the whole $cmd argument
      anyway.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201217153803.101231-3-mreitz@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      0e720781
    • Hanna Reitz's avatar
      iotests/102: Pass $QEMU_HANDLE to _send_qemu_cmd · 0c8fbfb9
      Hanna Reitz authored
      
      The first parameter passed to _send_qemu_cmd is supposed to be the
      $QEMU_HANDLE.  102 does not do so here, fix it.
      
      As a result, the output changes: Now we see the prompt this command is
      supposedly waiting for before the resize message - as it should be.
      
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-Id: <20201217153803.101231-2-mreitz@redhat.com>
      Reviewed-by: default avatarKevin Wolf <kwolf@redhat.com>
      0c8fbfb9
    • Alberto Garcia's avatar
      quorum: Implement bdrv_co_pwrite_zeroes() · 5cddb2e9
      Alberto Garcia authored
      
      This simply calls bdrv_co_pwrite_zeroes() in all children.
      
      bs->supported_zero_flags is also set to the flags that are supported
      by all children.
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Message-Id: <2f09c842781fe336b4c2e40036bba577b7430190.1605286097.git.berto@igalia.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      5cddb2e9
Loading