1. 22 7月, 2011 11 次提交
    • M
      destroy: Implement internal API for libxl driver · ba0219a7
      Michal Privoznik 提交于
      ba0219a7
    • M
      destroy: Implement internal API for ESX driver · 3959fe30
      Michal Privoznik 提交于
      3959fe30
    • M
      destroy: Implement internal API for qemu driver · 427eaf13
      Michal Privoznik 提交于
      427eaf13
    • M
      destroy: Wire up the remote protocol · ca79a4fb
      Michal Privoznik 提交于
      ca79a4fb
    • M
      destroy: Define new public API virDomainDestroyFlags · 080bc4ea
      Michal Privoznik 提交于
      This introduces new API virDomainDestroyFlags to allow
      domain destroying with flags, as the existing API virDomainDestroy
      misses flags.
      
      The set of flags is defined in virDomainDestroyFlagsValues enum,
      which is currently commented, because it is empty.
      
      Calling this API with no flags set (@flags == 0) is equivalent calling
      virDomainDestroy.
      080bc4ea
    • E
      save: wire up remote protocol · b6fe647b
      Eric Blake 提交于
      * src/remote/remote_driver.c (remote_driver): Add new callbacks.
      * src/remote/remote_protocol.x (remote_procedure): New RPCs.
      (remote_domain_save_flags_args, remote_domain_restore_flags_args):
      New structs.
      * src/remote_protocol-structs: Update.
      b6fe647b
    • E
      save: new public API to bypass file system cache on save/restore · ad0b9123
      Eric Blake 提交于
      In order to choose whether to use O_DIRECT when saving a domain image
      to a file, we need a new flag.  But virDomainSave was implemented
      before our policy of all new APIs having a flag argument.  Likewise
      for virDomainRestore when restoring from a file.
      
      The new flag name is chosen as CACHE_BYPASS so as not to preclude
      a future solution that uses posix_fadvise once the Linux kernel has
      a smarter implementation of that interface.
      
      * include/libvirt/libvirt.h.in (virDomainCreateFlags)
      (virDomainCoreDumpFlags): Add a flag.
      (virDomainSaveFlags, virDomainRestoreFlags): New prototypes.
      * src/libvirt.c (virDomainSaveFlags, virDomainRestoreFlags): New API.
      * src/libvirt_public.syms: Export them.
      * src/driver.h (virDrvDomainSaveFlags, virDrvDomainRestoreFlags):
      New driver callbacks.
      ad0b9123
    • E
      qemu: fix error message with migrate2 xml · 360e5ea1
      Eric Blake 提交于
      Otherwise, an ABI mismatch gives error messages attributing the target
      xml string as current, and the current domain state as the new xml.
      
      * src/qemu/qemu_migration.c (qemuMigrationBegin): Use correct
      argument order.
      360e5ea1
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
    • E
      command: avoid leaking fds across fork · 5d804ffa
      Eric Blake 提交于
      Since libvirt is multi-threaded, we should use FD_CLOEXEC as much
      as possible in the parent, and only relax fds to inherited after
      forking, to avoid leaking an fd created in one thread to a fork
      run in another thread.  This gets us closer to that ideal, by
      making virCommand automatically clear FD_CLOEXEC on fds intended
      for the child, as well as avoiding a window of time with non-cloexec
      pipes created for capturing output.
      
      * src/util/command.c (virExecWithHook): Use CLOEXEC in parent.  In
      child, guarantee that all fds to pass to child are inheritable.
      (getDevNull): Use CLOEXEC.
      (prepareStdFd): New helper function.
      (virCommandRun, virCommandRequireHandshake): Use pipe2.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Simplify caller.
      5d804ffa
    • E
      command: move all docs into .c file · 42891145
      Eric Blake 提交于
      We already have a precedent of function documentation in C files,
      where it is closer to the implementation (witness libvirt.h vs.
      libvirt.c); maintaining docs in both files risks docs going stale.
      
      While I was at it, I used consistent doxygen style on all comments.
      
      * src/util/command.h: Remove duplicate docs, and move unique
      documentation...
      * src/util/command.c: ...here.
      Suggested by Matthias Bolte.
      42891145
  2. 21 7月, 2011 17 次提交
    • M
      rpc: Make the dispatch generator handle 'void name(void)' style procedures · fbd5465a
      Matthias Bolte 提交于
      The only 'void name(void)' style procedure in the protocol is 'close' that
      is handled special, but also programming errors like a missing _args or
      _ret suffix on the structs in the .x files can create such a situation by
      accident. Making the generator aware of this avoids bogus errors from the
      generator such as:
      
        Use of uninitialized value in exists at ./rpc/gendispatch.pl line 967.
      
      Also this allows to get rid of the -c option and the special case code for
      the 'close' procedure, as the generator handles it now correctly.
      
      Reported by Michal Privoznik
      fbd5465a
    • E
      error: preserve errno when saving last error · 979b784b
      Eric Blake 提交于
      It is common to see the sequence:
      
      virErrorPtr save_err = virSaveLastError();
      // do cleanup
      virSetError(save_err);
      virFreeError(save_err);
      
      on cleanup paths.  But for functions where it is desirable to
      return the errno that caused failure, this sequence can clobber
      that errno.  virFreeError was already safe; this makes the other
      two functions in the sequence safe as well, assuming all goes
      well (on OOM, errno will be clobbered, but then again, save_err
      won't reflect the real error that happened, so you are no longer
      preserving the real situation - that's life with OOM).
      
      * src/util/virterror.c (virSaveLastError, virSetError): Preserve
      errno.
      979b784b
    • M
      python: Fix makefile rule for code generation · 1468359f
      Matthias Bolte 提交于
      Commit 8665f855 changed generated.stamp to $(GENERATE).stamp,
      but missed one instance in the CLEANFILES list. This can break the
      build in case the generated code is deleted but the .stamp file stays
      around and therefore the code isn't regenerated.
      1468359f
    • D
      Fix uninitialized variable in QEMU CPU bandwidth code · 5e7d638c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Fix uninitialized variable
      5e7d638c
    • W
      fix make syntax-check error · d6fa4967
      Wen Congyang 提交于
      d6fa4967
    • W
      doc: Add documentation for new cputune elements period and quota · fbdea7cb
      Wen Congyang 提交于
      We have added element period and quota. Document them in formatdomain.html.in.
      fbdea7cb
    • W
      qemu: Implement cfs_period and cfs_quota's modification · 67a173c5
      Wen Congyang 提交于
      This patch implements cfs_period and cfs_quota's modification.
      We can use the command 'virsh schedinfo' to query or modify cfs_period and
      cfs_quota.
      If you query period or quota from config file, the value 0 means it does not set
      in the config file.
      If you set period or quota to config file, the value 0 means that delete current
      setting from config file.
      If you modify period or quota while vm is running, the value 0 means that use
      current value.
      67a173c5
    • W
      qemu: Implement period and quota tunable XML configuration and parsing · c4441fee
      Wen Congyang 提交于
      This patch implements period and quota tunable XML configuration and parsing.
      A quota or period of zero will be simply ignored.
      c4441fee
    • W
      Update XML Schema for new entries · f27f62ca
      Wen Congyang 提交于
      Define the element cputune's child elements 'period' and 'quota':
      <cputune>
        <period>100000</period>
        <quota>50000</quota>
      </cputune>
      f27f62ca
    • W
      cgroup: Implement cpu.cfs_period_us and cpu.cfs_quota_us tuning API · fd7c1723
      Wen Congyang 提交于
      This patch provides 4 APIs to get and set cpu.cfs_period_us and cpu.cfs_quota_us.
      fd7c1723
    • W
      Introduce the function virCgroupForVcpu · 8e64f873
      Wen Congyang 提交于
      Introduce the function virCgroupForVcpu() to create sub directory for each vcpu.
      8e64f873
    • L
      qemu: send-key: Implement the driver methods · e4072577
      Lai Jiangshan 提交于
      qemu driver just accept xt_kbd codeset's keycode, so the lib virtkey
      is used for translating keycodes from other codesets
      e4072577
    • L
      send-key: Expose the new API in virsh · 7818b7ef
      Lai Jiangshan 提交于
      Also support string names for the linux keycode(auto detect)
      * tools/virsh.c: add new command "send-key"
      * tools/virsh.pod: documents the new command
      7818b7ef
    • L
      util: add virtkeycode module · 0bbf87e9
      Lai Jiangshan 提交于
      Add virtkey lib for usage-improvment and keycode translating.
      Add 4 internal API for the aim
      
      const char *virKeycodeSetTypeToString(int codeset);
      int virKeycodeSetTypeFromString(const char *name);
      int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname);
      int virKeycodeValueTranslate(virKeycodeSet from_codeset,
                                   virKeycodeSet to_offset,
                                   int key_value);
      
      * include/libvirt/libvirt.h.in: extend virKeycodeSet enum
      * src/Makefile.am: add new virtkeycode module and rule to generate
        virkeymaps.h
      * src/util/virkeycode.c src/util/virkeycode.h: new module
      * src/util/virkeycode-mapgen.py: python generator for virkeymaps.h
        out of keymaps.csv
      * src/libvirt_private.syms: extend private symbols for new module
      * .gitignore: add generated virkeymaps.h
      0bbf87e9
    • L
      util: Add keymaps.csv · 1151f0ee
      Lai Jiangshan 提交于
      Should keep it as the same as:
      http://git.gnome.org/browse/gtk-vnc/commit/src/keymaps.csv
      
      All master  keymaps are defined in a CSV file. THis covers
      Linux keycodes, OSX keycodes, AT set1, 2 & 3, XT keycodes,
      the XT encoding used by the Linux KBD driver, USB keycodes,
      Win32 keycodes, the XT encoding used by Xorg on Cygwin,
      the XT encoding used by Xorg on Linux with kbd driver.
      
      * src/Makefile.am: added to EXTRA_DIST
      * src/util/keymaps.csv: new file
      1151f0ee
    • E
      maint: fix typos on guaranteed · a7143405
      Eric Blake 提交于
      * src/conf/domain_event.c (virDomainEventDispatch): Fix typo.
      * src/internal.h (ATTRIBUTE_FMT_PRINTF): Likewise.
      * src/libvirt.c (virStreamEventUpdateCallback): Likewise.
      * src/remote/remote_driver.c (doRemoteOpen): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      * src/util/virterror.c (virConnCopyLastError, virCopyLastError):
      Likewise.
      * src/xen/xend_internal.h (xend_wait_for_devices): Likewise.
      a7143405
    • C
      rpc: Pass through DISPLAY so ssh can launch askpass · e0a21dfe
      Cole Robinson 提交于
      Though we prefer users to have SSH keys setup, virt-manager users still
      depend on remote SSH connections to launch a password dialog. This fixes
      launch ssh-askpass
      
      Fix suggested by danpb
      e0a21dfe
  3. 20 7月, 2011 12 次提交