1. 28 8月, 2012 3 次提交
    • M
      qemu: Fix define logic · 9eee40cc
      Michal Privoznik 提交于
      With current flow in qemudDomainDefine we might lose data
      when updating an existing domain. We parse given XML and
      overwrite the configuration.  Then we try to save the new
      config. However, this step may fail and we don't perform any
      roll back.  In fact, we remove the domain from the list of
      domains held up by qemu driver. This is okay as long as the
      domain was brand new one.
      9eee40cc
    • M
      qemu_agent: Switch to virReportSystemError() on system error · 3e0cc630
      Michal Privoznik 提交于
      Currently, if a syscall in qemu_agent.c fails we report an internal
      error even though we should be reporting a system error.
      3e0cc630
    • M
      Introduce new VIR_ERR_AGENT_UNRESPONSIVE error code · aa3e8bd4
      Michal Privoznik 提交于
      Currently, when guest agent is configured but not responsive
      (e.g. due to appropriate service not running in the guest)
      we return VIR_ERR_INTERNAL_ERROR. Both are wrong. Therefore
      we need to introduce new error code to reflect this case.
      aa3e8bd4
  2. 27 8月, 2012 3 次提交
    • M
      qemu: Switch to unified func name · 661d7fb4
      Michal Privoznik 提交于
      With the latest patches libvirt supports qemu agent monitor
      passthrough. However, function in qemu driver is called
      qemuDrvDomainAgentCommand. s/Drv// as used in all other names.
      661d7fb4
    • M
      qemu: fix regression with spice tls port allocation · 340196c4
      Martin Kletzander 提交于
      In my quest for reusing variables I failed to edit one variable when
      fixing details between two patch versions. That results in a failure
      to start qemu with autoport and spice tls, because qemu is trying to
      bind two sockets to the same port.
      340196c4
    • M
      qemu: fix regression with pinning · 16ebec2b
      Martin Kletzander 提交于
      Commit 4b03d591 changed the pinning
      behavior in a way that makes some machines non-startable.
      
      The comment mentioning that we cannot control each vcpu when there is
      not VCPU<-> PID mapping available is true, however, this isn't
      necessarily an error, because this can be caused by old QEMU without
      support for "query-cpus" command as well as a software emulated
      machines that don't create more than one process.
      16ebec2b
  3. 24 8月, 2012 4 次提交
    • E
      snapshot: rename an enum · 1385c9cd
      Eric Blake 提交于
      The name 'virDomainDiskSnapshot' didn't fit in with our normal
      conventions of using a prefix hinting that it is related to a
      virDomainSnapshotPtr.  Also, a future patch will reuse the
      enum for declaring where the VM memory is stored.
      
      * src/conf/snapshot_conf.h (virDomainDiskSnapshot): Rename...
      (virDomainSnapshotLocation): ...to this.
      (_virDomainSnapshotDiskDef): Update clients.
      * src/conf/domain_conf.h (_virDomainDiskDef): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Likewise.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Likewise.
      * src/conf/snapshot_conf.c: (virDomainSnapshotDiskDefParseXML)
      (virDomainSnapshotAlignDisks, virDomainSnapshotDefFormat):
      Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotDiskPrepare)
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotCreateDiskActive, qemuDomainSnapshotCreateXML):
      Likewise.
      1385c9cd
    • E
      snapshot: split snapshot conf code into own file · 6478ec16
      Eric Blake 提交于
      This has several benefits:
      1. Future snapshot-related code has a definite place to go (and I
      _will_ be adding some)
      2. Snapshot errors now use the VIR_FROM_DOMAIN_SNAPSHOT error
      classification, which has been underutilized (previously only in
      libvirt.c)
      
      * src/conf/domain_conf.h, domain_conf.c: Split...
      * src/conf/snapshot_conf.h, snapshot_conf.c: ...into new files.
      * src/Makefile.am (DOMAIN_CONF_SOURCES): Build new files.
      * po/POTFILES.in: Mark new file for translation.
      * src/vbox/vbox_tmpl.c: Update caller.
      * src/esx/esx_driver.c: Likewise.
      * src/qemu/qemu_command.c: Likewise.
      * src/qemu/qemu_domain.h: Likewise.
      6478ec16
    • E
      snapshot: make virDomainSnapshotObjList opaque · 3211deba
      Eric Blake 提交于
      We were failing to react to allocation failure when initializing
      a snapshot object list.  Changing things to store a pointer
      instead of a complete object adds one more possible point of
      allocation failure, but at the same time, will make it easier to
      react to failure now, as well as making it easier for a future
      patch to split all virDomainSnapshotPtr handling into a separate
      file, as I continue to add even more snapshot code.
      
      Luckily, there was only one client outside of domain_conf.c that
      was actually peeking inside the object, and a new wrapper function
      was easy.
      
      * src/conf/domain_conf.h (_virDomainObj): Use a pointer.
      (virDomainSnapshotObjListInit): Rename.
      (virDomainSnapshotObjListFree, virDomainSnapshotForEach): New
      declarations.
      (_virDomainSnapshotObjList): Move definitions...
      * src/conf/domain_conf.c: ...here.
      (virDomainSnapshotObjListInit, virDomainSnapshotObjListDeinit):
      Rename...
      (virDomainSnapshotObjListNew, virDomainSnapshotObjListFree): ...to
      these.
      (virDomainSnapshotForEach): New function.
      (virDomainObjDispose, virDomainListPopulate): Adjust callers.
      * src/qemu/qemu_domain.c (qemuDomainSnapshotDiscard)
      (qemuDomainSnapshotDiscardAllMetadata): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad)
      (qemuDomainUndefineFlags, qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
      (qemuDomainListAllSnapshots)
      (qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren)
      (qemuDomainSnapshotListAllChildren)
      (qemuDomainSnapshotLookupByName, qemuDomainSnapshotGetParent)
      (qemuDomainSnapshotGetXMLDesc, qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata, qemuDomainRevertToSnapshot)
      (qemuDomainSnapshotDelete): Likewise.
      * src/libvirt_private.syms (domain_conf.h): Export new function.
      3211deba
    • E
      qemu-agent: available in 0.10.0 · 352cbae8
      Eric Blake 提交于
      The recent virDomainQemuAgentCommand addition is part of 0.10.0;
      also, grouping all libvirt-qemu.so callbacks together makes them
      easier to identify.
      
      * src/libvirt_qemu.syms: Fix release symbol.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/driver.h (_virDriver): Group qemu-specific callbacks.
      352cbae8
  4. 23 8月, 2012 4 次提交
  5. 22 8月, 2012 10 次提交
  6. 21 8月, 2012 7 次提交
    • M
      qemu: modify 3 error messages · 0c0a8c9f
      Martin Kletzander 提交于
      After the cleanup of remote display port allocation, I noticed some
      messages that didn't make a lot of sense the way they were written. So
      I rephrased them.
      0c0a8c9f
    • M
      qemu: configurable remote display port boundaries · 29226bee
      Martin Kletzander 提交于
      The defines QEMU_REMOTE_PORT_MIN and QEMU_REMOTE_PORT_MAX were used to
      find free port when starting domains. As this was hard-coded to the
      same ports as default VNC servers, there were races with these other
      programs. This patch includes the possibility to change the default
      starting port as well as the maximum port (mostly for completeness) in
      qemu config file.
      
      Support for two new config options in qemu.conf is added:
       - remote_port_min (defaults to QEMU_REMOTE_PORT_MIN and
         must be >= than this value)
       - remote_port_max (defaults to QEMU_REMOTE_PORT_MAX and
         must be <= than this value)
      29226bee
    • M
      qemu: Unify port-wise SPICE and VNC behavior · a14b4aea
      Martin Kletzander 提交于
      Port allocations for SPICE and VNC behave almost the same (with
      default ports), but there is some mess in the code. This patch clears
      these inconsistencies and makes sure the same behavior will be used
      when ports for remote displays are changed.
      
      Changes:
       - hard-coded number 5900 removed (handled elsewhere like with VNC)
       - reservedVNCPorts renamed to reservedRemotePorts (it's not just for
         VNC anymore)
       - QEMU_VNC_PORT_{MIN,MAX} renamed to QEMU_REMOTE_PORT_{MIN,MAX}
       - port allocation unified for VNC and SPICE
      a14b4aea
    • M
      Update the remote API · 2f8a09fb
      Marcelo Cerri 提交于
      This patch updates libvirt's API to allow applications to inspect the
      full list of security labels of a domain.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      2f8a09fb
    • M
      Support for multiple default security drivers in QEMU config · 6d6bff3a
      Marcelo Cerri 提交于
      This patch updates the key "security_driver" in QEMU config to suport
      both a sigle default driver or a list of default drivers. This ensures
      that it will remain compatible with older versions of the config file.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      6d6bff3a
    • M
      Update security layer to handle many security labels · a994ef2d
      Marcelo Cerri 提交于
      These changes make the security drivers able to find and handle the
      correct security label information when more than one label is
      available. They also update the DAC driver to be used as an usual
      security driver.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      a994ef2d
    • M
      Internal refactory of data structures · 6c3cf57d
      Marcelo Cerri 提交于
      This patch updates the structures that store information about each
      domain and each hypervisor to support multiple security labels and
      drivers. It also updates all the remaining code to use the new fields.
      Signed-off-by: NMarcelo Cerri <mhcerri@linux.vnet.ibm.com>
      6c3cf57d
  7. 18 8月, 2012 2 次提交
    • S
      qemu: support netdevs from <forward mode='hostdev'> networks · 1610b71a
      Shradha Shah 提交于
      For network devices allocated from a network with <forward
      mode='hostdev'>, there is a need to add the newly minted hostdev to
      the hostdevs array.
      
      In this case we also need to call qemuPrepareHostDevices just for this
      one device, as the standard call to initialize all the hostdevs that
      were defined directly in the domain's configuration has already been
      made by the time we allocate a device from a libvirt network, and thus
      have something that needs initializing.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      1610b71a
    • S
      conf: move DevicePCIAddress functions to separate file · f9150c81
      Shradha Shah 提交于
      Move the functions the parse/format, and validate PCI addresses to
      their own file so they can be conveniently used in other places
      besides device_conf.c
      
      Refactoring existing code without causing any functional changes to
      prepare for new code.
      
      This patch makes the code reusable.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      f9150c81
  8. 17 8月, 2012 2 次提交
    • K
      network: add support for setting VLANs on Open vSwitch ports · 7d2b91b8
      Kyle Mestery 提交于
      Add the ability to support VLAN tags for Open vSwitch virtual port
      types. To accomplish this, modify virNetDevOpenvswitchAddPort and
      virNetDevTapCreateInBridgePort to take a virNetDevVlanPtr
      argument. When adding the port to the OVS bridge, setup either a
      single VLAN or a trunk port based on the configuration from the
      virNetDevVlanPtr.
      Signed-off-by: NKyle Mestery <kmestery@cisco.com>
      7d2b91b8
    • O
      qemu: Set swap_hard_limit before hard_limit · 75e5bec9
      Osier Yang 提交于
      Setting hard_limit larger than previous swap_hard_limit must fail,
      it's not that good if one wants to change the swap_hard_limit
      and hard_limit together. E.g.
      
      % virsh memtune rhel6
      hard_limit     : 1000000
      soft_limit     : 1000000
      swap_hard_limit: 1000000
      
      % virsh memtune rhel6 --hard-limit 1000020 --soft-limit 1000020 \
      --swap-hard-limit 1000020 --live
      
      This patch reorder the limits setting to set the swap_hard_limit
      first, hard_limit then, and soft_limit last if it's greater than
      current swap_hard_limit. And soft_limit first, hard_limit then,
      swap_hard_limit last, if not.
      75e5bec9
  9. 16 8月, 2012 2 次提交
    • L
      qemu: support setting vlan tag for <interface type='hostdev'> · 3fdd85bf
      Laine Stump 提交于
      The underlying function to set the vlan tag of an SR-IOV network
      device was already in place (although an extra patch to save/restore
      the original vlan tag was needed), and recent patches added the
      ability to configure a vlan tag. This patch just ties those two
      together.
      
      An SR-IOV device doesn't support vlan trunking, so if anyone tries to
      configure more than a single tag, or set the trunk flag, and error is
      logged.
      3fdd85bf
    • O
      qemu: Ensure the cpuset is formatted as expected before passing to cgroup · 29d8ed7a
      Osier Yang 提交于
      The parameter value for cpuset could be in special format like
      "0-10,^7", which is not recognized by cgroup. This patch is to
      ensure the cpuset is formatted as expected before passing it to
      cgroup. As a side effect, after the patch, it parses the cpuset
      early before cgroup setting, to avoid the rollback if cpuset
      parsing fails afterwards.
      29d8ed7a
  10. 15 8月, 2012 3 次提交
    • D
      Allow control over JSON string pretty printing · ecf00158
      Daniel P. Berrange 提交于
      While the QEMU monitor/agent do not want JSON strings pretty
      printed, other parts of libvirt might. Instead of hardcoding
      QEMU's desired behaviour in virJSONValueToString(), add a
      boolean flag to control pretty printing
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ecf00158
    • D
      Remove unused qemuProcessAutoDestroyRun decl from header · 5f2f8d41
      Daniel P. Berrange 提交于
      The qemuProcessAutoDestroyRun function was removed in an earlier
      commit, but the header file declaration was not deleted
      5f2f8d41
    • L
      conf: move virtPortProfile out of unions in virDomainNetDef · 1d174428
      Laine Stump 提交于
      virtPortProfile is now used by 4 different types of network devices
      (NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to
      replicate so much code in 4 different places just because each type
      has the virtPortProfile in a slightly different place. This patch puts
      a single virtPortProfile in a common place (outside the type-specific
      union) in both virDomainNetDef and virDomainActualNetDef, and adjusts
      the parse and format code (and the few other places where it is used)
      accordingly.
      
      Note that when a <virtualport> element is found, the parse functions
      verify that the interface is of a type that supports one, otherwise an
      error is generated (CONFIG_UNSUPPORTED in the case of <interface>, and
      INTERNAL in the case of <actual>, since the contents of <actual> are
      always generated by libvirt itself).
      1d174428