1. 03 7月, 2015 1 次提交
  2. 02 7月, 2015 31 次提交
  3. 01 7月, 2015 8 次提交
    • M
      lxc: Don't pass a local variable address randomly · 302146b1
      Michal Privoznik 提交于
      So, recently I was testing the LXC driver. You know, startup some
      domains. But to my surprise, I was not able to start a single one:
      
        virsh # start --console test
        error: Reconnected to the hypervisor
        error: Failed to start domain test
        error: internal error: guest failed to start: unexpected exit status 125
      
      So I've start digging. It turns out, that in virExec(), when I printed
      out the @cmd, I got strange values: *(cmd->outfdptr) was certainly not
      valid FD number: it has random value of several millions. This
      obviously made prepareStdFd(childout, STDOUT_FILENO) fail (line 611).
      But outfdptr is set in virCommandSetOutputFD(). The only place within
      LXC driver where the function is called is in
      virLXCProcessBuildControllerCmd(). If you take a closer look at the
      function it looks like this:
      
      static virCommandPtr
      virLXCProcessBuildControllerCmd(virLXCDriverPtr driver,
                                      ..
                                      int logfd,
                                      const char *pidfile)
      {
          ...
          virCommandSetOutputFD(cmd, &logfd);
          virCommandSetErrorFD(cmd, &logfd);
          ...
      }
      
      Yes, you guessed it. @logfd is passed into the function by value.
      However, in the function we try to get its address (an address of a
      local variable) which is no longer valid once function is finished and
      stack is cleaned. Therefore when cmd->outfdptr is evaluated at any
      point after this function, we may get a random number, depending on
      what's currently on the stack. Of course, this may work sometimes too
      - it depends on the compiler how it arranges the code, when the stack
      is wiped out.
      
      In order to fix this, lets pass a pointer to @logfd instead of
      figuring out (wrong) its value in a function.
      
      The bug was introduced in e1de5521.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      302146b1
    • J
      qemu: Resolve Coverity DEADCODE · ebd62eba
      John Ferlan 提交于
      Commit id 'f967e7a6' didn't place the closing parentheses quite right
      causing DEADCODE errors since the rc setting/comparison was wrong.
      ebd62eba
    • P
      conf: qemu: Taint VMs using custom device tree blob · 4b48ba4a
      Peter Krempa 提交于
      Using a custom device tree image may cause unexpected behavior in
      architectures that use this approach to detect platform devices. Since
      usually the device tree is generated by qemu and thus it's not normally
      used let's taint VMs using it to make it obvious as a possible source of
      problems.
      4b48ba4a
    • P
      qemu: Audit memory size with memory hotplug operations · 91081979
      Peter Krempa 提交于
      The memory device hot(un)plug was missing calls to the auditing code.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1226234
      91081979
    • P
      conf: audit: Audit physical memory size rather than balloon request · 1a136774
      Peter Krempa 提交于
      Since the balloon driver does not guarantee that it returns memory to
      the host, using the value in the audit message is not a good idea.
      
      This patch removes auditing from updating the balloon size and reports
      the total physical size at startup.
      1a136774
    • J
      qemu: Avoid using ".(null)" in UNIX socket path · ffbafd4e
      Jiri Denemark 提交于
      The code which generates paths for UNIX socket blindly used target name
      without checking if it was set. Thus for the following device XML
      
          <channel type='unix'>
            <source mode='bind'/>
            <target type='virtio'/>
          </channel>
      
      we would generate "/var/lib/libvirt/qemu/channel/target/NAME.(null)"
      path which works but is not really correct. Let's not use the
      ".target_name" suffix at all if target name is not set.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1226854Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      ffbafd4e
    • P
      qemu: agent: Don't automatically disable CPU0 via guest agent · 18c9d157
      Peter Krempa 提交于
      While CPU0 was made unpluggable in Linux a while ago it's not desirable
      to unplug it since some parts of the kernel (suspend-to-ram) still
      depend on it.
      
      This patch fixes the vCPU selection code in libvirt so that it will not
      be disabled.
      18c9d157
    • L
      91c9e4d9