1. 01 2月, 2012 11 次提交
    • M
      qemu: Don't jump to endjob if no job was even started · bb311b34
      Michal Privoznik 提交于
      In qemuDomainShutdownFlags if we try to use guest agent,
      which has error or is not configured, we jump go endjob
      label even if we haven't started any job yet. This may
      lead to the daemon crash:
      1) virsh shutdown --mode agent on a domain without agent configured
      2) wait until domain quits
      3) virsh edit
      bb311b34
    • T
      qemu: fix my typo at commit 74e03496 · 53e23e99
      Taku Izumi 提交于
      Fix my typo at
        commit 74e03496
      
      "disk->rawio == -1" indicates that this value is not
      specified. So in case of this, domain must not
      be tainted.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      53e23e99
    • A
      simplify block of codes · bfdbae06
      Alex Jia 提交于
      Using new function 'virTypedParameterArrayClear' to simplify block of codes.
      
      * daemon/remote.c, src/remote/remote_driver.c: simplify codes.
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      bfdbae06
    • E
      build: fix text regression · c3c2cc65
      Eric Blake 提交于
      Commit 8a09ee41 tickles a bug in libxml2-2.7.6 on RHEL 6.2,
      where libxml2 treats the pattern [^\n] as excluding literal
      backslash and n, instead of the intended newline, thus failing
      to validate any domain name containing 'n'.
      
      * docs/schemas/domaincommon.rng: Use literal newline instead.
      c3c2cc65
    • L
      docs: fill out rawio description · b303465d
      Laine Stump 提交于
      The original doc entry for rawio didn't mention the values it could
      have, the default, or the fact that setting it to "yes" for one disk
      effectively set it to "yes" for all disks in the domain.
      b303465d
    • T
      qemu: make qemu processes to retain rawio capability · 74e03496
      Taku Izumi 提交于
      This patch revises qemuProcessStart() function for qemu
      processes to retain CAP_SYS_RAWIO if needed.
      And in case of that, add taint flag to domain.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      Signed-off-by: NShota Hirae <m11g1401@hibikino.ne.jp>
      74e03496
    • T
      util: extend virExecWithHook() · c2e146bf
      Taku Izumi 提交于
      This patch extends virExecWithHook() to receive
      capability information.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      Signed-off-by: NShota Hirae <m11g1401@hibikino.ne.jp>
      c2e146bf
    • T
      util: add functions to keep capabilities · 53bd0ceb
      Taku Izumi 提交于
      This patch introduces virSetCapabilities() function and implements
      virCommandAllowCap() function.
      
      Existing virClearCapabilities() is function to clear all capabilities.
      Instead virSetCapabilities() is function to set arbitrary capabilities.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      Signed-off-by: NShota Hirae <m11g1401@hibikino.ne.jp>
      53bd0ceb
    • T
      conf: add rawio attribute to disk element of domain XML · 397e6a70
      Taku Izumi 提交于
       This patch adds a new attribute "rawio" to the "disk" element
       of domain XML. Valid values of "rawio" attribute are "yes"
       and "no".
       rawio='yes' indicates the disk is desirous of CAP_SYS_RAWIO.
      
       If you specify the following XML:
      
       <disk type='block' device='lun' rawio='yes'>
        ...
       </disk>
      
       the domain will be granted CAP_SYS_RAWIO.
       (of course, the domain have to be executed with root privilege)
      
      NOTE:
         - "rawio" attribute is only valid when device='lun'
         - At the moment, any other disks you won't use rawio can use rawio.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      397e6a70
    • Z
      Implement virStorageVolResize() for FS backend · e545dd4f
      Zeeshan Ali (Khattak) 提交于
      Currently only VIR_STORAGE_VOL_RESIZE_DELTA flag is supported.
      e545dd4f
    • E
      resize: slightly alter signature · 055bbf45
      Eric Blake 提交于
      Our existing virDomainBlockResize takes an unsigned long long
      argument; if that command is later taught a DELTA and SHRINK flag,
      we cannot change its type without breaking API (but at least such
      a change would be ABI compatible).  Meanwhile, the only time a
      negative size makes sense is if both DELTA and SHRINK are used
      together, but if we keep the argument unsigned, applications can
      pass the positive delta amount by which they would like to shrink
      the system, and have the flags imply the negative value.  So,
      since this API has not yet been released, and in the interest of
      consistency with existing API, we swap virStorageVolResize to
      always pass an unsigned value.
      
      * include/libvirt/libvirt.h.in (virStorageVolResize): Use unsigned
      argument.
      * src/libvirt.c (virStorageVolResize): Likewise.
      * src/driver.h (virDrvStorageVolUpload): Adjust clients.
      * src/remote/remote_protocol.x (remote_storage_vol_resize_args):
      Likewise.
      * src/remote_protocol-structs: Regenerate.
      Suggested by Daniel P. Berrange.
      055bbf45
  2. 31 1月, 2012 6 次提交
    • P
      XenXs: Update documentation · 098a987b
      Philipp Hahn 提交于
      Fix several references to now renamed functions and parameters when the
      functions were moved from src/xen/ to src/xenxs/.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      098a987b
    • L
      qemu: add "romfile" support to specify device boot ROM · 3801831c
      Laine Stump 提交于
      This patch addresses: https://bugzilla.redhat.com/show_bug.cgi?id=781562
      
      Along with the "rombar" option that controls whether or not a boot rom
      is made visible to the guest, qemu also has a "romfile" option that
      allows specifying a binary file to present as the ROM BIOS of any
      emulated or passthrough PCI device. This patch adds support for
      specifying romfile to both passthrough PCI devices, and emulated
      network devices that attach to the guest's PCI bus (just about
      everything other than ne2k_isa).
      
      One example of the usefulness of this option is described in the
      bugzilla report: 82576 sriov network adapters don't provide a ROM BIOS
      for the cards virtual functions (VF), but an image of such a ROM is
      available, and with this ROM visible to the guest, it can PXE boot.
      
      In libvirt's xml, the new option is configured like this:
      
         <hostdev>
           ...
           <rom file='/etc/fake/boot.bin'/>
           ...
         </hostdev
      
      (similarly for <interface>).
      3801831c
    • L
      qemu: (and conf) support rombar for network devices · 3284ac04
      Laine Stump 提交于
      When support for the rombar option was added, it was only added for
      PCI passthrough devices, configured with <hostdev>. The same option is
      available for any network device that is attached to the guest's PCI
      bus. This patch allows setting rombar for any PCI network device type.
      
      After adding cases to test this to qemuxml2argv-hostdev-pci-rombar.*,
      I decided to rename those files (to qemuxml2argv-pci-rom.*) to more
      accurately reflect the additional tests, and also noticed that up to
      now we've only been performing a domainschematest for that case, so I
      added the "pci-rom" test to both qemuxml2argv and qemuxml2xml (and in
      the process found some bugs whose fixes I squashed into previous
      commits of this series).
      3284ac04
    • L
      conf: relocate rombar and boot order parse/format · c01ba1a4
      Laine Stump 提交于
      Since these two items are now in the virDomainDeviceInfo struct, it
      makes sense to parse/format them in the functions written to
      parse/format that structure. Not all types of devices allow them, so
      two internal flags are added to indicate when it is appropriate to do
      so.
      
      I was lucky - only one test case needed to be re-ordered!
      c01ba1a4
    • L
      conf: put all guest-related HostdevDef data in one object · 159f4d0b
      Laine Stump 提交于
      To help consolidate the commonality between virDomainHostdevDef and
      virDomainNetDef into as few members as possible (and because I
      think it makes sense), this patch moves the rombar and bootIndex
      members into the "info" member that is common to both (and to all the
      other structs that use them).
      
      It's a bit problematic that this gives rombar and bootIndex to many
      device types that don't use them, but this is already the case for the
      master and mastertype members of virDomainDeviceInfo, and is properly
      commented as such in the definition.
      
      Note that this opens the door to supporting rombar for other devices
      that are attached to the guest PCI bus - virtio-blk-pci,
      virtio-net-pci, various other network adapters - which which have that
      capability in qemu, but previously had no support in libvirt.
      159f4d0b
    • L
      conf: remove duplicate call to VIR_FREE(info->alias) · aaa6210f
      Laine Stump 提交于
      There is another identical call 4 lines up in the same function.
      aaa6210f
  3. 30 1月, 2012 3 次提交
  4. 29 1月, 2012 1 次提交
  5. 28 1月, 2012 17 次提交
    • E
      docs: reorder public header · 5c6651fe
      Eric Blake 提交于
      The bottom of the public header is reserved for deprecated APIs;
      it's nicer to arrange things in logical groups.
      
      * include/libvirt/libvirt.h.in (virConnectSetKeepAlive)
      (virDomainGetCPUStats): Float earlier in the file.
      5c6651fe
    • E
      docs: tweak recent suspend API additions · f0b22ebe
      Eric Blake 提交于
      * src/libvirt.c (virDomainPMSuspendForDuration): Clarify usage.
      f0b22ebe
    • K
      Add new public API virDomainGetCPUStats() · e1eea747
      KAMEZAWA Hiroyuki 提交于
      add new API virDomainGetCPUStats() for getting cpu accounting information
      per real cpus which is used by a domain.  The API is designed to allow
      future extensions for additional statistics.
      
      based on ideas by Lai Jiangshan and Eric Blake.
      
      * src/libvirt_public.syms: add API for LIBVIRT_0.9.10
      * src/libvirt.c: define virDomainGetCPUStats()
      * include/libvirt/libvirt.h.in: add virDomainGetCPUStats() header
      * src/driver.h: add driver API
      * python/generator.py: add python API (as not implemented)
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e1eea747
    • M
      virsh: Expose new virDomainPMSuspendForDuration API · 7c741763
      Michal Privoznik 提交于
      under new command "dompmsuspend"
      7c741763
    • M
      Introduce virDomainPMSuspendForDuration API · 8f8b0802
      Michal Privoznik 提交于
      This API allows a domain to be put into one of S# ACPI states.
      Currently, S3 and S4 are supported. These states are shared
      with virNodeSuspendForDuration.
      However, for now we don't support any duration other than zero.
      The same apply for flags.
      8f8b0802
    • Z
      resize: implement remote protocol for virStorageVolResize() · 83581780
      Zeeshan Ali (Khattak) 提交于
      Autogeneration saves the day.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      83581780
    • Z
      resize: add virStorageVolResize() API · 6714fd04
      Zeeshan Ali (Khattak) 提交于
      Add a new function to allow changing of capacity of storage volumes.
      Plan out several flags, even if not all of them will be implemented
      up front.
      
      Expose the new command via 'virsh vol-resize'.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6714fd04
    • E
      tests: fix reversed comparisons · b2e13f9c
      Eric Blake 提交于
      Otherwise, a failed test gives misleading output.
      
      * tests/commandtest.c (test13, test14, test16): Pass arguments in
      correct order.
      b2e13f9c
    • C
      Return more error output if policykit auth fails. · 855d900b
      Cole Robinson 提交于
      Several not uncommon issues can be diagnosed through pkcheck output, like
      lack of/malfunctioning desktop agent, or lack of/malfunctioning polkit
      dbus agent.
      855d900b
    • C
      Add new error code VIR_ERROR_AUTH_CANCELLED · bb2eddc6
      Cole Robinson 提交于
      And hook it up for policykit auth. This allows virt-manager to detect
      that the user clicked the policykit 'cancel' button and not throw
      an 'authentication failed' error message at the user.
      bb2eddc6
    • E
      qemu: avoid double free of qemu help output · ab6f1c98
      Eric Blake 提交于
      If yajl was not compiled in, we end up freeing an incoming
      parameter, which leads to a bogus free later on.  Regression
      introduced in commit 6e769eba.
      
      * src/qemu/qemu_capabilities.c (qemuCapsParseHelpStr): Avoid alloc
      on failure path, which in turn fixes bogus free.
      Reported by Cole Robinson.
      ab6f1c98
    • E
      build: fix missing include · 93f93f51
      Eric Blake 提交于
      Fix a build failure:
      
      virt-host-validate.c: In function 'main':
      virt-host-validate.c:82:5: error: implicit declaration of function 'setlocale' [-Werror=implicit-function-declaration]
      virt-host-validate.c:82:5: error: nested extern declaration of 'setlocale' [-Werror=nested-externs]
      virt-host-validate.c:82:20: error: 'LC_ALL' undeclared (first use in this function)
      
      * tools/virt-host-validate.c: Add <locale.h>.
      * .gitignore: Ignore built executable.
      93f93f51
    • E
      xml: fix struct typos · 83ed0301
      Eric Blake 提交于
      Noticed this while reviewing Dan's patches.
      
      * src/util/xml.c (virXMLRewritFileData): Rename to
      virXMLRewriteFileData.
      83ed0301
    • D
      Move virEmitXMLWarning into xml.h · 9b516aa3
      Daniel P. Berrange 提交于
      The virEmitXMLWarning function should always have been in
      the xml.[hc] files, and should use virXML as its name
      prefix
      
      * src/util/util.c, src/util/util.h: Remove virEmitXMLWarning
      * src/util/xml.c, src/util/xml.h: Add virXMLEmitWarning
      9b516aa3
    • D
      Move virMacAddrXXX functions to src/util/virmacaddr.[ch] · 510fa47c
      Daniel P. Berrange 提交于
      Move the virMacAddrXXX functions out of util.[ch] and into a
      new dedicate file virmacaddr.[ch]
      510fa47c
    • D
      Rename virXXXXMacAddr to virMacAddrXXX · 4ce98dad
      Daniel P. Berrange 提交于
      Rename virFormatMacAddr, virGenerateMacAddr and virParseMacAddr
      to virMacAddrFormat, virMacAddrGenerate and virMacAddrParse
      respectively
      4ce98dad
    • D
      Add a virt-host-validate command to sanity check HV config · 54a38915
      Daniel P. Berrange 提交于
      To assist people in verifying that their host is operating in an
      optimal manner, provide a 'virt-host-validate' command. For each
      type of hypervisor, it will check any pre-requisites, or other
      good recommendations and report what's working & what is not.
      
      eg
      
        # virt-host-validate
        QEMU: Checking for device /dev/kvm                                         : FAIL (Check that the 'kvm-intel' or 'kvm-amd' modules are loaded & the BIOS has enabled virtualization)
        QEMU: Checking for device /dev/vhost                                       : WARN (Load the 'vhost_net' module to improve performance of virtio networking)
        QEMU: Checking for device /dev/net/tun                                     : PASS
         LXC: Checking for Linux >= 2.6.26                                         : PASS
      
      This warns people if they have vmx/svm, but don't have /dev/kvm. It
      also warns about missing /dev/vhost net.
      54a38915
  6. 27 1月, 2012 2 次提交
    • P
      qemu: parse and create -cpu ...,-kvmclock · b66d1bef
      Paolo Bonzini 提交于
      QEMU supports a bunch of CPUID features that are tied to the kvm CPUID
      nodes rather than the processor's.  They are "kvmclock",
      "kvm_nopiodelay", "kvm_mmu", "kvm_asyncpf".  These are not known to
      libvirt and their CPUID leaf might move if (for example) the Hyper-V
      extensions are enabled. Hence their handling would anyway require some
      special-casing.
      
      However, among these the most useful is kvmclock; an additional
      "property" of this feature is that a <timer> element is a better model
      than a CPUID feature.  Although, creating part of the -cpu command-line
      from something other than the <cpu> XML element introduces some
      ugliness.
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b66d1bef
    • P
      conf: add kvmclock timer · 5a137f36
      Paolo Bonzini 提交于
      Add kvmclock timer to documentation, schema and parsers.  Keep the
      platform timer first since it is kind of special, and alphabetize
      the others when possible (i.e. when it does not change the ABI).
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5a137f36