1. 02 12月, 2014 8 次提交
    • L
      conf: replace call to virNetworkFree() with virObjectUnref() · c2d5bca1
      Laine Stump 提交于
      The function virNetworkObjListExport() in network_conf.c had a call to
      the public API virNetworkFree() which was causing a link error:
      
      CCLD     libvirt_driver_vbox_network_impl.la
       ./.libs/libvirt_conf.a(libvirt_conf_la-network_conf.o): In function `virNetworkObjListExport':
      /home/laine/devel/libvirt/src/conf/network_conf.c:4496: undefined reference to `virNetworkFree'
      
      This would happen when I added
      
        #include "network_conf.h"
      
      into domain_conf.h, then attempted to call a new function from that
      file (and enum converter, similar to virNetworkForwardTypeToString())
      
      In the end, virNetworkFree() ends up just calling virObjectUnref(obj)
      anyway (after clearing all pending errors, which we probably *don't*
      want to do in the cleanup of a utility function), so this is likely
      more correct than the original code as well.
      c2d5bca1
    • M
      build, docs: Let make see the dependencies for html/*.html · b79d195b
      Martin Kletzander 提交于
      Make was not able to realize the dependencies for html/*.html files when
      running 'make -j9 dist'.  All the files are generated together with
      html/index.html, so simply separating them into another variable and
      adding one block into the dependency chain solves the issue.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      b79d195b
    • M
      docs: Correct invalid hyperlinks · af1b89d1
      Martin Kletzander 提交于
      Since libvirt.h was split into multiple files and similarly
      docs/libvirt-libvirt.html, docs/hvsupport.html have bad hyperlinks.  The
      same happens for all the html.in files that used <code class='docref'>
      tag, because page.xsl has no idea where to point the link that's found.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      af1b89d1
    • E
      Fix race condition in qemuGetProcessInfo · ff018e68
      Eduardo Costa 提交于
      There is a race condition between the fopen and fscanf calls
      in qemuGetProcessInfo. If fopen succeeds, there is a small
      possibility that the file no longer exists before reading from it.
      Now, if either fopen or fscanf calls fail, the function will behave
      just as only fopen had failed.
      
      Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1169055Signed-off-by: NEric Blake <eblake@redhat.com>
      ff018e68
    • J
      libxl: Resolve Coverity CHECKED_RETURN · 5f1d3c6c
      John Ferlan 提交于
      Commit id 'cb88d433' refactored the calling sequence to use a thread;
      however, in doing so "lost" the check for if virNetSocketAccept returns
      failure.  Since other code makes that check, Coverity complains. Although
      a false positive, adding back the failure check pacifies Coverity
      5f1d3c6c
    • J
      domain_conf: Resolve Coverity CHECKED_RETURN · 025dc403
      John Ferlan 提交于
      Commit id '0d36a5d0' modified the code slightly, but removed the
      return value check thus causing Coverity to complain that this call
      was the only one where the return value wasn't checked. Since nothing
      was done previously if there was a failure, just use ignore_value here
      to pacify Coverity
      025dc403
    • J
      virhook: Resolve Coverity NULL_RETURNS · f7212f6b
      John Ferlan 提交于
      Coverity complains that many other callers to return err from
      virGetLastError() will check if err is not NULL before dereferencing
      it.  Just do the same here for safety.
      f7212f6b
    • J
      hotplug: Resolve Coverity FORWARD_NULL · 59802f23
      John Ferlan 提交于
      Coverity complained that because the cfg->macFilter call checked
      net->ifname != NULL before calling ebtablesRemoveForwardAllowIn, then
      the virNetDevOpenvswitchRemovePort call should have the same check.
      
      However, if I move the ebtables call prior to the check for TYPE_DIRECT
      (where there is a VIR_FREE(net->ifname)), then it seems Coverity is
      happy.  Since firewall info is tacked on last during setup, removing
      it in the opposite order of initialization seems to be natural anyway
      59802f23
  2. 01 12月, 2014 10 次提交
  3. 28 11月, 2014 3 次提交
    • M
      qemu: Don't track quiesced state of FSs · 6085d917
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160084
      
      As of b6d4dad1 (1.2.5) we are trying to keep the status of FSFreeze
      in the guest. Even though I've tried to fixed couple of corner cases
      (6ea54769), it occurred to me just recently, that the approach is
      broken by design. Firstly, there are many other ways to talk to
      qemu-ga (even through libvirt) that filesystems can be thawed (e.g.
      qemu-agent-command) without libvirt noticing. Moreover, there are
      plenty of ways to thaw filesystems without even qemu-ga noticing (yes,
      qemu-ga keeps internal track of FSFreeze status). So, instead of
      keeping the track ourselves, or asking qemu-ga for stale state, it's
      the best to let qemu-ga deal with that (and possibly let guest kernel
      propagate an error).
      
      Moreover, there's one bug with the following approach, if fsfreeze
      command failed, we've executed fsthaw subsequently. So issuing
      domfsfreeze in virsh gave the following result:
      
      virsh # domfsfreeze gentoo
      Froze 1 filesystem(s)
      
      virsh # domfsfreeze gentoo
      error: Unable to freeze filesystems
      error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been disabled for this instance
      
      virsh # domfsfreeze gentoo
      Froze 1 filesystem(s)
      
      virsh # domfsfreeze gentoo
      error: Unable to freeze filesystems
      error: internal error: unable to execute QEMU agent command 'guest-fsfreeze-freeze': The command guest-fsfreeze-freeze has been disabled for this instance
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6085d917
    • J
      Fix usage of virReportSystemError · 9340528a
      Jiri Denemark 提交于
      virReportSystemError is reserved for reporting system errors, calling it
      with VIR_ERR_* error codes produces error messages that do not make any
      sense, such as
      
          internal error: guest failed to start: Kernel doesn't support user
          namespace: Link has been severed
      
      We should prohibit wrong usage with a syntax-check rule.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      9340528a
    • M
      docs: fix simple typo in TPM paragraph · b09b9266
      Martin Kletzander 提交于
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      b09b9266
  4. 27 11月, 2014 3 次提交
  5. 26 11月, 2014 1 次提交
  6. 25 11月, 2014 15 次提交
    • E
      virsh: document block.n.allocation stat · 7296e896
      Eric Blake 提交于
      Commit 7557ddf8 added some additional block.* stats to
      virDomainListGetStats, but failed to document them in 'man
      virsh'.  Also, I noticed some inconsistent use of commas.
      
      * tools/virsh.pod (domstats): Tweak commas, add missing stats.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7296e896
    • E
      dbus: fix arrays of bools · 96e0d677
      Eric Blake 提交于
      Commit 2aa167ca tried to fix the DBus interaction code to allow
      callers to use native types instead of 4-byte bools.  But in
      fixing the issue, I missed the case of an arrayref; Conrad Meyer
      shows the following valid complaint issued by clang:
      
        CC       util/libvirt_util_la-virdbus.lo
      util/virdbus.c:956:13: error: cast from 'bool *' to 'dbus_bool_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
                  GET_NEXT_VAL(dbus_bool_t, bool_val, bool, "%d");
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      util/virdbus.c:858:17: note: expanded from macro 'GET_NEXT_VAL'
                  x = (dbustype *)(*xptrptr + (*narrayptr - 1));              \
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
      
      But fixing that points out that we have NEVER supported arrayrefs
      of sub-int types (byte, i16, u16, and now bool).  Again, while raw
      types promote, arrays do not; so the macros HAVE to deal with both
      size possibilities rather than assuming that an arrayref uses the
      same sizing as the promoted raw type.
      
      Obviously, our testsuite wasn't covering as much as it should have.
      
      * src/util/virdbus.c (GET_NEXT_VAL): Also fix array cases.
      (SET_NEXT_VAL): Fix uses of sub-int arrays.
      * tests/virdbustest.c (testMessageArray, testMessageArrayRef):
      Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      96e0d677
    • W
      qemu: add the missing jobinfo type in qemuDomainGetJobInfo · 64b84911
      Wang Rui 提交于
      Commit 6fcddfcd refactored job statistics but missed the jobinfo type updated
      in qemuDomainGetJobInfo. After this patch, we can use virDomainGetJobInfo to
      get jobinfo type again.
      Signed-off-by: NWang Rui <moon.wangrui@huawei.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      64b84911
    • J
      Resolve build breaker · 5e5cf8e0
      John Ferlan 提交于
      Commit 'c264eeaa' didn't do the prerequisite 'make syntax-check' before
      pushing. There was a <tab> in the whitespace for the comment.  Replaced
      with spaces and aligned.
      
      pushed as build breaker since Jenkins complained loudly
      5e5cf8e0
    • C
      lxc: don't unmount subtree if it contains the source of the mount · e50457dd
      Cédric Bosdonnat 提交于
      The typical case where we had a problem is with such a filesystem
      definition as created by virt-sandbox-service:
      
          <filesystem type='bind' accessmode='passthrough'>
            <source dir='/var/lib/libvirt/filesystems/mysshd/var'/>
            <target dir='/var'/>
          </filesystem>
      
      In this case, we don't want to unmount the /var subtree or we may
      loose the access to the source folder.
      e50457dd
    • C
      lxc: be more patient while resolving symlinks · 72fecf18
      Cédric Bosdonnat 提交于
      Resolving symlinks can fail before mounting any file system if one file
      system depends on another being mounted. Symlinks are now resolved in
      two passes:
      
        * Before any file system is mounted, but then we are more gentle if
          the source path can't be accessed
        * Right before mounting a file system, so that we are sure that we
          have the resolved path... but then if it can't be accessed we raise
          an error.
      72fecf18
    • C
      ip link needs 'name' in 3.16 to create the veth pair · 433b427f
      Cédric Bosdonnat 提交于
      Due to a change (or bug?) in ip link implementation, the command
          'ip link add vnet0...'
      is forced into
          'ip link add name vnet0...'
      The changed command also works on older versions of iproute2, just the
      'name' parameter has been made mandatory.
      433b427f
    • C
      virt-aa-helper: /etc/libvirt-sandbox/services isn't restricted · c264eeaa
      Cédric Bosdonnat 提交于
      To get virt-sandbox-service working with AppArmor, virt-aa-helper
      needs not to choke on path in /etc/libvirt-sandbox/services.
      c264eeaa
    • C
      virt-aa-helper wasn't running virErrorInitialize · 22221233
      Cédric Bosdonnat 提交于
      This turns out to be working by magic but needs to be fixed.
      22221233
    • P
      qemu-command: introduce new vgamem attribute for QXL video device · 742d49fa
      Pavel Hrdina 提交于
      Add attribute to set vgamem_mb parameter of QXL device for QEMU. This
      value sets the size of VGA framebuffer for QXL device. Default value in
      QEMU is 8MB so reuse it also in libvirt to not break things.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      742d49fa
    • P
      qemu-command: use vram attribute for all video devices · 24c6ca86
      Pavel Hrdina 提交于
      So far we didn't have any option to set video memory size for qemu video
      devices. There was only the vram (ram for QXL) attribute but it was valid
      only for the QXL video device.
      
      To provide this feature to users QEMU has a dedicated device attribute
      called 'vgamem_mb' to set the video memory size. We will use the 'vram'
      attribute for setting video memory size for other QEMU video devices.
      
      For the cirrus device we will ignore the vram value because it has
      hardcoded video size in QEMU.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      24c6ca86
    • P
      caps: introduce new QEMU capability for vgamem_mb device property · f480a87a
      Pavel Hrdina 提交于
      Allow setting vgamem size for video devices.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      f480a87a
    • P
      QXL: fix setting ram and vram values for QEMU QXL device · c32cfc6d
      Pavel Hrdina 提交于
      QEMU has two different type of QXL display device. The first "qxl-vga"
      is for primary video device and second "qxl" is for secondary video
      device.
      
      There are also two different ways how to specify those devices on qemu
      command line, the first one and obsolete is using "-vga" option and the
      current new one is using "-device" option. The "-vga" could be used only
      to setup primary video device, so the "-vga qxl" equal to
      "-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting
      additional parameters for the device and "-global" option must be used
      for this purpose. It's mandatory to use "-global qxl-vga...." to set the
      parameters of primary video device previously defined with "-vga qxl".
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      c32cfc6d
    • P
      video: cleanup usage of vram attribute and update documentation · 81ba2298
      Pavel Hrdina 提交于
      The vram attribute was introduced to set the video memory but it is
      usable only for few hypervisors excluding QEMU/KVM and the old XEN
      driver. Only in case of QEMU the vram was used for QXL.
      
      This patch updates the documentation to reflect current code in libvirt
      and also changes the cases when we will set the default vram attribute.
      It also fixes existing strange default value for VGA devices 9MB to 16MB
      because the video ram should be rounded to power of two.
      
      The change of default value could affect migrations but I found out that
      QEMU always round the video ram to power of two internally so it's safe
      to change the default value to the next closest power of two and also
      silently correct every domain XML definition. And it's also safe because
      we don't pass the value to QEMU.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      81ba2298
    • P
      internal: add macro to round value to the next closest power of 2 · ff28ebf1
      Pavel Hrdina 提交于
      There are two special cases, if the input number is 0 or the number is
      larger then 2^31 (for 32bit unsigned int). For the special cases the
      return value is 0 because they cannot be rounded.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      ff28ebf1