1. 21 5月, 2010 8 次提交
  2. 20 5月, 2010 5 次提交
  3. 19 5月, 2010 6 次提交
  4. 18 5月, 2010 6 次提交
    • D
      Protect against NULL pointer flaws in monitor usage · 31e29fe5
      Daniel P. Berrange 提交于
      History has shown that there are frequent bugs in the QEMU driver
      code leading to the monitor being invoked with a NULL pointer.
      Although the QEMU driver code should always report an error in
      this case before invoking the monitor, as a safety net put in a
      generic check in the monitor code entry points.
      
      * src/qemu/qemu_monitor.c: Safety net to check for NULL monitor
        object
      31e29fe5
    • D
      Fix multiple potential NULL pointer references in monitor usage · c4b2a939
      Daniel P. Berrange 提交于
      Any method which intends to invoke a monitor command must have
      a check for virDomainObjIsActive() before using the monitor to
      ensure that priv->mon != NULL.
      
      There is one subtle edge case in this though. If a method invokes
      multiple monitor commands, and calls qemuDomainObjExitMonitor()
      in between two of these commands then there is no guarentee that
      priv->mon != NULL anymore. This is because the QEMU process may
      exit or die at any time, and because qemuDomainObjEnterMonitor()
      releases the lock on virDomainObj, it is possible for the background
      thread to close the monitor handle and thus qemuDomainObjExitMonitor
      will release the last reference allowing priv->mon to become NULL.
      
      This affects several methods, most notably migration but also some
      hotplug methods. This patch takes a variety of approaches to solve
      the problem, depending on the particular usage scenario. Generally
      though it suffices to add an extra virDomainObjIsActive() check
      if qemuDomainObjExitMonitor() was called during the method.
      
      * src/qemu/qemu_driver.c: Fix multiple potential NULL pointer flaws
        in usage of the monitor
      c4b2a939
    • J
      qemudDomainSetVcpus: avoid NULL-deref on failed uuid look-up · 20701b17
      Jim Meyering 提交于
      * src/qemu/qemu_driver.c (qemudDomainSetVcpus): Upon look-up failure,
      i.e., vm==NULL, goto cleanup, rather than to "endjob", superficially
      since the latter would dereference vm, but more fundamentally because
      we certainly don't want to call qemuDomainObjEndJob before we've
      even attempted qemuDomainObjBeginJob.
      20701b17
    • E
      qemu_conf: fix flag value · f30ccb24
      Eric Blake 提交于
      (gdb) p/x QEMUD_CMD_FLAG_VNET_HOST
      $7 = 0xffffffff80000000
      
      Oops - that meant we were incorrectly setting QEMU_CMD_FLAG_RTC_TD_HACK
      for qemu-kvm-0.12.3 (and probably botching a few other settings as well).
      
      Fixes Red Hat BZ#592070
      
      * src/qemu/qemu_conf.h (QEMUD_CMD_FLAG_VNET_HOST): Avoid sign
      extension.
      * tests/qemuhelpdata/qemu-kvm-0.12.3: New file.
      * tests/qemuhelptest.c (mymain): Add another case.
      f30ccb24
    • C
      qemu: Clarify a couple error messages · 07c621d0
      Cole Robinson 提交于
      A fedora translator filed:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=580816
      
      Pointing out these two error messages as unclear: "write save" sounds
      like a typo without context, and lack of a colon made the second message
      difficult to parse.
      07c621d0
    • E
      virFileResolveLink: fix return value · d533a98e
      Eric Blake 提交于
      virFileResolveLink was returning a positive value on error,
      thus confusing callers that assumed failure was < 0.  The
      confusion is further evidenced by callers that would have
      ended up calling virReportSystemError with a negative value
      instead of a valid errno.
      
      Fixes Red Hat BZ #591363.
      
      * src/util/util.c (virFileResolveLink): Live up to documentation.
      * src/qemu/qemu_security_dac.c
      (qemuSecurityDACRestoreSecurityFileLabel): Adjust callers.
      * src/security/security_selinux.c
      (SELinuxRestoreSecurityFileLabel): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskDeleteVol): Likewise.
      d533a98e
  5. 17 5月, 2010 4 次提交
  6. 15 5月, 2010 3 次提交
  7. 14 5月, 2010 4 次提交
    • D
      Make domain save work when dynamic_ownership=0 · de4d7087
      Daniel P. Berrange 提交于
      Setting dynamic_ownership=0 in /etc/libvirt/qemu.conf prevents
      libvirt's DAC security driver from setting uid/gid on disk
      files when starting/stopping QEMU, allowing the admin to manage
      this manually. As a side effect it also stopped setting of
      uid/gid when saving guests to a file, which completely breaks
      save when QEMU is running non-root. Thus saved state labelling
      code must ignore the dynamic_ownership parameter
      
      * src/qemu/qemu_security_dac.c: Ignore dynamic_ownership=0 when
        doing save/restore image labelling
      de4d7087
    • D
      Don't reset user/group/security label on shared filesystems during migrate · 02ddaddf
      Daniel P. Berrange 提交于
      When QEMU runs with its disk on NFS, and as a non-root user, the
      disk is chownd to that non-root user. When migration completes
      the last step is shutting down the QEMU on the source host. THis
      normally resets user/group/security label. This is bad when the
      VM was just migrated because the file is still in use on the dest
      host. It is thus neccessary to skip the reset step for any files
      found to be on a shared filesystem
      
      * src/libvirt_private.syms: Export virStorageFileIsSharedFS
      * src/util/storage_file.c, src/util/storage_file.h: Add a new
        method virStorageFileIsSharedFS() to determine if a file is
        on a shared filesystem (NFS, GFS, OCFS2, etc)
      * src/qemu/qemu_driver.c: Tell security driver not to reset
        disk labels on migration completion
      * src/qemu/qemu_security_dac.c, src/qemu/qemu_security_stacked.c,
        src/security/security_selinux.c, src/security/security_driver.h,
        src/security/security_apparmor.c: Add ability to skip disk
        restore step for files on shared filesystems.
      02ddaddf
    • D
      Fix handling of disk backing stores with cgroups · 117d04fb
      Daniel P. Berrange 提交于
      The cgroups ACL code was only allowing the primary disk image.
      It is possible to chain images together, so we need to search
      for backing stores and add them to the ACL too. Since the ACL
      only handles block devices, we ignore the EINVAL we get from
      plain files. In addition it was missing code to teardown the
      cgroup when hot-unplugging a disk
      
      * src/qemu/qemu_driver.c: Allow backing stores in cgroup ACLs
        and add missing teardown code in unplug path
      117d04fb
    • D
      Add support for NIC hotplug using netdev_add in QEMU · ff45b4c2
      Daniel P. Berrange 提交于
      QEMU is gaining a new monitor command netdev_add for hotplugging
      NICs using the netdev backend code. We already support this on
      the command this, though it is disabled. This adds support for
      hotplug too, also to remain disabled until 0.13 QEMU is released
      
      * src/qemu/qemu_driver.c: Support netdev hotplug for NICs
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for netdev_add and netdev_remove commands
      ff45b4c2
  8. 12 5月, 2010 1 次提交
    • J
      Fix monitor ref counting when adding event handle · d84bb6d6
      Jiri Denemark 提交于
      When closing a monitor using qemuMonitorClose(), we are aware of
      the possibility the monitor is still being used somewhere:
      
          /* NB: ordinarily one might immediately set mon->watch to -1
           * and mon->fd to -1, but there may be a callback active
           * that is still relying on these fields being valid. So
           * we merely close them, but not clear their values and
           * use this explicit 'closed' flag to track this state */
      
      but since we call virEventAddHandle() on that monitor without increasing
      its ref counter, the monitor is still freed which makes possible users
      of it quite unhappy. The unhappiness can lead to a hang if qemuMonitorIO
      tries to lock mutex which no longer exists.
      d84bb6d6
  9. 07 5月, 2010 3 次提交