1. 21 6月, 2010 5 次提交
    • J
      Misc cleanups · d147b18d
      Jiri Denemark 提交于
      - Fix documentation for virGetStorageVol: it has 'key' argument instead
        of 'uuid'.
      - Remove TODO comment from virReleaseStorageVol: we use volume key as an
        identifier instead of UUID.
      - Print human-readable UUID string in debug message in virReleaseSecret.
      d147b18d
    • J
      Do not free static buffer with UUID · 72a7f8b2
      Jiri Denemark 提交于
      As anywhere else, uuid is defined as a fixed size array inside
      _virSecret structure; we shouldn't try to free it.
      72a7f8b2
    • J
      Remove unnecessary check for non-NULL uuid · c5ec45a3
      Jiri Denemark 提交于
      The first thing we do in all these functions is to check uuid != NULL
      and fail if it isn't.
      c5ec45a3
    • J
      Index hashes by UUID instead of name · 30ec755e
      Jiri Denemark 提交于
      Per-connection hashes for domains, networks, storage pools and network
      filter pools were indexed by names which was not the best choice. UUIDs
      are better identifiers, so lets use them.
      30ec755e
    • P
      Allow one-or-more <boot dev="..."/> entries · ff5f7d72
      Philipp Hahn 提交于
      According to docs/formatdomain.html.in, "The boot element can be
      repeated multiple times to setup a priority list of boot devices to try
      in turn." The Relax-NG schema required / allowed exactly one entry.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      ff5f7d72
  2. 19 6月, 2010 1 次提交
    • S
      nwfilter: extensions of docs with · 7057f39c
      Stefan Berger 提交于
      As requested, here a couple of paragraphs about the recently added statematch attribute and some advanced (and tricky) traffic filtering topics.
      7057f39c
  3. 18 6月, 2010 8 次提交
  4. 17 6月, 2010 9 次提交
    • S
      nwfilter: use match target on incoming traffic · 2dce9701
      Stefan Berger 提交于
      The following patch enables the iptables match target to be used by
      default for incoming traffic. So far it has only be used for outgoing
      traffic.
      2dce9701
    • S
      macvtap: work-around for 2.6.32 and older kernels · 045a5722
      Stefan Berger 提交于
      This patch works around a recent extension of the netlink driver I had made use of when building the netlink messages. Unfortunately older kernels don't accept IFLA_IFNAME + name of interface as a replacement for the interface's index, so this patch now gets the interface index ifindex if it's not provided (ifindex <= 0).
      045a5722
    • J
      virsh: change printf() calls to vshPrint() · 07be2403
      Justin Clift 提交于
      Trivial fix changing printf() calls to vshPrint() where the ctl
      variable is available.
      07be2403
    • J
      virsh: improve help text for vol query commands · 7d38d7b4
      Justin Clift 提交于
      Improves the help text for vol-path, vol-name, and vol-key, which
      previously referred to volume UUIDs.
      
      Addresses BZ # 598365.
      7d38d7b4
    • J
      virsh: add pool support to vol-key command · 31495ef6
      Justin Clift 提交于
      Presently the vol-key command only supports being provided with
      a volume path.
      
      This patch adds support for providing it with a pool and volume
      identifier pair as well.
      
          virsh # vol-key --pool <pool-name-or-uuid> <vol-name-or-path>
      31495ef6
    • M
      Add several missing vir*Free calls in libvirtd's remote code · 08d42b52
      Matthias Bolte 提交于
      Justin Clift reported a problem with adding virStoragePoolIsPersistent
      to virsh's pool-info command, resulting in a strange problem. Here's
      an example:
      
          virsh # pool-create-as images_dir3 dir - - - - "/home/images2"
          Pool images_dir3 created
      
          virsh # pool-info images_dir3
          Name:           images_dir3
          UUID:           90301885-94eb-4ca7-14c2-f30b25a29a36
          State:          running
          Capacity:       395.20 GB
          Allocation:     30.88 GB
          Available:      364.33 GB
      
          virsh # pool-destroy images_dir3
          Pool images_dir3 destroyed
      
      At this point the images_dir3 pool should be gone (because it was
      transient) and we should be able to create a new pool with the same name:
      
          virsh # pool-create-as images_dir3 dir - - - - "/home/images2"
          Pool images_dir3 created
      
          virsh # pool-info images_dir3
          Name:           images_dir3
          UUID:           90301885-94eb-4ca7-14c2-f30b25a29a36
          error: Storage pool not found
      
      The new pool got the same UUID as the first one, but we didn't specify
      one. libvirt should have picked a random UUID, but it didn't.
      
      It turned out that virStoragePoolIsPersistent leaks a reference to the
      storage pool object (actually remoteDispatchStoragePoolIsPersistent does).
      As a result, pool-destroy doesn't remove the virStoragePool for the
      "images_dir3" pool from the virConnectPtr's storagePools hash on libvirtd's
      side. Then the second pool-create-as get's the stale virStoragePool object
      associated with the "images_dir3" name. But this object has the old UUID.
      
      This commit ensures that all get_nonnull_* and make_nonnull_* calls for
      libvirt objects are matched properly with vir*Free calls. This fixes the
      reference leaks and the reported problem.
      
      All remoteDispatch*IsActive and remoteDispatch*IsPersistent functions were
      affected. But also remoteDispatchDomainMigrateFinish2 was affected in the
      success path. I wonder why that didn't surface earlier. Probably because
      domainMigrateFinish2 is executed on the destination host and in the common
      case this connection is opened especially for the migration and gets closed
      after the migration is done. So there was no chance to run into a problem
      because of the leaked reference.
      08d42b52
    • M
      esx: Update case insensitive .vmx tests · 02d57c2b
      Matthias Bolte 提交于
      Commit b9efc7dc made virFileHasSuffix
      case insensitive. Honor this in the tests by switching vmdk to VMDK.
      02d57c2b
    • M
      b0f414c6
    • E
      phyp: sed cleanups · 02988742
      Eric Blake 提交于
      * src/phyp/phyp_driver.c (phypNumDomainsGeneric): Avoid glob
      collision by quoting sed argument.
      (phypDomainSetCPU): Avoid non-portable \+ in sed.
      (phypGetVIOSPartitionID, phypDiskType, phypListDomainsGeneric)
      (phypListDefinedDomains): Micro-optimize anchored substitutions.
      02988742
  5. 16 6月, 2010 1 次提交
  6. 15 6月, 2010 8 次提交
    • E
      virsh: add start --paused support · cbe6ebdb
      Eric Blake 提交于
      Make 'start --paused' mirror 'create --paused'.
      
      * tools/virsh.c (cmdStart): Use new virDomainCreateWithFlags API
      when needed.
      * tools/virsh.pod (start): Document --paused.
      cbe6ebdb
    • E
      qemu: support starting persistent domain paused · d024d2ba
      Eric Blake 提交于
      Match earlier change for qemu pause support with virDomainCreateXML.
      
      * src/qemu/qemu_driver.c (qemudDomainObjStart): Add parameter; all
      callers changed.
      (qemudDomainStartWithFlags): Implement flag support.
      d024d2ba
    • E
      drivers: add virDomainCreateWithFlags if virDomainCreate exists · de3aadaa
      Eric Blake 提交于
      * src/esx/esx_driver.c (esxDomainCreate): Move guts...
      (esxDomainCreateWithFlags): ...to new function.
      (esxDriver): Trivially support the new API.
      * src/lxc/lxc_driver.c (lxcDomainStart, lxcDomainStartWithFlags)
      (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDomainStart)
      (oneDomainStartWithFlags, oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainCreate)
      (openvzDomainCreateWithFlags, openvzDriver): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainStart)
      (qemudDomainStartWithFlags, qemuDriver): Likewise.
      * src/test/test_driver.c (testDomainCreate)
      (testDomainCreateWithFlags, testDriver): Likewise.
      * src/uml/uml_driver.c (umlDomainStart, umlDomainStartWithFlags)
      (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainCreate)
      (vboxDomainCreateWithFlags, Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainCreate)
      (xenUnifiedDomainCreateWithFlags, xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreate)
      (xenapiDomainCreateWithFlags, xenapiDriver): Likewise.
      de3aadaa
    • E
      remote: protocol implementation for virDomainCreateWithFlags · 6c83e7ca
      Eric Blake 提交于
      Define the wire format for the new virDomainCreateWithFlags
      API, and implement client and server side of marshaling code.
      
      * daemon/remote.c (remoteDispatchDomainCreateWithFlags): Add
      server side dispatch for virDomainCreateWithFlags.
      * src/remote/remote_driver.c (remoteDomainCreateWithFlags)
      (remote_driver): Client side serialization.
      * src/remote/remote_protocol.x
      (remote_domain_create_with_flags_args)
      (remote_domain_create_with_flags_ret)
      (REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS): Define wire format.
      * daemon/remote_dispatch_args.h: Regenerate.
      * daemon/remote_dispatch_prototypes.h: Likewise.
      * daemon/remote_dispatch_table.h: Likewise.
      * src/remote/remote_protocol.c: Likewise.
      * src/remote/remote_protocol.h: Likewise.
      * src/remote_protocol-structs: Likewise.
      6c83e7ca
    • E
      libvirt: introduce domainCreateWithFlags API · 460ca88b
      Eric Blake 提交于
      Persistent domain creation needs the same features as transient
      domains, but virDomainCreate lacks the flags argument present in
      virDomainCreateXML.  virDomainCreateFlags is already claimed as
      a public enum, so we have to break convention and expose
      virDomainCreateWithFlags.
      
      * include/libvirt/libvirt.h.in (virDomainCreateWithFlags): Add.
      * src/driver.h (virDrvDomainCreateWithFlags): Internal API.
      * src/libvirt.c (virDomainCreateWithFlags): Glue public API to
      driver API.
      * src/libvirt_public.syms (LIBVIRT_0.8.2): Expose public API.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      460ca88b
    • E
      maint: simplify some ignore files · fb8552f8
      Eric Blake 提交于
      * .hgignore: Delete, no longer used.
      * examples/python/.gitignore: Delete, covered globally.
      * include/.gitignore: Likewise.
      * python/tests/.gitignore: Likewise.
      * docs/schemas/.gitignore: Likewise.
      * tests/xml2sexprdata/.gitignore: Likewise.
      * tests/sexpr2xmldata/.gitignore: Likewise.
      * tests/confdata/.gitignore: Likewise.
      * tests/xencapsdata/.gitignore: Likewise.
      * tests/xmconfigdata/.gitignore: Likewise.
      * tests/xml2sexprdata/.gitignore: Likewise.
      fb8552f8
    • E
      parthelper: fix compilation without optimization · 352b6df3
      Eric Blake 提交于
      Daniel's patch works with gcc and CFLAGS containing -O (the
      autoconf default), but fails with non-gcc or with other
      CFLAGS (such as -g), since c-ctype.h declares c_isdigit as
      a macro only for certain compilation settings.
      
      * src/Makefile.am (libvirt_parthelper_LDFLAGS): Add gnulib
      library, for when c_isdigit is not a macro.
      * src/storage/parthelper.c (main): Avoid out-of-bounds
      dereference, noticed by Jim Meyering.
      352b6df3
    • D
      Fix enumeration of partitions in disks with a trailing digit in path · bc8d9f20
      Daniel P. Berrange 提交于
      Disks with a trailing digit in their path (eg /dev/loop0 or
      /dev/dm0) have an extra 'p' appended before the partition
      number (eg, to form /dev/loop0p1 not /dev/loop01). Fix the
      partition lookup to append this extra 'p' when required
      
      * src/storage/parthelper.c: Add a 'p' before partition
        number if required
      bc8d9f20
  7. 12 6月, 2010 2 次提交
    • E
      uml: sanity check external data before using it · 582c75ec
      Eric Blake 提交于
      Otherwise, a malicious packet could cause a DoS via spurious
      out-of-memory failure.
      
      * src/uml/uml_driver.c (umlMonitorCommand): Validate that incoming
      data is reliable before using it to allocate/dereference memory.
      Don't report bogus errno on short read.
      Reported by Jim Meyering.
      582c75ec
    • M
      Improve error message for disabled client-side drivers · d0dabc2b
      Matthias Bolte 提交于
      Report that libvirt was built without that driver instead of
      trying to connect to a libvirtd, when we know that this is
      going to fail.
      d0dabc2b
  8. 11 6月, 2010 3 次提交
  9. 10 6月, 2010 2 次提交
    • E
      build: fix some mingw issues · 3cf642a0
      Eric Blake 提交于
      On Fedora 13 with sufficient mingw32-* packages installed, running
      ./autobuild.sh failed to cross-compile to mingw because
      mingw32-pthreads installed a broken <pthread.h>.  With that
      issue fixed, the build still failed due to use of O_SYNC.
      Meanwhile, recent .spec.in changes got out of sync.
      
      * bootstrap.conf (gnulib_modules): Add fcntl-h, for O_SYNC.
      * .gnulib: Update to latest, to work around buggy pthreads-win32
      library.
      * bootstrap: Import latest from gnulib.
      * mingw32-libvirt.spec.in: Distribute new file.
      3cf642a0
    • E
      build: avoid pthreads-win32 on mingw · 6e5a04f0
      Eric Blake 提交于
      * src/util/threads.c (includes) [WIN32]: On mingw, favor native
      threading over pthreads-win32 library.
      * src/util/thread.h [WIN32] Likewise.
      Suggested by Daniel P. Berrange.
      6e5a04f0
  10. 09 6月, 2010 1 次提交
    • D
      Fix cgroup setup code to cope with root squashing NFS · c37c321c
      Daniel P. Berrange 提交于
      When a disk is on a root squashed NFS server, it may not be
      possible to stat() the disk file in virCgroupAllowDevice.
      The virStorageFileGetMeta method may also fail to extract
      the parent backing store. Both of these errors have to be
      ignored to avoid breaking NFS deployments
      
      * src/qemu/qemu_driver.c: Ignore errors in cgroup setup to
         keep root squash NFS happy
      c37c321c