1. 29 3月, 2011 22 次提交
    • D
      Support volume data upload/download APIs in storage driver · 92563962
      Daniel P. Berrange 提交于
      Use generic FD streams to allow data upload/download to/from
      any storage volume
      
      * src/storage/storage_driver.c: Wire up upload/download APIs
      92563962
    • D
      Add vol-upload and vol-download commands to virsh · 6299ca71
      Daniel P. Berrange 提交于
      The new commands vol-upload and vol-download, allow a local file
      to be transferred to/from a storage volume.
      
      * tools/virsh.c: Add vol-upload and vol-download commands
      * tools/virsh.pod: Document new commands
      6299ca71
    • D
      Add public APIs for storage volume upload/download · 7300f68d
      Daniel P. Berrange 提交于
      New APIs are added allowing streaming of content to/from
      storage volumes.
      
      * include/libvirt/libvirt.h.in: Add virStorageVolUpload and
        virStorageVolDownload APIs
      * src/driver.h, src/libvirt.c, src/libvirt_public.syms: Stub
        code for new APIs
      * src/storage/storage_driver.c, src/esx/esx_storage_driver.c:
        Add dummy entries in driver table for new APIs
      7300f68d
    • D
      Enhance the streams helper to support plain file I/O · e886237a
      Daniel P. Berrange 提交于
      The O_NONBLOCK flag doesn't work as desired on plain files
      or block devices. Introduce an I/O helper program that does
      the blocking I/O operations, communicating over a pipe that
      can support O_NONBLOCK
      
      * src/fdstream.c, src/fdstream.h: Add non-blocking I/O
        on plain files/block devices
      * src/Makefile.am, src/util/iohelper.c: I/O helper program
      * src/qemu/qemu_driver.c, src/lxc/lxc_driver.c,
        src/uml/uml_driver.c, src/xen/xen_driver.c: Update for
        streams API change
      e886237a
    • D
      Update event loop example programs to demonstrate best practice · 0c97e70b
      Daniel P. Berrange 提交于
      The example C event loop code is a nasty hack and not compliant
      with the require API semantics. Delete this, so that developers
      don't mistakenly copy it. Instead call the new public event loop
      APIs.
      
      Update the python event loop example, so that it can optionally
      use the public event APIs, as an alternative to the pure python
      code. The pure python event code is a good working example, so
      don't delete it.
      
      Also make the python example use a read only connection to avoid
      authentication prompts
      
      * examples/domain-events/events-c/event-test.c: Replace event
        loop code with use of public APIs
      * examples/domain-events/events-python/event-test.py: Allow
        optional use of new public event APIs
      0c97e70b
    • E
      qemu: fix regression that hangs on save failure · 83b77fa5
      Eric Blake 提交于
      Regression introduced in commit 6034ddd5.
      
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Jump to correct
      label.
      83b77fa5
    • E
      build: fix compilation on mingw · 16a4243c
      Eric Blake 提交于
      * src/util/command.c (virCommandAbort) [WIN32]: Provide stub.
      Reported by Daniel P. Berrange's autobuilder.
      16a4243c
    • E
      qemu: support fd: migration with compression · 15d757ac
      Eric Blake 提交于
      Spawn the compressor ourselves, instead of requiring the shell.
      
      * src/qemu/qemu_migration.c (qemuMigrationToFile): Spawn
      compression helper process when needed.
      15d757ac
    • E
      qemu: skip granting access during fd migration · 34fa0de0
      Eric Blake 提交于
      SELinux labeling and cgroup ACLs aren't required if we hand a
      pre-opened fd to qemu.  All the more reason to love fd: migration.
      
      * src/qemu/qemu_migration.c (qemuMigrationToFile): Skip steps
      that are irrelevant in fd migration.
      34fa0de0
    • E
      qemu: consolidate migration to file code · 6034ddd5
      Eric Blake 提交于
      This points out that core dumps (still) don't work for root-squash
      NFS, since the fd is not opened correctly.  This patch should not
      introduce any functionality change, it is just a refactoring to
      avoid duplicated code.
      
      * src/qemu/qemu_migration.h (qemuMigrationToFile): New prototype.
      * src/qemu/qemu_migration.c (qemuMigrationToFile): New function.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag, doCoreDump): Use
      it.
      6034ddd5
    • E
      qemu: use common API for reading difficult files · 80449b32
      Eric Blake 提交于
      Direct access to an open file is so much simpler than passing
      everything through a pipe!
      
      * src/qemu/qemu_driver.c (qemudOpenAsUID)
      (qemudDomainSaveImageClose): Delete.
      (qemudDomainSaveImageOpen): Rename...
      (qemuDomainSaveImageOpen): ...and drop read_pid argument.  Use
      virFileOpenAs instead of qemudOpenAsUID.
      (qemudDomainSaveImageStartVM, qemudDomainRestore)
      (qemudDomainObjRestore): Rename...
      (qemuDomainSaveImageStartVM, qemuDomainRestore)
      (qemDomainObjRestore): ...and simplify accordingly.
      (qemudDomainObjStart, qemuDriver): Update callers.
      80449b32
    • E
      qemu, storage: improve type safety · 1a369dfb
      Eric Blake 提交于
      * src/storage/storage_backend.c (createRawFileOpHook): Change
      signature.
      (struct createRawFileOpHookData): Delete unused struct.
      (virStorageBackendCreateRaw): Adjust caller.
      * src/qemu/qemu_driver.c (struct fileOpHookData): Delete unused
      struct.
      (qemudDomainSaveFileOpHook): Rename...
      (qemuDomainSaveFileOpHook): ...and change signature.
      (qemudDomainSaveFlag): Adjust caller.
      1a369dfb
    • E
      util: adjust indentation in previous patch · fa3e1e35
      Eric Blake 提交于
      Separating the indentation from the real patch made review easier.
      
      * src/util/util.c (virFileOpenAs): Whitespace changes.
      fa3e1e35
    • E
      util: rename virFileOperation to virFileOpenAs · 1fdd50f9
      Eric Blake 提交于
      This patch intentionally doesn't change indentation, in order to
      make it easier to review the real changes.
      
      * src/util/util.h (VIR_FILE_OP_RETURN_FD, virFileOperationHook):
      Delete.
      (virFileOperation): Rename...
      (virFileOpenAs): ...and reduce parameters.
      * src/util/util.c (virFileOperationNoFork, virFileOperation):
      Rename and simplify.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust caller.
      * src/storage/storage_backend.c (virStorageBackendCreateRaw):
      Likewise.
      * src/libvirt_private.syms: Reflect rename.
      1fdd50f9
    • E
      storage: simplify fd handling · fe303a42
      Eric Blake 提交于
      * src/storage/storage_backend.c (virStorageBackendCreateRaw): Use
      new virFileOperation flag.
      fe303a42
    • E
      qemu: simplify domain save fd handling · 3eede281
      Eric Blake 提交于
      This makes root-squash NFS saves more efficient.
      
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Use new
      virFileOperation flag to open fd only once.
      3eede281
    • E
      util: use SCM_RIGHTS in virFileOperation when needed · 055d4ff8
      Eric Blake 提交于
      Currently, the hook function in virFileOperation is extremely limited:
      it must be async-signal-safe, and cannot modify any memory in the
      parent process.  It is much handier to return a valid fd and operate
      on it in the parent than to deal with hook restrictions.
      
      * src/util/util.h (VIR_FILE_OP_RETURN_FD): New flag.
      * src/util/util.c (virFileOperationNoFork, virFileOperation):
      Honor new flag.
      055d4ff8
    • E
      qemu: allow simple domain save to use fd: protocol · 9497506f
      Eric Blake 提交于
      This allows direct saves (no compression, no root-squash NFS) to use
      the more efficient fd: migration, which in turn avoids a race where
      qemu exec: migration can sometimes fail because qemu does a generic
      waitpid() that conflicts with the pclose() used by exec:.  Further
      patches will solve compression and root-squash NFS.
      
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Use new function
      when there is no compression.
      9497506f
    • E
      qemu: fix restoring a compressed save image · d51023d4
      Eric Blake 提交于
      Latent bug introduced in commit 2d6a5819 (Aug 2009), but not exposed
      until commit 1859939a (Jan 2011).  Basically, when virExec creates a
      pipe, it always marks libvirt's side as cloexec.  If libvirt then
      wants to hand that pipe to another child process, things work great if
      the fd is dup2()'d onto stdin or stdout (as with stdin: or exec:
      migration), but if the pipe is instead used as-is (such as with fd:
      migration) then qemu sees EBADF because the fd was closed at exec().
      
      This is a minimal fix for the problem at hand; it is slightly racy,
      but no more racy than the rest of libvirt fd handling, including the
      case of uncompressed save images.  A more invasive fix, but ultimately
      safer at avoiding leaking unintended fds, would be to _always and
      atomically_ open all fds as cloexec in libvirt (thanks to primitives
      like open(O_CLOEXEC), pipe2(), accept4(), ...), then teach virExec to
      clear that bit for all fds explicitly marked to be handed to the child
      only after forking.
      
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Clear cloexec
      flag.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Tweak test.
      d51023d4
    • E
      util: allow clearing cloexec bit · 296eb0bb
      Eric Blake 提交于
      * src/util/util.h (virSetInherit): New prototype.
      * src/util/util.c (virSetCloseExec): Move guts...
      (virSetInherit): ...to new function, and allow clearing.
      * src/libvirt_private.syms (util.h): Export it.
      296eb0bb
    • E
      logging: always NUL-terminate circular buffer · 60dea30b
      Eric Blake 提交于
      * src/util/logging.c (virLogStartup, virLogSetBufferSize):
      Over-allocate, so that a debugger can just print the circular
      buffer.  Suggested by Daniel Veillard.
      60dea30b
    • E
      maint: use space, not tab, in remote_protocol-structs · 009bd51b
      Eric Blake 提交于
      * src/Makefile.am (remote_protocol-structs): Flatten tabs.
      * src/remote_protocol-structs: Likewise.  Also add a hint to emacs
      to make it easier to keep spaces in the file.
      009bd51b
  2. 28 3月, 2011 7 次提交
    • E
      tests: don't alter state in $HOME · d0c7254b
      Eric Blake 提交于
      Diego reported a bug where virsh tries to initialize a readline
      history directory during 'make check' run as root, but fails
      because /root was read-only.
      
      It turns out that I could reproduce this as non-root, by using:
      
      mv ~/.virsh{,.bak}
      chmod a-w ~
      make check -C tests TESTS=int-overflow
      chmod u+w ~
      mv ~/.virsh{.bak,}
      
      * tests/int-overflow: Don't trigger interactive mode.
      Reported by Diego Elio Pettenò.
      d0c7254b
    • E
      docs: document recent hook additions · ef701fd8
      Eric Blake 提交于
      * src/qemu/qemu_process.c (qemuProcessStart, qemuProcessStop): Fix
      typos.
      * docs/hooks.html.in: Document 'prepare' and 'release' hooks.
      ef701fd8
    • E
      qemu: don't restore state label twice · 96d56786
      Eric Blake 提交于
      Otherwise, if something like doStopVcpus fails after the first
      restore, a second restore is attempted and throws a useless
      warning.
      
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Avoid second
      restore of state label.
      96d56786
    • D
      Remove the Open Nebula driver · 4591df76
      Daniel P. Berrange 提交于
      The Open Nebula driver has been unmaintained since it was first
      introduced. The only commits have been for tree-wide cleanups.
      It also has a major design flaw, in that it only knows about guests
      that it has created itself, which makes it of very limited use.
      
      Discussions wrt evolution of the VMWare ESX driver, concluded that
      it should limit itself to single-node ESX operation and not try to
      manage the multi-node architecture of VirtualCenter. Open Nebula
      is a cluster like Virtual Center, not a single node system, so
      the same reasoning applies.
      
      The DeltaCloud project includes an Open Nebula driver and is a much
      better fit architecturally, since it is explicitly targetting the
      distributed multihost cluster scenario.
      
      Thus this patch deletes the libvirt Open Nebula driver with the
      recommendation that people use DeltaCloud for managing it instead.
      
      * configure.ac: Remove probe for xmlrpc & --with-one arg
      * daemon/Makefile.am, daemon/libvirtd.c, src/Makefile.am: Remove
        ONE driver build
      * src/opennebula/one_client.c, src/opennebula/one_client.h,
        src/opennebula/one_conf.c, src/opennebula/one_conf.h,
        src/opennebula/one_driver.c, src/opennebula/one_driver.c: Delete
        files
      * autobuild.sh, libvirt.spec.in, mingw32-libvirt.spec.in: Remove
        build rules for Open Nebula
      * docs/drivers.html.in, docs/sitemap.html.in: Remove reference
        to OpenNebula
      * docs/drvone.html.in: Delete file
      4591df76
    • O
      Fix syntax error in configure.ac · ab8984e4
      Osier Yang 提交于
      Which will lead "./configure --with-audit=yes" breaks.
      ab8984e4
    • D
      Update of localisations, switch to transifex · 191238e5
      Daniel Veillard 提交于
      Last pull from i18n CVS, then push to transifex.net which is now
      our localization upstream:
      
      http://www.transifex.net/projects/p/libvirt/resource/strings/
      191238e5
    • D
      Update on the goal page · 50d8ad82
      Daniel Veillard 提交于
      Some things to note in this patch:
         - we do extend libvirt scope beyond purely managing domains, there is
           already a number of blocks which are here as helpr functions to
           manage the resources on the host.
         - we are expanding in the direction of libvirt being sufficient to do
           most of the management on the Host (but within the limits of the need
           for virtualization, e.g. managing users on the host is out of scope)
         - we don't require anymore APIs to be supported by multiple
           hypervisors to get in, it's already the case in practice, but we
           should still make sure the semantic of those APIs are clear. We
           added quite a bit for QEmu, but for example I saw on IRC that VBox
           could emulate a network unplug/replug on a domain interface, and
           that would be a good addition even if a priori no other hypervisor
           supports it.
         - Make clear that all libvirt APIs are available remotely, which is
           key to use libvirt for building management tools.
         - link the goal page from the project main page
      
      As for libvirt project directions, I think it just reflects the natural
      evolution in the last couple of years. We are less hypervisor agnostic
      and extending in the Host management. Clearly there is interest in
      making sure libvirt is complete in term of features for the hypervisors
      supported, especially the ones like KVM or LXC which don't really have
      integrated management library.
      
      * docs/goals.html.in: update the goals page
      * docs/index.html.in: link it from the top page
      50d8ad82
  3. 26 3月, 2011 2 次提交
  4. 25 3月, 2011 9 次提交
    • P
      Add missing { for qemudDomainInterfaceStats · 24da1095
      Philipp Hahn 提交于
      Add missing open curly brace between function declaration of non-linux
      variant of qemudDomainInterfaceStats() and its body.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      24da1095
    • E
      build: shorten libxenlight summary for consistent alignment · b5a048ed
      Eric Blake 提交于
      * configure.ac: Use xenlight: rather than libxenlight: in summary.
      Suggested by Daniel Veillard.
      b5a048ed
    • J
      daemon: Avoid resetting errors before they are reported · 55cc591f
      Jiri Denemark 提交于
      Commit f44bfb7f was supposed to make sure no additional libvirt API (esp.
      *Free) is called before remoteDispatchConnError() is called on error.
      However, the patch missed two instances.
      55cc591f
    • E
      command: add virCommandAbort for cleanup paths · 9ed54518
      Eric Blake 提交于
      Sometimes, an asynchronous helper is started (such as a compressor
      or iohelper program), but a later error means that we want to
      abort that child.  Make this easier.
      
      Note that since daemons and virCommandRunAsync can't mix, the only
      time virCommandFree can reap a process is if someone did
      virCommandRunAsync for a non-daemon and didn't stash the pid.
      
      * src/util/command.h (virCommandAbort): New prototype.
      * src/util/command.c (_virCommand): Add new field.
      (virCommandRunAsync, virCommandWait): Track whether pid was used.
      (virCommandFree): Reap child if caller did not request pid.
      (virCommandAbort): New function.
      * src/libvirt_private.syms (command.h): Export it.
      * tests/commandtest.c (test19): New test.
      9ed54518
    • E
      command: don't mix RunAsync and daemons · 4e808602
      Eric Blake 提交于
      It doesn't make sense to run a daemon without synchronously
      waiting for the child process to reply whether the daemon has
      been kicked off and pidfile written yet.
      
      * src/util/command.c (VIR_EXEC_RUN_SYNC): New constant.
      (virCommandRun): Set temporary flag.
      (virCommandRunAsync): Use it to prevent async runs of intermediate
      child when spawning asynchronous daemon grandchild.
      4e808602
    • E
      command: properly diagnose process exit via signal · 208a044a
      Eric Blake 提交于
      Child processes don't always reach _exit(); if they die from a
      signal, then any messages should still be accurate.  Most users
      either expect a 0 status (thankfully, if status==0, then
      WIFEXITED(status) is true and WEXITSTATUS(status)==0 for all
      known platforms) or were filtering on WIFEXITED before printing
      a status, but a few were missing this check.  Additionally,
      nwfilter_ebiptables_driver was making an assumption that works
      on Linux (where WEXITSTATUS shifts and WTERMSIG just masks)
      but fails on other platforms (where WEXITSTATUS just masks and
      WTERMSIG shifts).
      
      * src/util/command.h (virCommandTranslateStatus): New helper.
      * src/libvirt_private.syms (command.h): Export it.
      * src/util/command.c (virCommandTranslateStatus): New function.
      (virCommandWait): Use it to also diagnose status from signals.
      * src/security/security_apparmor.c (load_profile): Likewise.
      * src/storage/storage_backend.c
      (virStorageBackendQEMUImgBackingFormat): Likewise.
      * src/util/util.c (virExecDaemonize, virRunWithHook)
      (virFileOperation, virDirCreate): Likewise.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesExecCLI):
      Likewise.
      208a044a
    • M
      Add memory functions to libxl driver · 6ef1f6c2
      Markus Groß 提交于
      6ef1f6c2
    • W
      fix the check of the output of monitor command 'device_add' · c4dae2d9
      Wen Congyang 提交于
      Hotpluging host usb device by text mode will fail, because the monitor
      command 'device_add' outputs 'husb: using...' if it succeeds, but we
      think the command should not output anything.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      c4dae2d9
    • E
      build: enforce reference count checking · 72d4ff5b
      Eric Blake 提交于
      Add the compiler attribute to ensure we don't introduce any more
      ref bugs like were just patched in commit 9741f346, then explicitly
      mark the remaining places in code that are safe.
      
      * src/qemu/qemu_monitor.h (qemuMonitorUnref): Mark
      ATTRIBUTE_RETURN_CHECK.
      * src/conf/domain_conf.h (virDomainObjUnref): Likewise.
      * src/conf/domain_conf.c (virDomainObjParseXML)
      (virDomainLoadStatus): Fix offenders.
      * src/openvz/openvz_conf.c (openvzLoadDomains): Likewise.
      * src/vmware/vmware_conf.c (vmwareLoadDomains): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjBeginJob)
      (qemuDomainObjBeginJobWithDriver)
      (qemuDomainObjExitRemoteWithDriver): Likewise.
      * src/qemu/qemu_monitor.c (QEMU_MONITOR_CALLBACK): Likewise.
      Suggested by Daniel P. Berrange.
      72d4ff5b