1. 13 3月, 2018 8 次提交
    • P
      tests: qemuxml2xml: Remove testing with allowed format detection · 9fc79688
      Peter Krempa 提交于
      Nobody should use format detection due to security implications. The
      result of the change is that 'raw' format will be printed unless
      specified explicitly.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      9fc79688
    • P
      tests: qemu: Explicitly add tests with format probing allowed · d493e03a
      Peter Krempa 提交于
      Add a single testcase for the case where format probing is allowed.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      d493e03a
    • P
      5972e863
    • J
      qemuDomainUSBAddressAddHubs: use numeric comparison · 1ab25747
      Ján Tomko 提交于
      Since data.count is not a pointer, but an integer,
      compare it against an integer value instead of using
      the implicit "boolean" conversion that is customarily
      used for pointers.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      1ab25747
    • J
      Adjust whitespace in virDomainDefHasUSB prototype · c8ab5aeb
      Ján Tomko 提交于
      To match the rest of the file.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      c8ab5aeb
    • J
      libvirtd: fix potential deadlock when reloading · 33c6eb96
      Jim Fehlig 提交于
      It is possible to deadlock libvirtd when concurrently starting a domain
      and restarting the daemon. Threads involved in the deadlock are
      
      Thread 4 (Thread 0x7fc13b53e700 (LWP 64084)):
      /lib64/libpthread.so.0
          at util/virthread.c:154
          at qemu/qemu_monitor.c:1083
          cmd=0x7fc110017700, scm_fd=-1, reply=0x7fc13b53d318) at
      qemu/qemu_monitor_json.c:305
      cmd=0x7fc110017700,
          reply=0x7fc13b53d318) at qemu/qemu_monitor_json.c:335
          at qemu/qemu_monitor_json.c:1298
          at qemu/qemu_monitor.c:1697
          vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START) at qemu/qemu_process.c:1763
      vm=0x7fc110003d00,
          asyncJob=6, logCtxt=0x7fc1100089c0) at qemu/qemu_process.c:1835
          vm=0x7fc110003d00, asyncJob=6, logCtxt=0x7fc1100089c0) at
      qemu/qemu_process.c:2180
      driver=0x7fc12004e1e0,
          vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START, incoming=0x0, snapshot=0x0,
          vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:6111
      driver=0x7fc12004e1e0,
          vm=0x7fc110003d00, updatedCPU=0x0, asyncJob=QEMU_ASYNC_JOB_START,
      migrateFrom=0x0,
          migrateFd=-1, migratePath=0x0, snapshot=0x0,
      vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
          flags=17) at qemu/qemu_process.c:6334
          xml=0x7fc110000ed0 "<!--\nWARNING: THIS IS AN AUTO-GENERATED FILE.
      CHANGES TO IT ARE LIKELY TO BE\nOVERWRITTEN AND LOST. Changes to this xml
      configuration should be made using:\n  virsh edit testvv\nor other
      applicati"..., flags=0) at qemu/qemu_driver.c:1776
      ...
      
      Thread 1 (Thread 0x7fc143c66880 (LWP 64081)):
      /lib64/libpthread.so.0
          at util/virthread.c:122
      conf/nwfilter_conf.c:159
      sig=0x7ffe0a831e30,
          opaque=0x0) at remote/remote_daemon.c:724
          opaque=0x558c5328b230) at rpc/virnetdaemon.c:654
          at util/vireventpoll.c:508
      rpc/virnetdaemon.c:858
      remote/remote_daemon.c:1496
      (gdb) thr 1
      [Switching to thread 1 (Thread 0x7fc143c66880 (LWP 64081))]
      /lib64/libpthread.so.0
      (gdb) f 1
          at util/virthread.c:122
      122	    pthread_rwlock_wrlock(&m->lock);
      (gdb) p updateLock
      $1 = {lock = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 0,
            __writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 1,
      __writer = 0,
            __shared = 0, __rwelision = 0 '\000', __pad1 = "\000\000\000\000\000\000",
            __pad2 = 0, __flags = 0},
          __size = "\000\000\000\000\001", '\000' <repeats 15 times>, "\001",
      '\000' <repeats 34 times>, __align = 4294967296}}
      
      Reloading of the nwfilter driver is stuck waiting for a write lock, which
      already has a reader (from qemuDomainCreateXML) in the critical section.
      Since the reload occurs in the context of the main event loop thread,
      libvirtd becomes deadlocked. The deadlock can be avoided by offloading
      the reload work to a thread.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      33c6eb96
    • R
      bhyve: fix crash on missing interface model · de3fe191
      Roman Bogorodskiy 提交于
      The bhyve driver crashes in bhyveBuildNetArgStr() when
      network interface model is not defined. As it has to be provided
      explicitly, add a check to report an error if it's missing.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      de3fe191
    • R
      Fix build with clang 6.0.0 · 1b6ff36c
      Roman Bogorodskiy 提交于
      Clang 6.0.0 complains when initializing structure with { NULL }:
      
      conf/domain_addr.c:1494:38: error: missing field 'type' initializer [-Werror,-Wmissing-field-initializers]
          virDomainDeviceInfo nfo = { NULL };
      
      Use { 0 } instead to make it happy.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      1b6ff36c
  2. 12 3月, 2018 10 次提交
  3. 09 3月, 2018 14 次提交
  4. 08 3月, 2018 8 次提交
    • J
      virsh: use logical or for boolean values · 39a6df53
      Ján Tomko 提交于
      Bitwise or just looks wrong here.
      Introduced by <commit 69e0cd33>.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      39a6df53
    • J
      virsh-edit: remove unreachable break · 8a4559c1
      Ján Tomko 提交于
      Introduced by <commit 1bb1de83>.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      8a4559c1
    • J
      openvz: pass sizeof to snprintf · d3b8a81a
      Ján Tomko 提交于
      The size argument accounts for the nul-byte to terminate
      the string. Use sizeof and remove the pointless assignment.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      d3b8a81a
    • J
      nwfilter: remove pointless assignment · 1efdab28
      Ján Tomko 提交于
      Changing a parameter passed by value has no effect.
      
      Introduced by <commit 3f74b2eb>.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      1efdab28
    • J
      maint: use parentheses after if · 0a12d96c
      Ján Tomko 提交于
      Some instances of ARCH_IS_PPC64 did not use them.
      
      Introduced by commits da636d83 and ef08a545Signed-off-by: NJán Tomko <jtomko@redhat.com>
      0a12d96c
    • D
      rpc: switch virtlockd and virtlogd to use single-threaded dispatch · eefabb38
      Daniel P. Berrangé 提交于
      Currently both virtlogd and virtlockd use a single worker thread for
      dispatching RPC messages. Even this is overkill and their RPC message
      handling callbacks all run in short, finite time and so blocking the
      main loop is not an issue like you'd see in libvirtd with long running
      QEMU commands.
      
      By setting max_workers==0, we can turn off the worker thread and run
      these daemons single threaded. This in turn fixes a serious problem in
      the virtlockd daemon whereby it loses all fcntl() locks at re-exec due
      to multiple threads existing. fcntl() locks only get preserved if the
      process is single threaded at time of exec().
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      eefabb38
    • D
      rpc: avoid crashing in pre-exec if no workers are present · 86cae503
      Daniel P. Berrangé 提交于
      If max_workers is set to zero, then the worker thread pool won't be
      created, so when serializing state for pre-exec we must set various
      parameters to zero.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      86cae503
    • D
      rpc: invoke the message dispatch callback with client unlocked · 06e7ebb6
      Daniel P. Berrangé 提交于
      Currently if the virNetServer instance is created with max_workers==0 to
      request a non-threaded dispatch process, we deadlock during dispatch
      
        #0  0x00007fb845f6f42d in __lll_lock_wait () from /lib64/libpthread.so.0
        #1  0x00007fb845f681d3 in pthread_mutex_lock () from /lib64/libpthread.so.0
        #2  0x000055a6628bb305 in virMutexLock (m=<optimized out>) at util/virthread.c:89
        #3  0x000055a6628a984b in virObjectLock (anyobj=<optimized out>) at util/virobject.c:435
        #4  0x000055a66286fcde in virNetServerClientIsAuthenticated (client=client@entry=0x55a663a7b960)
            at rpc/virnetserverclient.c:1565
        #5  0x000055a66286cc17 in virNetServerProgramDispatchCall (msg=0x55a663a7bc50, client=0x55a663a7b960,
            server=0x55a663a77550, prog=0x55a663a78020) at rpc/virnetserverprogram.c:407
        #6  virNetServerProgramDispatch (prog=prog@entry=0x55a663a78020, server=server@entry=0x55a663a77550,
            client=client@entry=0x55a663a7b960, msg=msg@entry=0x55a663a7bc50) at rpc/virnetserverprogram.c:307
        #7  0x000055a662871d56 in virNetServerProcessMsg (msg=0x55a663a7bc50, prog=0x55a663a78020, client=0x55a663a7b960,
            srv=0x55a663a77550) at rpc/virnetserver.c:148
        #8  virNetServerDispatchNewMessage (client=0x55a663a7b960, msg=0x55a663a7bc50, opaque=0x55a663a77550)
            at rpc/virnetserver.c:227
        #9  0x000055a66286e4c0 in virNetServerClientDispatchRead (client=client@entry=0x55a663a7b960)
            at rpc/virnetserverclient.c:1322
        #10 0x000055a66286e813 in virNetServerClientDispatchEvent (sock=<optimized out>, events=1, opaque=0x55a663a7b960)
            at rpc/virnetserverclient.c:1507
        #11 0x000055a662899be0 in virEventPollDispatchHandles (fds=0x55a663a7bdc0, nfds=<optimized out>)
            at util/vireventpoll.c:508
        #12 virEventPollRunOnce () at util/vireventpoll.c:657
        #13 0x000055a6628982f1 in virEventRunDefaultImpl () at util/virevent.c:327
        #14 0x000055a6628716d5 in virNetDaemonRun (dmn=0x55a663a771b0) at rpc/virnetdaemon.c:858
        #15 0x000055a662864c1d in main (argc=<optimized out>,
        #argv=0x7ffd105b4838) at logging/log_daemon.c:1235
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Reviewed-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      06e7ebb6