1. 13 6月, 2012 1 次提交
    • E
      build: silence gettext warning · 78d078c8
      Eric Blake 提交于
      Otherwise, 'make dist' gives multiple warnings like:
      
      libvirt.pot:20814: warning: internationalized messages should not contain the `\r' escape sequence
      
      * tools/virsh.c (vshAskReedit): Avoid \r in _().
      78d078c8
  2. 12 6月, 2012 15 次提交
    • G
      openvz: wire up domainUpdateDeviceFlags · f5d61d39
      Guido Günther 提交于
      so we can update file system quota
      f5d61d39
    • G
      openvz: add persist parameter to openvzSetDiskQuota · 1d82540a
      Guido Günther 提交于
      with persist=false the domain config file will not be updated.
      1d82540a
    • G
      Introduce virDomainFSIndexByName · 0dde544c
      Guido Günther 提交于
      for containers matching virDomainDiskIndexByName.
      0dde544c
    • D
      Fix typo in RPM specfile · 48939a4a
      Daniel P. Berrange 提交于
      libvirt.spec.in: s/{?rhel}/%{?rhel}/
      48939a4a
    • E
      python: fix snapshot listing bugs · a0de5d78
      Eric Blake 提交于
      Python exceptions are different than libvirt errors, and we had
      some corner case bugs on OOM situations.
      
      * python/libvirt-override.c (libvirt_virDomainSnapshotListNames)
      (libvirt_virDomainSnapshotListChildrenNames): Use correct error
      returns, avoid segv on OOM, and avoid memory leaks on error.
      a0de5d78
    • E
      python: use simpler methods · 8566618f
      Eric Blake 提交于
      * python/libvirt-override.c (libvirt_virDomainGetVcpus)
      (libvirt_virDomainGetVcpuPinInfo): Use Py_XDECREF instead of
      open-coding it.
      8566618f
    • M
      qemu: Don't overwrite security labels · 86032b22
      Michal Privoznik 提交于
      Currently, if qemuProcessStart fail at some point, e.g. because
      domain being started wants a PCI/USB device already assigned to
      a different domain, we jump to cleanup label where qemuProcessStop
      is performed. This unconditionally calls virSecurityManagerRestoreAllLabel
      which is wrong because the other domain is still using those devices.
      
      However, once we successfully label all devices/paths in
      qemuProcessStart() from that point on, we have to perform a rollback
      on failure - that is - we have to virSecurityManagerRestoreAllLabel.
      86032b22
    • M
      qemuProcessStop: Switch to flags · 69dd7714
      Michal Privoznik 提交于
      Currently, we are passing only one boolean (migrated) so there is
      no real profit in this. But it creates starting position for
      next patch.
      69dd7714
    • E
      snapshot: implement new APIs for qemu · e3559a6e
      Eric Blake 提交于
      The two APIs are rather trivial; based on bits and pieces of other
      existing APIs.  It leaves the door open for future extension to
      qemu to report snapshots without metadata based on reading qcow2
      internal snapshot names.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata): New functions.
      e3559a6e
    • L
      docs: minor fixes to domain interface documentation · 549741ee
      Laine Stump 提交于
      A few examples for <interface> had a type='direct' interface with no
      sub-elements. This is not allowed - a type='direct' interface must
      have at least a source element. (Most likely the example was copied
      from the type='user' or type='ethernet' examples - they *do* allow an
      instance with no sub-elements).
      
      There was also one place that mistakenly used %lt; ... %gt; instead of
      &lt; ... &gt; (for some reason, I make that typo all the time).
      549741ee
    • E
      snapshot: RPC for new query APIs · a2bc4a0c
      Eric Blake 提交于
      Pretty straightforward.
      
      * src/remote/remote_protocol.x
      (remote_domain_snapshot_is_current_args)
      (remote_domain_snapshot_is_current_ret)
      (remote_domain_snapshot_has_metadata_args)
      (remote_domain_snapshot_has_metadata_ret): New structs.
      (REMOTE_PROC_DOMAIN_SNAPSHOT_IS_CURRENT)
      (REMOTE_PROC_DOMAIN_SNAPSHOT_HAS_METADATA): New RPC calls.
      * src/remote/remote_driver.c (remote_driver): Call them.
      * src/remote_protocol-structs: Regenerate.
      a2bc4a0c
    • E
      snapshot: add 'virsh snapshot-info' · 757c4763
      Eric Blake 提交于
      Expose the recent API additions in virsh.  Borrows ideas from 'dominfo'
      for the general type of information to display.
      
      Output looks like:
      
      $ tools/virsh snapshot-info fedora-local tmp
      Name:           tmp
      Domain:         fedora-local
      Current:        no
      State:          disk-snapshot
      Parent:         -
      Children:       1
      Descendants:    2
      Metadata:       yes
      
      possibly with fewer lines when talking to older servers.
      
      * tools/virsh.c (cmdSnapshotInfo): New command.
      * tools/virsh.pod (snapshot-info): Document it.
      757c4763
    • E
      docs: link to FLOSS Weekly podcast, virt blogs · a0ac7450
      Eric Blake 提交于
      Eric Blake and Guido Günther were guests during this week's
      FLOSS Weekly podcast, giving insights into libvirt as a Free
      Software project.  Also, there are several useful blogs on
      virt-related topics.
      
      * docs/relatedlinks.html.in (Blogs and Podcasts): New section.
      a0ac7450
    • D
      Two RPM conditional fixes for RHEL-7 · 1cdbe4d2
      Daniel P. Berrange 提交于
      Ensure systemd is used in RHEL-7 and cgconfig is not used in
      RHEL-7
      1cdbe4d2
    • E
      snapshot: new query APIs · 2e13b9ab
      Eric Blake 提交于
      Right now, starting from just a virDomainSnapshotPtr, and wanting to
      know if it is the current snapshot for its respective domain, you have
      to use virDomainSnapshotGetDomain(), then virDomainSnapshotCurrent(),
      then compare the two names returned by virDomainSnapshotGetName().
      It is a bit easier if we can directly query this information from the
      snapshot itself.
      
      Right now, it is possible to filter a snapshot listing based on
      whether snapshots have metadata that would prevent domain deletion,
      but the only way to learn if an individual snapshot has metadata is
      to see if that snapshot appears in the list returned by a listing.
      Additionally, I hope to expand the qemu driver in a future patch to
      use qemu-img to reconstruct snapshot XML corresponding to internal
      qcow2 snapshot names not otherwise tracked by libvirt (in part, so
      that libvirt can guarantee that new snapshots are not created with
      a name that would silently corrupt the existing portion of the qcow2
      file); if I ever get that in, then it would no longer be an all-or-none
      decision on whether snapshots have metadata, and becomes all the more
      important to be able to directly determine that information from a
      particular snapshot.
      
      Other query functions (such as virDomainIsActive) do not have a flags
      argument, but since virDomainHasCurrentSnapshot takes a flags argument,
      I figured it was safer to provide a flags argument here as well.
      
      * include/libvirt/libvirt.h.in (virDomainSnapshotIsCurrent)
      (virDomainSnapshotHasMetadata): New declarations.
      * src/libvirt.c (virDomainSnapshotIsCurrent)
      (virDomainSnapshotHasMetadata): New functions.
      * src/libvirt_public.syms (LIBVIRT_0.9.13): Export them.
      * src/driver.h (virDrvDomainSnapshotIsCurrent)
      (virDrvDomainSnapshotHasMetadata): New driver callbacks.
      2e13b9ab
  3. 11 6月, 2012 13 次提交
    • E
      snapshot: virsh indentation cleanup · 90356024
      Eric Blake 提交于
      No semantic change; this will make it easier to refactor code.
      
      * tools/virsh.c (cmdSnapshotList): Drop level of indentation, and
      rename a variable.
      90356024
    • E
      virsh: make tree listing more flexible · c8564ad4
      Eric Blake 提交于
      Requiring the user to pass in parallel arrays of names and parents
      is annoying; it means that you can't qsort one of the arrays without
      invalidating the ordering of the other.  By refactoring this function
      to use callbacks, we isolate the layout to be independent of the
      printing, and a future patch can exploit that to improve layout.
      
      * tools/virsh.c (vshTreePrintInternal): Use callbacks rather than
      requiring a char** array.
      (vshTreeArrayLookup): New helper function.
      (vshTreePrint, cmdNodeListDevices, cmdSnapshotList): Update callers.
      c8564ad4
    • E
      virsh: remove limits on tree listing · ef981053
      Eric Blake 提交于
      I am not a fan of fixed-width buffers.  All it takes is a
      linear chain of more than 100 snapshots to mess up 'virsh
      snapshot-list --tree'.  Now that virBuffer is more powerful,
      we might as well exploit its power.
      
      * tools/virsh.c (cmdNodeListDevicesPrint): Simplify to use a
      virBuffer instead of fixed-width prefix, factor guts, and rename...
      (vshTreePrint, vshTreePrintInternal): ...along with new helper.
      (cmdNodeListDevices, cmdSnapshotList): Update callers.
      ef981053
    • E
      buf: support peeking at string contents · 9202f2c2
      Eric Blake 提交于
      Right now, the only way to get at the contents of a virBuffer is
      to destroy it.  But there are cases in my upcoming patches where
      peeking at the contents makes life easier.  I suppose this does
      open up the potential for bad code to dereference a stale pointer,
      by disregarding the docs that the return value is invalid on the
      next virBuf operation, but such is life.
      
      * src/util/buf.h (virBufferCurrentContent): New declaration.
      * src/util/buf.c (virBufferCurrentContent): Implement it.
      * src/libvirt_private.syms (buf.h): Export it.
      * tests/virbuftest.c (testBufAutoIndent): Test it.
      9202f2c2
    • M
      rpc: Fix memleak in virNetMessageEncodeHeader · 539e9b34
      Michal Privoznik 提交于
      My latest patch for RPC rework (a2c304f6) introduced a memory leak.
      virNetMessageEncodeHeader() is calling VIR_ALLOC_N(msg->buffer, ...)
      despite fact, that msg->buffer isn't VIR_FREE()'d on all paths calling
      the function. Therefore, rather than injecting free statement switch to
      VIR_REALLOC_N().
      539e9b34
    • D
      Fix privileges on /var/run/libvirt directory · 0ec82620
      Daniel P. Berrange 提交于
      Previous commit
      
        commit 32a9aac2
        Author: William Jon McCann <william.jon.mccann@gmail.com>
        Date:   Thu May 3 12:36:27 2012 -0400
      
          Use XDG Base Directories instead of storing in home directory
      
      Accidentally changed the umask when creating /var/run/libvirt
      to 077. This prevents /var/run/libvirt being readable by non-root,
      which is required for non-root to connect to libvirtd. Fix the
      code so that umask 077 is only used for the non-privileged libvirtd
      instance.
      0ec82620
    • D
      Only migrate profile in non-privileged libvirtd instance · 19c08b56
      Daniel P. Berrange 提交于
      Only the non-privileged libvirtd instance uses $HOME. So avoid
      running the code for migrating to XDG directories unless using
      a non-privileged libvirtd
      19c08b56
    • E
      snapshot: avoid virsh crash with older servers · d9f60665
      Eric Blake 提交于
      Commits 51082301, 16d7b390, and 521cc447 introduced support for
      'virsh snapshot-list --from' when talking to a server older than
      0.9.5, but broke support for plain 'virsh snapshot-list' for the
      same old server in the process.  Because the code is not properly
      gated, we end up with a SIGSEGV during a strcmp with a NULL argument.
      
      * tools/virsh.c (cmdSnapshotList): Don't waste time on fallbacks
      when --from is not present.
      d9f60665
    • O
      Update AUTHORS · d41d2526
      Osier Yang 提交于
      Commit a80bb970 forgot to update authors.
      d41d2526
    • G
      LXC: fix memory leak in lxcContainerMountFSBlockAuto · e49d792f
      Gao feng 提交于
      we forgot to free fslist,just add VIR_FREE(fslist).
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      e49d792f
    • G
      LXC: fix incorrect parameter of mount in lxcContainerMountFSBind · 0cb787bd
      Gao feng 提交于
      when do remount,the source and target should be the same
      values specified in the initial mount() call.
      
      So change fs->dst to src.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      0cb787bd
    • G
      LXC: Delete unused variable src in lxcContainerMountBasicFS · a80bb970
      Gao feng 提交于
      There is no code use the variable "src" in lxcContainerMountBasicFS.
      so delete it and VIR_FREE.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      a80bb970
    • G
      msg_buf_size is unsigned long not size_t · 2d98c686
      Guido Günther 提交于
      This fixes the build on 32bit systems which otherwise fails with:
      
      virnetmessagetest.c: In function 'testMessageHeaderEncode':
      virnetmessagetest.c:75:9: error: format '%zu' expects argument of type 'size_t', but argument 7 has type 'long unsigned int' [-Werror=format]
      2d98c686
  4. 09 6月, 2012 2 次提交
  5. 08 6月, 2012 4 次提交
    • J
      util: Fix deadlock in virLogReset · d581313a
      Jiri Denemark 提交于
      When libvirtd forks off a new child, the child then calls virLogReset(),
      which ends up closing file descriptors used as log outputs. However, we
      recently started logging closed file descriptors, which means we need to
      lock logging mutex which was already locked by virLogReset(). We don't
      really want to log anything when we are in the process of closing log
      outputs.
      d581313a
    • C
    • L
      Assign correct address type to spapr-vlan and spapr-vty. · 04a319ba
      Li Zhang 提交于
      For pseries guest, spapr-vlan and spapr-vty is based
      on spapr-vio address. According to model of network
      device, the address type should be assigned automatically.
      For serial device, serial pty device is recognized as
      spapr-vty device, which is also on spapr-vio.
      
      So this patch is to correct the address type of
      spapr-vlan and spapr-vty, and build correct
      command line of spapr-vty.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Reviewed-by:   Michael Ellerman<michaele@au1.ibm.com>
      04a319ba
    • E
      maint: make it easier to copy FORTIFY_SOURCE snippet · 1c2edf0f
      Eric Blake 提交于
      While libvirt intentionally avoids -Wundef (after all, C99
      guarantees sane semantics of treating undefined macros as 0),
      the glibc insanity of #warning on _FORTIFY_SOURCE coupled with
      what some people feel is the black magic of autoconf means
      that other projects are likely to copy our snippet verbatim.
      We can be nicer to other projects by making it easier to
      integrate into projects that use -Wundef.
      
      Suggested by Christophe Fergeau.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Be nice
      to other projects using -Wundef.
      1c2edf0f
  6. 07 6月, 2012 5 次提交
    • E
      command: avoid potential deadlock on handshake · 5e8ab391
      Eric Blake 提交于
      There is a theoretical problem of an extreme bug where we can get
      into deadlock due to command handshaking.  Thanks to a pair of pipes,
      we have a situation where the parent thinks the child reported an
      error and is waiting for a message from the child to explain the
      error; but at the same time the child thinks it reported success
      and is waiting for the parent to acknowledge the success; so both
      processes are now blocked.
      
      Thankfully, I don't think this deadlock is possible without at
      least one other bug in the code, but I did see exactly that sort
      of situation prior to commit da831afc - I saw a backtrace where a
      double close bug in the parent caused the parent to read from the
      wrong fd and assume the child failed, even though the child really
      sent success.
      
      This potential deadlock is not quite like commit 858c2476 (a deadlock
      due to multiple readers on one pipe preventing a write from completing),
      although the solution is similar - always close unused pipe fds before
      blocking, rather than after.
      
      * src/util/command.c (virCommandHandshakeWait): Close unused fds
      sooner.
      5e8ab391
    • M
      qemu: better detection of crashed domains · bda2f17d
      Martin Kletzander 提交于
      When libvirtd is started and there is an unusable/not-connectable
      leftover from earlier started machine, it's more reasonable to say
      that the machine "crashed" if we know it was started with
      "-no-shutdown".
      This patch fixes that and also changes the other result (when machine
      was started without "-no-shutdown") to "unknown", because the previous
      "failed" reason means (according to include/libvirt/libvirt.h.in:174),
      that the machine failed to start.
      bda2f17d
    • E
      build: fix build without i18n · b2ecfe97
      Eric Blake 提交于
      If you compile without NLS support, where _() is a no-op macro,
      then we end up passing a string literal to a char*, provoking:
      
      In file included from virsh.c:3639:0:
      virsh-edit.c: In function ‘cmdSaveImageEdit’:
      virsh-edit.c:97:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]
      virsh-edit.c:106:13: error: assignment discards ‘const’ qualifier from pointer target type [-Werror]
      
      * tools/virsh-edit.c: Be const-safe.
      b2ecfe97
    • C
      spec: Build against systemd for udev · dd7bc51b
      Cole Robinson 提交于
      They have now merged. Fedora details here:
      
      https://lists.fedoraproject.org/pipermail/devel/2012-June/168227.html
      dd7bc51b
    • E
      build: fix build of fresh checkout · ca02b101
      Eric Blake 提交于
      Commit 7bff56a0 worked in an incremental build, but fails for a
      fresh clone; apparently, if make sees both an actual file
      spelling and an inference rule, only the exact spelling is used.
      
        CCLD   libvirt_driver_test.la
        CC     libvirt_driver_remote_la-remote_driver.lo
      remote/remote_driver.c:4707:34: fatal error: remote_client_bodies.h: No such file or directory
      compilation terminated.
      
      BUILT_SOURCES to the rescue, instead of trying to mess with .lo
      dependencies directly.
      
      * src/Makefile.am (REMOTE_DRIVER_PREREQS, %remote_driver.lo): Drop...
      (BUILT_SOURCES): ...and add here instead.
      ca02b101