1. 04 2月, 2011 2 次提交
    • S
      macvtap: fix 2 nla_put expressions (non-serious bug) · be23e2bd
      Stefan Berger 提交于
      This patch fixes 2 occurrences of nla_put expression with a '!' in
      front of them that basically prevented the detection that the buffer
      is too small. However, code further below would then detect that the
      buffer is too small when further parts are added to the netlink message.
      be23e2bd
    • E
      qemu: avoid double shutdown · 9962e406
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemudShutdownVMDaemon): Check that vm is
      still active.
      Reported by Wen Congyang as follows:
      
      Steps to reproduce this bug:
      
      1. use gdb to debug libvirtd, and set breakpoint in the function
         qemuConnectMonitor()
      2. start a vm, and the libvirtd will be stopped in qemuConnectMonitor()
      3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
      4. continue to run libvirtd in gdb, and libvirtd will be blocked in the
         function qemuMonitorSetCapabilities()
      5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)
      
      Here is log of the qemu:
      =========
      LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin ...
      char device redirected to /dev/pts/3
      2011-01-27 09:38:48.101: shutting down
      2011-01-27 09:41:26.401: shutting down
      =========
      
      The vm is shut down twice. I do not know whether this behavior has
      side effect, but I think we should shutdown the vm only once.
      9962e406
  2. 03 2月, 2011 4 次提交
  3. 02 2月, 2011 4 次提交
  4. 01 2月, 2011 4 次提交
  5. 31 1月, 2011 3 次提交
  6. 30 1月, 2011 2 次提交
    • E
      maint: reject raw close, popen in 'make syntax-check' · 030ce43b
      Eric Blake 提交于
      commit f1fe9671 was supposed to make sure we use files.h
      macros to avoid double close, but it didn't work.
      
      Meanwhile, virCommand is vastly superior to system(), fork(),
      and popen() (also to virExec, but we haven't completed that
      conversion), so enforce that, too.
      
      * cfg.mk (sc_prohibit_close): Fix typo that excluded close, and
      add pclose.
      (sc_prohibit_fork_wrappers): New rule, for fork, system, and popen.
      * .x-sc_prohibit_close: More exemptions.
      * .x-sc_prohibit_fork_wrappers: New file.
      * Makefile.am (syntax_check_exceptions): Ship new file.
      * src/datatypes.c (virReleaseConnect): Tweak comment to avoid
      false positive.
      * src/util/files.h (VIR_CLOSE): Likewise.
      030ce43b
    • E
      build: avoid close, system · e67ae619
      Eric Blake 提交于
      * src/fdstream.c (virFDStreamOpenFile, virFDStreamCreateFile):
      Use VIR_FORCE_CLOSE instead of close.
      * tests/commandtest.c (mymain): Likewise.
      * tools/virsh.c (editFile): Use virCommand instead of system.
      * src/util/util.c (__virExec): Special case preservation of std
      file descriptors to child.
      e67ae619
  7. 29 1月, 2011 9 次提交
  8. 28 1月, 2011 12 次提交
    • J
      docs: replace CRLF with LF · eb1be58e
      Juerg Haefliger 提交于
      eb1be58e
    • D
      Remove bogus log warning lines when launching QEMU · 0095edaa
      Daniel P. Berrange 提交于
      The refactoring of QEMU command startup was comitted with
      a couple of VIR_WARN lines left in from debugging.
      
      * src/qemu/qemu_driver.c: Remove log warning lines
      0095edaa
    • D
      Remove double close of qemu monitor · e85247e7
      Daniel P. Berrange 提交于
      When qemuMonitorSetCapabilities() fails, there is no need to
      call qemuMonitorClose(), because the caller will already see
      the error code and tear down the entire VM. The extra call to
      qemuMonitorClose resulted in a double-free due to it removing
      a ref count prematurely.
      
      * src/qemu/qemu_driver.c: Remove premature close of monitor
      e85247e7
    • D
      Prevent overfilling of self-pipe in python event loop · 331d7b09
      Daniel P. Berrange 提交于
      If the event loop takes a very long time todo something, it is
      possible for the 'self pipe' buffer to become full at which
      point the entire event loop + remote driver deadlock. Use a
      boolean flag to ensure we have strict one-in, one-out behaviour
      on writes/reads of the 'self pipe'
      331d7b09
    • O
      docs: Add docs for new extra parameter pkipath · cc4447b6
      Osier Yang 提交于
      * docs/remote.html.in
      cc4447b6
    • E
      qemu: fix error messages · b96b6f47
      Eric Blake 提交于
      Regression in commit caa805ea let a lot of bad messages slip in.
      
      * cfg.mk (msg_gen_function): Fix function name.
      * src/qemu/qemu_cgroup.c (qemuRemoveCgroup): Fix fallout from
      'make syntax-check'.
      * src/qemu/qemu_driver.c (qemudDomainGetInfo)
      (qemuDomainWaitForMigrationComplete, qemudStartVMDaemon)
      (qemudDomainSaveFlag, qemudDomainAttachDevice)
      (qemuDomainUpdateDeviceFlags): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
      (qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
      Likewise.
      b96b6f47
    • H
      qemu: Report more accurate error on failure to attach device. · cdbba1c4
      Hu Tao 提交于
      When attaching device from a xml file and the device is mis-configured,
      virsh gives mis-leading message "out of memory". This patch fixes this.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cdbba1c4
    • W
      Force guest suspend at timeout · f15cad29
      Wen Congyang 提交于
      If the memory of guest OS is changed constantly, the live migration
      can not be ended ever for ever.
      
      We can use the command 'virsh migrate-setmaxdowntime' to control the
      live migration. But the value of maxdowntime is diffcult to calculate
      because it depends on the transfer speed of network and constantly
      changing memroy size. We need a easy way to control the live migration.
      
      This patch adds the support of forcing guest to suspend at timeout.
      With this patch, when we migrate the guest OS, we can specify a
      timeout. If the live migration timeouts, auto-suspend the guest OS,
      where the migration will complete offline.
      f15cad29
    • W
      Show migration progress. · d183e9d1
      Wen Congyang 提交于
      Show migration progress if `migrate --verbose'.
      d183e9d1
    • H
      Cancel migration if user presses Ctrl-C when migration is in progress · 8e6d9860
      Hu Tao 提交于
      While migration is in progress and virsh is waiting for its
      completion, user may want to terminate the progress by pressing
      Ctrl-C. But virsh just exits on user's Ctrl-C leaving migration
      in background that user isn't even aware of. It's not reasonable.
      
      This patch changes the behaviour for migration. For other
      commands Ctrl-C still terminates virsh itself.
      8e6d9860
    • E
      qemu: use separate alias for chardev and associated device · 3fdc7895
      Eric Blake 提交于
      * src/qemu/qemu_command.c (qemuBuildChrChardevStr): Alter the
      chardev alias.
      (qemuBuildCommandLine): Output an id for the chardev counterpart.
      * tests/qemuxml2argvdata/*: Update tests to match.
      Reported by Daniel P. Berrange.
      3fdc7895
    • W
      avoid vm to be deleted if qemuConnectMonitor failed · d96431f9
      Wen Congyang 提交于
      Steps to reproduce this bug:
      1. service libvirtd start
      2. virsh start <domain>
      3. kill -STOP $(cat /var/run/libvirt/qemu/<domain>.pid)
      4. service libvirtd restart
      5. kill -9 $(cat /var/run/libvirt/qemu/<domain>.pid)
      
      Then libvirtd will core dump or be in deadlock state.
      
      Make sure that json is built into libvirt and the version
      of qemu is newer than 0.13.0.
      
      The reason of libvirtd cores dump is that:
      We add vm->refs when we alloc the memory, and decrease it
      in the function qemuHandleMonitorEOF() in other thread.
      
      We add vm->refs in the function qemuConnectMonitor() and
      decrease it when the vm is inactive.
      
      The libvirtd will block in the function qemuMonitorSetCapabilities()
      because the vm is stopped by signal SIGSTOP. Now the vm->refs is 2.
      
      Then we kill the vm by signal SIGKILL. The function
      qemuMonitorSetCapabilities() failed, and then we will decrease vm->refs
      in the function qemuMonitorClose().
      In another thread, mon->fd is broken and the function
      qemuHandleMonitorEOF() is called.
      
      If qemuHandleMonitorEOF() decreases vm->refs before qemuConnectMonitor()
      returns, vm->refs will be decrease to 0 and the memory is freed.
      
      We will call qemudShutdownVMDaemon() as qemuConnectMonitor() failed.
      The memory has been freed, so qemudShutdownVMDaemon() is too dangerous.
      
      We will reference NULL pointer in the function virDomainConfVMNWFilterTeardown():
      =============
      void
      virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) {
          int i;
      
          if (nwfilterDriver != NULL) {
              for (i = 0; i < vm->def->nnets; i++)
                  virDomainConfNWFilterTeardown(vm->def->nets[i]);
          }
      }
      ============
      vm->def->nnets is not 0 but vm->def->nets is NULL(We don't set vm->def->nnets
      to 0 when we free vm).
      
      We should add an extra reference of vm to avoid vm to be deleted if
      qemuConnectMonitor() failed.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      d96431f9