1. 19 7月, 2012 1 次提交
    • E
      po: avoid spurious double spaces in messages · 99f1faf7
      Eric Blake 提交于
      Noticed during the recent error cleanups.
      
      * src/network/bridge_driver.c (networkStartRadvd): Fix spacing.
      * src/openvz/openvz_conf.c (openvzReadMemConf): Likewise.
      * src/qemu/qemu_command.c (qemuNetworkIfaceConnect): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainDetachNetDevice): Likewise.
      * src/qemu/qemu_process.c (qemuProcessStop): Likewise.
      * src/security/virt-aa-helper.c (vah_add_file): Likewise.
      99f1faf7
  2. 17 7月, 2012 1 次提交
    • S
      Convert 'raw MAC address' usages to use virMacAddr · 387117ad
      Stefan Berger 提交于
      Introduce new members in the virMacAddr 'class'
      - virMacAddrSet: set virMacAddr from a virMacAddr
      - virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
      - virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
      - virMacAddrCmp: comparing two virMacAddr
      - virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
      
      then replace raw MAC addresses by replacing
      
      - 'unsigned char *' with virMacAddrPtr
      - 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
      
      and introduce usage of above functions where necessary.
      387117ad
  3. 16 7月, 2012 2 次提交
    • J
      qemu: Do not fail virConnectCompareCPU if host CPU is not known · 87c86231
      Jiri Denemark 提交于
      When host CPU could not be properly detected, virConnectCompareCPU will
      just report that any CPU is incompatible with host CPU instead of
      failing.
      87c86231
    • J
      qemu: Fix probing for guest capabilities · 8e6fb68f
      Jiri Denemark 提交于
      Even though qemu-kvm binaries can be used in TCG mode, libvirt would
      only detect them if /dev/kvm was available. Thus, one would need to make
      a /usr/bin/qemu symlink to be able to use TCG mode with qemu-kvm in an
      environment without KVM support.
      
      And even though QEMU is able to make use of KVM, libvirt would not
      advertise KVM support unless there was a qemu-kvm symlink available.
      
      This patch fixes both issues.
      8e6fb68f
  4. 14 7月, 2012 1 次提交
    • D
      Wire up handling for QMP's BALLOON_EVENT · 1d9d5103
      Daniel P. Berrange 提交于
      If QEMU supports the BALLOON_EVENT QMP event, then we can
      avoid invoking 'query-balloon' when returning XML or the
      domain info.
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h:
        Add QEMU_CAPS_BALLOON_EVENT
      * src/qemu/qemu_driver.c: Skip query-balloon in
        qemudDomainGetInfo and qemuDomainGetXMLDesc if we have
        QEMU_CAPS_BALLOON_EVENT set
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Check
        for BALLOON_EVENT at connect to monitor. Add callback
        for balloon change notifications
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h:
        Add handling of BALLOON_EVENT and impl 'query-events'
        check
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1d9d5103
  5. 11 7月, 2012 4 次提交
    • V
      S390: Add support for virtio-s390 devices. · d0304eaa
      Viktor Mihajlovski 提交于
      The s390(x) architecture doesn't feature a PCI bus. For the purpose of
      supporting virtio devices a virtual bus called virtio-s390 is used.
      A new address type VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390 is used to
      distinguish the virtio devices on s390 from PCI-based virtio devices.
      
      V3 Change: updated QEMU_CAPS_VIRTIO_S390 to fit upstream.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      d0304eaa
    • V
      qemu: Extended qemuDomainAssignAddresses to be callable from everywhere. · f5dd58a6
      Viktor Mihajlovski 提交于
      This is in preparation of the enablement of s390 guests with virtio devices.
      
      The assignment of device addresses happens in different places, i.e. the
      qemu driver and process modules as well as in the unit tests in slightly
      different flavors. Currently, these are PPC spapr-vio and PCI
      devices, virtio-s390 (not PCI based) will follow.
      
      By optionally passing to qemuDomainAssignAddresses the domain
      object and the capabilities it is now possible to call the function
      from most of the places (except for hotplug) where address assignment
      is done.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      f5dd58a6
    • C
      Fix /domain/features setting in qemuParseCommandLine · 626dd518
      Christophe Fergeau 提交于
      Commit 5e6ce1 moved down detection of the ACPI feature in
      qemuParseCommandLine. However, when ACPI is detected, it clears
      all feature flags in def->features to only set ACPI. This used to
      be fine because this was the first place were def->features was set,
      but after the move this is no longer necessarily true because this
      block comes before the ACPI check:
      
      if (strstr(def->emulator, "kvm")) {
          def->virtType = VIR_DOMAIN_VIRT_KVM;
          def->features |= (1 << VIR_DOMAIN_FEATURE_PAE);
      }
      
      Since def is allocated in qemuParseCommandLine using VIR_ALLOC, we
      can always use |= when modifying def->features
      626dd518
    • E
      build: detect all improper uses of _("%s") · 0867a877
      Eric Blake 提交于
      The only useful translation of "%s" as a format string is "%s" (I
      suppose you could claim "%1$s" is also valid, but why bother).  So
      it is not worth translating; fixing this exposes some instances
      where we were failing to translate real error messages.  This makes
      the fix of commit 097da1ab more generic, as well as ensuring no
      future regressions.
      
      * cfg.mk (sc_prohibit_useless_translation): New rule.
      * src/lxc/lxc_driver.c (lxcSetVcpuBWLive): Fix offender.
      * src/openvz/openvz_conf.c (openvzReadFSConf): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupCgroupForVcpu): Likewise.
      * src/qemu/qemu_driver.c (qemuSetVcpusBWLive): Likewise.
      * src/xenapi/xenapi_utils.c (xenapiSessionErrorHandle): Likewise.
      0867a877
  6. 10 7月, 2012 1 次提交
  7. 05 7月, 2012 1 次提交
  8. 04 7月, 2012 1 次提交
  9. 03 7月, 2012 2 次提交
  10. 02 7月, 2012 1 次提交
  11. 28 6月, 2012 1 次提交
  12. 25 6月, 2012 3 次提交
  13. 21 6月, 2012 1 次提交
  14. 20 6月, 2012 3 次提交
    • P
      drivers: Implement virListAllDomains for drivers using virDomainObj · 33dc8cf0
      Peter Krempa 提交于
      This patch adds support for listing all domains into drivers that use
      the common virDomainObj implementation: libxl, lxc, openvz, qemu, test,
      uml, vmware.
      
      For drivers that don't support managed save images the guests are
      treated as if they had none, so filtering guests that do have such an
      image on this driver succeeds and produces 0 results.
      33dc8cf0
    • D
      Fix default USB controller for ppc64 · d1778b71
      Dipankar Sarma 提交于
      Fix the default usb controller for pseries systems if none
      specified.
      Signed-off-by: NDipankar Sarma <dipankar@in.ibm.com>
      d1778b71
    • E
      list: add qemu snapshot list support · 5488612e
      Eric Blake 提交于
      The two new functions are very similar to the existing functions;
      just a matter of different arguments and a call to a different
      helper function.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotListNames)
      (qemuDomainSnapshotNum, qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren): Support new flags.
      (qemuDomainListAllSnapshots): New functions.
      5488612e
  15. 19 6月, 2012 3 次提交
    • E
      snapshot: merge domain and snapshot computation · 7e111c6f
      Eric Blake 提交于
      Now that domain listing is a thin wrapper around child listing,
      it's easier to have a common entry point.  This restores the
      hashForEach optimization lost in the previous patch when there
      are no snapshots being filtered out of the entire list.
      
      * src/conf/domain_conf.h (virDomainSnapshotObjListGetNames)
      (virDomainSnapshotObjListNum): Add parameter.
      (virDomainSnapshotObjListGetNamesFrom)
      (virDomainSnapshotObjListNumFrom): Delete.
      * src/libvirt_private.syms (domain_conf.h): Drop deleted functions.
      * src/conf/domain_conf.c (virDomainSnapshotObjListGetNames):
      Merge, and (re)add an optimization.
      * src/qemu/qemu_driver.c (qemuDomainUndefineFlags)
      (qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
      (qemuDomainSnapshotListChildrenNames)
      (qemuDomainSnapshotNumChildren): Update callers.
      * src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
      * src/conf/virdomainlist.c (virDomainListPopulate): Likewise.
      7e111c6f
    • E
      snapshot: use metaroot node to simplify management · 06d4a1e4
      Eric Blake 提交于
      This idea was first suggested by Daniel Veillard here:
      https://www.redhat.com/archives/libvir-list/2011-October/msg00353.html
      
      Now that I am about to add more complexity to snapshot listing, it
      makes sense to avoid code duplication and special casing for domain
      listing (all snapshots) vs. snapshot listing (descendants); adding
      a metaroot reduces the number of code lines by having the domain
      listing turn into a descendant listing of the metaroot.
      
      Note that this has one minor pessimization - if we are going to list
      ALL snapshots without filtering, then virHashForeach is more efficient
      than recursing through the child relationships; restoring that minor
      optimization will occur in the next patch.
      
      * src/conf/domain_conf.h (_virDomainSnapshotObj)
      (_virDomainSnapshotObjList): Repurpose some fields.
      (virDomainSnapshotDropParent): Drop unused parameter.
      * src/conf/domain_conf.c (virDomainSnapshotObjListGetNames)
      (virDomainSnapshotObjListCount): Simplify.
      (virDomainSnapshotFindByName, virDomainSnapshotSetRelations)
      (virDomainSnapshotDropParent): Match new field semantics.
      * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
      (qemuDomainSnapshotReparentChildren, qemuDomainSnapshotDelete):
      Adjust clients.
      06d4a1e4
    • P
      conf: Store managed save image existence in virDomainObj · bc8e1559
      Peter Krempa 提交于
      This patch stores existence of the image in the object. At start of the
      daemon the state is checked and then updated in key moments in domain
      lifecycle.
      bc8e1559
  16. 16 6月, 2012 3 次提交
    • M
      qemu_agent: Wait for events instead of agent response · d97a234c
      Michal Privoznik 提交于
      With latest changes to qemu-ga success on some commands is not reported
      anymore, e.g. guest-shutdown or guest-suspend-*. However, errors are
      still being reported. Therefore, we need to find different source of
      indication if operation was successful. Events.
      d97a234c
    • M
      qemu_agent: Add some more debug prints · c12d787e
      Michal Privoznik 提交于
      for agent ref count and qemuProcessHandleAgentDestroy
      c12d787e
    • E
      build: hoist qemu dependence on yajl to configure · 350583c8
      Eric Blake 提交于
      Commit 6e769eba made it a runtime error if libvirt was compiled
      without yajl support but targets a new enough qemu.  But enough
      users are hitting this on self-compiled libvirt that it is worth
      erroring out at compilation time, rather than an obscure failure
      when trying to use the built executable.
      
      * configure.ac: If qemu is requested and -version works, require
      yajl when qemu version is new enough.
      * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Add
      comment.
      350583c8
  17. 15 6月, 2012 3 次提交
  18. 14 6月, 2012 3 次提交
    • P
      qemu: Enable disconnecting SPICE clients without changing password · e0f0131d
      Peter Krempa 提交于
      Libvirt updates the configuration of SPICE server only when something
      changes. This is unfortunate when the user wants to disconnect a
      existing spice session when the connected attribute is already
      "disconnect".
      
      This patch modifies the conditions for calling the password updater to
      be called when nothing changes, but the connected attribute is already
      "disconnect".
      e0f0131d
    • P
      qemu: Fix off-by-one error while unescaping monitor strings · 0f4660c8
      Peter Krempa 提交于
      While unescaping the commands the commands passed through to the monitor
      function qemuMonitorUnescapeArg() initialized lenght of the input string
      to strlen()+1 which is fine for alloc but not for iteration of the
      string.
      
      This patch fixes the off-by-one error and drops the pointless check for
      a single trailing slash that is automaticaly handled by the default
      branch of switch.
      0f4660c8
    • D
      Add some missing hook functions · 6510c97b
      Daniel P. Berrange 提交于
      A core use case of the hook scripts is to be able to do things
      to a guest's network configuration. It is possible to hook into
      the 'start' operation for a QEMU guest which runs just before
      the guest is started. The TAP devices will exist at this point,
      but the QEMU process will not. It can be desirable to have a
      'started' hook too, which runs once QEMU has started.
      
      If libvirtd is restarted it will re-populate firewall rules,
      but there is no QEMU hook to trigger for existing domains.
      This is solved with a 'reconnect' hook.
      
      Finally, if attaching to an external QEMU process there needs
      to be an 'attach' hook script.
      
      This all also applies to the LXC driver
      
      * docs/hooks.html.in: Document new operations
      * src/util/hooks.c, src/util/hooks.c: Add 'started', 'reconnect'
        and 'attach' operations for QEMU. Add 'prepare', 'started',
        'release' and 'reconnect' operations for LXC
      * src/lxc/lxc_driver.c: Add hooks for 'prepare', 'started',
        'release' and 'reconnect' operations
      * src/qemu/qemu_process.c: Add hooks for 'started', 'reconnect'
        and 'reconnect' operations
      6510c97b
  19. 12 6月, 2012 3 次提交
    • M
      qemu: Don't overwrite security labels · 86032b22
      Michal Privoznik 提交于
      Currently, if qemuProcessStart fail at some point, e.g. because
      domain being started wants a PCI/USB device already assigned to
      a different domain, we jump to cleanup label where qemuProcessStop
      is performed. This unconditionally calls virSecurityManagerRestoreAllLabel
      which is wrong because the other domain is still using those devices.
      
      However, once we successfully label all devices/paths in
      qemuProcessStart() from that point on, we have to perform a rollback
      on failure - that is - we have to virSecurityManagerRestoreAllLabel.
      86032b22
    • M
      qemuProcessStop: Switch to flags · 69dd7714
      Michal Privoznik 提交于
      Currently, we are passing only one boolean (migrated) so there is
      no real profit in this. But it creates starting position for
      next patch.
      69dd7714
    • E
      snapshot: implement new APIs for qemu · e3559a6e
      Eric Blake 提交于
      The two APIs are rather trivial; based on bits and pieces of other
      existing APIs.  It leaves the door open for future extension to
      qemu to report snapshots without metadata based on reading qcow2
      internal snapshot names.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata): New functions.
      e3559a6e
  20. 09 6月, 2012 1 次提交
  21. 08 6月, 2012 1 次提交
    • L
      Assign correct address type to spapr-vlan and spapr-vty. · 04a319ba
      Li Zhang 提交于
      For pseries guest, spapr-vlan and spapr-vty is based
      on spapr-vio address. According to model of network
      device, the address type should be assigned automatically.
      For serial device, serial pty device is recognized as
      spapr-vty device, which is also on spapr-vio.
      
      So this patch is to correct the address type of
      spapr-vlan and spapr-vty, and build correct
      command line of spapr-vty.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Reviewed-by:   Michael Ellerman<michaele@au1.ibm.com>
      04a319ba