1. 07 8月, 2012 4 次提交
  2. 06 8月, 2012 3 次提交
  3. 03 8月, 2012 1 次提交
    • O
      qemu: Allow to attach/detach controller device persistently · ed1e711b
      Osier Yang 提交于
      * src/conf/domain_conf.c:
        - Add virDomainControllerFind to find controller device by type
          and index.
        - Add virDomainControllerRemove to remove the controller device
          from maintained controler list.
      
      * src/conf/domain_conf.h:
        - Declare the two new helpers.
      
      * src/libvirt_private.syms:
        - Expose private symbols for the two new helpers.
      
      * src/qemu/qemu_driver.c:
        - Support attach/detach controller device persistently
      
      * src/qemu/qemu_hotplug.c:
        - Use the two helpers to simplify the codes.
      ed1e711b
  4. 02 8月, 2012 3 次提交
    • M
      qemu: Fix typo in qemuDomainModifyDeviceFlags · e94c0a09
      Michal Privoznik 提交于
      One of our latest commits fbe87126 introduced this nasty typo:
      func(vmdef, ...); where func() dereference vmdef->ncontrollers,
      and vmdef was initialized to NULL. This leaves us with unconditional
      immediate segfault. It should be vm->def instead.
      e94c0a09
    • P
      qemu: Add support for "none" USB controller · fbe87126
      Peter Krempa 提交于
      This patch enables the "none" USB controller for qemu guests and adds
      valdiation on hot-plugged devices if the guest has USB disabled.
      
      This patch also adds a set of tests to check parsing of domain XMLs that
      use the "none" controller and some forbidden situations concerning it.
      fbe87126
    • P
      domain_conf: Add USB controler model "none" · 09251897
      Peter Krempa 提交于
      Libvirt adds a USB controller to the guest even if the user does not
      specify any in the XML. This is due to back-compat reasons.
      
      To allow disabling USB for a guest this patch adds a new USB controller
      type "none" that disables USB support for the guest.
      09251897
  5. 01 8月, 2012 1 次提交
  6. 31 7月, 2012 1 次提交
    • E
      qemu: fix use after free · 665c8cde
      Eric Blake 提交于
      Detected by Coverity.
      
      * src/qemu/qemu_hotplug.c (qemuDomainAttachHostDevice): Avoid
      double free of usb on failure.
      665c8cde
  7. 27 7月, 2012 1 次提交
    • E
      maint: don't permit format strings without % · 768007ae
      Eric Blake 提交于
      Any time we have a string with no % passed through gettext, a
      translator can inject a % to cause a stack overread.  When there
      is nothing to format, it's easier to ask for a string that cannot
      be used as a formatter, by using a trivial "%s" format instead.
      
      In the past, we have used --disable-nls to catch some of the
      offenders, but that doesn't get run very often, and many more
      uses have crept in.  Syntax check to the rescue!
      
      The syntax check can catch uses such as
      virReportError(code,
                     _("split "
                       "string"));
      by using a sed script to fold context lines into one pattern
      space before checking for a string without %.
      
      This patch is just mechanical insertion of %s; there are probably
      several messages touched by this patch where we would be better
      off giving the user more information than a fixed string.
      
      * cfg.mk (sc_prohibit_diagnostic_without_format): New rule.
      * src/datatypes.c (virUnrefConnect, virGetDomain)
      (virUnrefDomain, virGetNetwork, virUnrefNetwork, virGetInterface)
      (virUnrefInterface, virGetStoragePool, virUnrefStoragePool)
      (virGetStorageVol, virUnrefStorageVol, virGetNodeDevice)
      (virGetSecret, virUnrefSecret, virGetNWFilter, virUnrefNWFilter)
      (virGetDomainSnapshot, virUnrefDomainSnapshot): Add %s wrapper.
      * src/lxc/lxc_driver.c (lxcDomainSetBlkioParameters)
      (lxcDomainGetBlkioParameters): Likewise.
      * src/conf/domain_conf.c (virSecurityDeviceLabelDefParseXML)
      (virDomainDiskDefParseXML, virDomainGraphicsDefParseXML):
      Likewise.
      * src/conf/network_conf.c (virNetworkDNSHostsDefParseXML)
      (virNetworkDefParseXML): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterIsValidChainName):
      Likewise.
      * src/conf/nwfilter_params.c (virNWFilterVarValueCreateSimple)
      (virNWFilterVarAccessParse): Likewise.
      * src/libvirt.c (virDomainSave, virDomainSaveFlags)
      (virDomainRestore, virDomainRestoreFlags)
      (virDomainSaveImageGetXMLDesc, virDomainSaveImageDefineXML)
      (virDomainCoreDump, virDomainGetXMLDesc)
      (virDomainMigrateVersion1, virDomainMigrateVersion2)
      (virDomainMigrateVersion3, virDomainMigrate, virDomainMigrate2)
      (virStreamSendAll, virStreamRecvAll)
      (virDomainSnapshotGetXMLDesc): Likewise.
      * src/nwfilter/nwfilter_dhcpsnoop.c (virNWFilterSnoopReqLeaseDel)
      (virNWFilterDHCPSnoopReq): Likewise.
      * src/openvz/openvz_driver.c (openvzUpdateDevice): Likewise.
      * src/openvz/openvz_util.c (openvzKBPerPages): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupCgroup): Likewise.
      * src/qemu/qemu_command.c (qemuBuildHubDevStr, qemuBuildChrChardevStr)
      (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetPercpuStats): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/rpc/virnetsaslcontext.c (virNetSASLSessionGetIdentity):
      Likewise.
      * src/rpc/virnetsocket.c (virNetSocketNewConnectUNIX)
      (virNetSocketSendFD, virNetSocketRecvFD): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskBuildPool): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemProbe)
      (virStorageBackendFileSystemBuild): Likewise.
      * src/storage/storage_backend_rbd.c
      (virStorageBackendRBDOpenRADOSConn): Likewise.
      * src/storage/storage_driver.c (storageVolumeResize): Likewise.
      * src/test/test_driver.c (testInterfaceChangeBegin)
      (testInterfaceChangeCommit, testInterfaceChangeRollback):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxListAllDomains): Likewise.
      * src/xenxs/xen_sxpr.c (xenFormatSxprDisk, xenFormatSxpr):
      Likewise.
      * src/xenxs/xen_xm.c (xenXMConfigGetUUID, xenFormatXMDisk)
      (xenFormatXM): Likewise.
      768007ae
  8. 23 7月, 2012 2 次提交
    • P
      maint: Clean up coding style and fix error message spelling · 8e0f7faf
      Peter Krempa 提交于
      This patch cleans up coding style breaks some long lines and fixes error
      message spelling on various places in domain_conf.c and in the qemu
      driver.
      8e0f7faf
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  9. 21 7月, 2012 1 次提交
    • D
      Only enforce check for YAJL when starting a VM · 33998759
      Daniel P. Berrange 提交于
      The previous check for YAJL would have many undesirable
      consequences, the most important being that it caused the
      capabilities XML to lose all <guest> elements. There is
      no user visible feedback as to what is wrong in this respect,
      merely a syslog message. The empty capabilities causes
      libvirtd to then throw away all guest XML configs that are
      stored.
      
      This changes the code so that the check for YAJL is only
      performed at the time we attempt to spawn a QEMU process
      
      error: Failed to start domain vm-vnc
      error: unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      33998759
  10. 19 7月, 2012 4 次提交
    • D
      Replace use of qemuReportError with virReportError · 3b7399b5
      Daniel P. Berrange 提交于
      Update the QEMU driver to use virReportError instead of
      the qemuReportError custom macro
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3b7399b5
    • P
      qemu: Add missing "%s" before translation macros · 4e532f2e
      Peter Krempa 提交于
      This patch cleans up some missing "%s" before translation macros,
      for strings which are const without format specifiers
      4e532f2e
    • D
      Don't autostart domains when reloading config · 95c2c19f
      Daniel P. Berrange 提交于
      When sending SIGHUP to libvirtd, it will trigger the virStateDriver
      reload operation. This is intended to reload the configuration files
      for guests. For unknown historical reasons this is also triggering
      autostart of all guests. Autostart is generally expected to be
      something that happens on OS startup. Starting VMs on SIGHUP will
      violate that expectation and potentially cause dangerous scenarios
      if the admin has explicitly shutdown a misbehaving VM that has
      been marked as autostart
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      95c2c19f
    • 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 10 7月, 2012 1 次提交
  16. 05 7月, 2012 1 次提交
  17. 04 7月, 2012 1 次提交
  18. 03 7月, 2012 2 次提交
  19. 02 7月, 2012 1 次提交
  20. 28 6月, 2012 1 次提交
  21. 25 6月, 2012 3 次提交
  22. 21 6月, 2012 1 次提交