1. 01 2月, 2012 9 次提交
    • 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
    • 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 2 次提交
  4. 29 1月, 2012 1 次提交
  5. 28 1月, 2012 11 次提交
  6. 27 1月, 2012 11 次提交
    • 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
    • P
      qemu: do not create useless <cpu> element · df8e6918
      Paolo Bonzini 提交于
      Avoid creating an empty <cpu> element when the QEMU command-line simply
      specifies the default "-cpu qemu32" or "-cpu qemu64".
      
      This requires the previous patch, which lets us represent "-cpu qemu32"
      as <os arch='i686'> in the generated XML.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      df8e6918
    • P
      qemu: get arch name from <cpu> element · d5e88b2c
      Paolo Bonzini 提交于
      The qemu32 CPU model is chosen based on the <os arch=...> name when
      creating the QEMU command line for a 64-bit host.  For the opposite
      transformation we can test the guest CPU model for the "lm" feature.
      If it is absent, def->os.arch needs to be corrected.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d5e88b2c
    • P
      qemu: detect arch correctly for KVM · 4be541a6
      Paolo Bonzini 提交于
      When running under KVM, the arch is usually set to i686 because
      the name of the emulator is not qemu-system-x86_64.  Use the host
      arch instead.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4be541a6
    • P
      x86: add kvm32 and kvm64, update qemu64 · ef00a05e
      Paolo Bonzini 提交于
      Recently (or not so recently) QEMU added the kvm32 and kvm64
      architectures, representing a least common denominator of all
      hosts that can run KVM.  Add them to the machine map.
      
      Also, some features that TCG supports were added to qemu64.
      Add them to the cpu_map.xml whenever KVM is guaranteed to support
      those.  We still have to leave some out, because they would not
      be available to guests running on older hosts.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ef00a05e
    • P
      qemu: parse -enable-kvm · 4a00c099
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4a00c099
    • E
      qemu: require qmp on new enough qemu · 6e769eba
      Eric Blake 提交于
      The qemu developers have made it clear that modern qemu will no
      longer guarantee human monitor command stability; furthermore,
      some features, such as async events, are only supported via qmp.
      If we are compiled without support for handling JSON, we cannot
      expect to sanely interact with modern qemu.
      
      However, things must continue to build on RHEL 5, where qemu
      is stuck at 0.10, and where yajl is not available.
      
      Another benefit of this patch: future additions of new monitor
      commands need only focus on qemu_monitor_json.c, instead of
      also wasting time with qemu_monitor_text.c.
      
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Report
      error if yajl is missing but qemu requires qmp.
      (qemuCapsParseHelpStr): Propagate error.
      (qemuCapsExtractVersionInfo): Update caller.
      * tests/qemuhelptest.c (testHelpStrParsing): Likewise.
      6e769eba
    • E
      qemu: support qmp on RHEL/CentOS qemu · ff88cd59
      Eric Blake 提交于
      I'm getting tired of remembering to backport RHEL-specific
      patches when building upstream libvirt on RHEL 6.x or CentOS.
      All the affected versions of RHEL qemu-kvm have backported
      enough patches to a) make JSON useful, and b) modify the
      -help text to mention libvirt as the preferred interface;
      which means this string in the help output is a reliable
      indicator that we can outsmart a strict version check,
      even when upstream qemu 0.12 lacked the needed features.
      
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags):
      Recognize particular help string present when enough features were
      backported to be worth using JSON.
      * tests/qemuhelptest.c (mymain): Update tests accordingly.
      ff88cd59
    • S
      nwfilter: Rebuild filters only if new filter is different than current · 823b9033
      Stefan Berger 提交于
      Compare two filters' XML for equality and only rebuild/instantiate the new
      filter if the new and current filters are found to be different. This
      improves performance during an update of a filter with no obvious change
      or the reloading of filters during a 'kill -SIGHUP'
      823b9033
    • S
      nwfilter: Force instantiation of filters upon driver reload · 8fa78dd4
      Stefan Berger 提交于
      Introduce a function that rebuilds all running VMs' filters. Call
      this function when reloading the nwfilter driver.
      
      This addresses a problem introduced by the 2nd patch that typically
      causes no filters to be reinstantiate anymore upon driver reload
      since their XML has not changed. Yet the current behavior is that
      upon a SIGHUP all filters get reinstantiated.
      8fa78dd4