Skip to content
Snippets Groups Projects
  1. Sep 19, 2017
    • Alistair Francis's avatar
      General warn report fixups · b62e39b4
      Alistair Francis authored
      
      Tidy up some of the warn_report() messages after having converted them
      to use warn_report().
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <9cb1d23551898c9c9a5f84da6773e99871285120.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b62e39b4
    • Alistair Francis's avatar
      Convert multi-line fprintf() to warn_report() · 8297be80
      Alistair Francis authored
      
      Convert all the multi-line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using these commands:
        find ./* -type f -exec sed -i \
          'N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
      
      Indentation fixed up manually afterwards.
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters. Some of the lines with newlines in the middle of the
      string were also manually edit to avoid checkpatch errrors.
      
      The #include lines were manually updated to allow the code to compile.
      
      Several of the warning messages can be improved after this patch, to
      keep this patch mechanical this has been moved into a later patch.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <5def63849ca8f551630c6f2b45bcb1c482f765a6.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8297be80
    • Alistair Francis's avatar
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis authored
      
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
  2. Sep 08, 2017
  3. Sep 04, 2017
  4. Aug 09, 2017
  5. Aug 02, 2017
  6. Aug 01, 2017
    • Yunjian Wang's avatar
      vhost-user: fix watcher need be removed when vhost-user hotplug · 41d4e5ec
      Yunjian Wang authored
      
      "nc" is freed after hotplug vhost-user, but the watcher is not removed.
      The QEMU crash when the watcher access the "nc" when socket disconnects.
      
          Program received signal SIGSEGV, Segmentation fault.
          #0  object_get_class (obj=obj@entry=0x2) at qom/object.c:750
          #1  0x00007f9bb4180da1 in qemu_chr_fe_disconnect (be=<optimized out>) at chardev/char-fe.c:372
          #2  0x00007f9bb40d1100 in net_vhost_user_watch (chan=<optimized out>, cond=<optimized out>, opaque=<optimized out>) at net/vhost-user.c:188
          #3  0x00007f9baf97f99a in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
          #4  0x00007f9bb41d7ebc in glib_pollfds_poll () at util/main-loop.c:213
          #5  os_host_main_loop_wait (timeout=<optimized out>) at util/main-loop.c:261
          #6  main_loop_wait (nonblocking=nonblocking@entry=0) at util/main-loop.c:515
          #7  0x00007f9bb3e266a7 in main_loop () at vl.c:1917
          #8  main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4786
      
      Signed-off-by: default avatarYunjian Wang <wangyunjian@huawei.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      41d4e5ec
    • Vladimir Sementsov-Ogievskiy's avatar
      trace-events: fix code style: print 0x before hex numbers · 8908eb1a
      Vladimir Sementsov-Ogievskiy authored
      
      The only exception are groups of numers separated by symbols
      '.', ' ', ':', '/', like 'ab.09.7d'.
      
      This patch is made by the following:
      
      > find . -name trace-events | xargs python script.py
      
      where script.py is the following python script:
      =========================
       #!/usr/bin/env python
      
      import sys
      import re
      import fileinput
      
      rhex = '%[-+ *.0-9]*(?:[hljztL]|ll|hh)?(?:x|X|"\s*PRI[xX][^"]*"?)'
      rgroup = re.compile('((?:' + rhex + '[.:/ ])+' + rhex + ')')
      rbad = re.compile('(?<!0x)' + rhex)
      
      files = sys.argv[1:]
      
      for fname in files:
          for line in fileinput.input(fname, inplace=True):
              arr = re.split(rgroup, line)
              for i in range(0, len(arr), 2):
                  arr[i] = re.sub(rbad, '0x\g<0>', arr[i])
      
              sys.stdout.write(''.join(arr))
      =========================
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Message-id: 20170731160135.12101-5-vsementsov@virtuozzo.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      8908eb1a
    • Stefan Hajnoczi's avatar
      trace: add trace_event_get_state_backends() · d87aa138
      Stefan Hajnoczi authored
      
      Code that checks dstate is unaware of SystemTap and LTTng UST dstate, so
      the following trace event will not fire when solely enabled by SystemTap
      or LTTng UST:
      
        if (trace_event_get_state(TRACE_MY_EVENT)) {
            str = g_strdup_printf("Expensive string to generate ...",
                                  ...);
            trace_my_event(str);
            g_free(str);
        }
      
      Add trace_event_get_state_backends() to fetch backend dstate.  Those
      backends that use QEMU dstate fetch it as part of
      generate_h_backend_dstate().
      
      Update existing trace_event_get_state() callers to use
      trace_event_get_state_backends() instead.
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20170731140718.22010-3-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      d87aa138
  7. Jul 31, 2017
  8. Jul 17, 2017
  9. Jul 14, 2017
  10. Jul 13, 2017
    • Alistair Francis's avatar
      Convert error_report() to warn_report() · 3dc6f869
      Alistair Francis authored
      
      Convert all uses of error_report("warning:"... to use warn_report()
      instead. This helps standardise on a single method of printing warnings
      to the user.
      
      All of the warnings were changed using these two commands:
          find ./* -type f -exec sed -i \
            's|error_report(".*warning[,:] |warn_report("|Ig' {} +
      
      Indentation fixed up manually afterwards.
      
      The test-qdev-global-props test case was manually updated to ensure that
      this patch passes make check (as the test cases are case sensitive).
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: default avatarThomas Huth <thuth@redhat.com>
      Cc: Jeff Cody <jcody@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Lieven <pl@kamp.de>
      Cc: Josh Durgin <jdurgin@redhat.com>
      Cc: "Richard W.M. Jones" <rjones@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Greg Kurz <groug@kaod.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Peter Chubb <peter.chubb@nicta.com.au>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: default avatarGreg Kurz <groug@kaod.org>
      Acked-by: default avatarCornelia Huck <cohuck@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed by: Peter Chubb <peter.chubb@data61.csiro.au>
      Acked-by: default avatarMax Reitz <mreitz@redhat.com>
      Acked-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
      Message-Id: <e1cfa2cd47087c248dd24caca9c33d9af0c499b0.1499866456.git.alistair.francis@xilinx.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      3dc6f869
  11. Jun 20, 2017
  12. Jun 07, 2017
    • Daniel P. Berrangé's avatar
      Revert "Change net/socket.c to use socket_*() functions" again · 6701e551
      Daniel P. Berrangé authored
      
      This reverts commit 883e4f76.
      
      This code changed net/socket.c from using socket()+connect(),
      to using socket_connect(). In theory this is great, but in
      practice this has completely broken the ability to connect
      the frontend and backend:
      
        $ ./x86_64-softmmu/qemu-system-x86_64 \
             -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05 \
             -netdev socket,id=hn0,connect=localhost:1234
        qemu-system-x86_64: -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05: Property 'e1000.netdev' can't find value 'hn0'
      
      The old code would call net_socket_fd_init() synchronously,
      while letting the connect() complete in the backgorund. The
      new code moved net_socket_fd_init() so that it is only called
      after connect() completes in the background.
      
      Thus at the time we initialize the NIC frontend, the backend
      does not exist.
      
      The socket_connect() conversion as done is a bad fit for the
      current code, since it did not try to change the way it deals
      with async connection completion. Rather than try to fix this,
      just revert the socket_connect() conversion entirely.
      
      The code is about to be converted to use QIOChannel which
      will let the problem be solved in a cleaner manner. This
      revert is more suitable for stable branches in the meantime.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      6701e551
  13. Jun 02, 2017
Loading