1. 20 11月, 2014 7 次提交
  2. 19 11月, 2014 5 次提交
    • E
      maint: forbid 'int foo = true' · eb909376
      Eric Blake 提交于
      I noticed this while working on qemuDomainGetBlockInfo.  Assigning
      a bool value to an int variable compiles fine, but raises red flags
      on the maintenance front as it becomes too easy to assign -1 or 2
      or any other non-bool value to the same variable.
      
      * cfg.mk (sc_prohibit_int_assign_bool): New rule.
      * src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix
      offenders.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
      (qemuDomainSnapshotCreateXML): Likewise.
      * src/test/test_driver.c (testDomainSnapshotAlignDisks):
      Likewise.
      * src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise.
      * src/util/virpci.c (virPCIDeviceBindToStub): Likewise.
      * src/util/virutil.c (virIsCapableVport): Likewise.
      * tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise.
      * tools/virsh-domain.c (cmdBlockResize, cmdScreenshot)
      (cmdInjectNMI, cmdSendKey, cmdSendProcessSignal)
      (cmdDetachInterface): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      eb909376
    • E
      virdbus: don't force users to pass int for bool values · 2aa167ca
      Eric Blake 提交于
      Use of an 'int' to represent a 'bool' value is confusing.  Just
      because dbus made the mistake of cementing their 4-byte wire
      format of dbus_bool_t into their API doesn't mean we have to
      repeat the mistake.  With a little bit of finesse, we can
      guarantee that we provide a large-enough value to the DBus
      code, while still copying only the relevant one-byte bool
      to the client code, and isolate the rest of our code base from
      the DBus stupidity.
      
      * src/util/virdbus.c (GET_NEXT_VAL): Add parameter.
      (virDBusMessageIterDecode): Adjust all clients.
      * src/util/virpolkit.c (virPolkitCheckAuth): Use nicer type.
      * tests/virdbustest.c (testMessageSimple, testMessageStruct):
      Test new behavior.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2aa167ca
    • C
      bac66a60
    • Y
      vbox: fix a bug in _machineStateInactive · 9b7e7e34
      Yohan BELLEGUIC 提交于
      This function returned non-inactive domains instead of active
      domains.  This broke virConnectNumOfDefinedDomains() and
      virConnectListDefinedDomains() functions.
      9b7e7e34
    • A
      network: Add network bandwidth support to ethernet interfaces · 22cff52a
      Anirban Chakraborty 提交于
      Ethernet interfaces in libvirt currently do not support bandwidth setting.
      For example, following xml file for an interface will not apply these
      settings to corresponding qdiscs.
      
          <interface type="ethernet">
            <mac address="02:36:1d:18:2a:e4"/>
            <model type="virtio"/>
            <script path=""/>
            <target dev="tap361d182a-e4"/>
            <bandwidth>
              <inbound average="984" peak="1024" burst="64"/>
              <outbound average="2000" peak="2048" burst="128"/>
            </bandwidth>
          </interface>
      Signed-off-by: NAnirban Chakraborty <abchak@juniper.net>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      22cff52a
  3. 15 11月, 2014 18 次提交
  4. 14 11月, 2014 3 次提交
    • D
      Re-add use of locking with iptables/ip6tables/ebtables · dc33e6e4
      Daniel P. Berrange 提交于
      A previous commit introduced use of locking with invocation
      of iptables in the viriptables.c module
      
        commit ba95426d
        Author: Serge Hallyn <serge.hallyn@ubuntu.com>
        Date:   Fri Nov 1 12:36:59 2013 -0500
      
          util: use -w flag when calling iptables
      
      This only ever had effect with the virtual network driver,
      as it was not wired up into the nwfilter driver. Unfortunately
      in the firewall refactoring the use of the -w flag was
      accidentally lost.
      
      This patch introduces it to the virfirewall.c module so that
      both the virtual network and nwfilter drivers will be using
      it. It also ensures that the equivalent --concurrent flag
      to ebtables is used.
      dc33e6e4
    • J
      qemu: Don't try to parse -help for new QEMU · ae3e29e6
      Jiri Denemark 提交于
      Since QEMU 1.2.0, we switched to QMP probing instead of parsing -help
      (and other commands, such as -cpu ?) output. However, if QMP probing
      failed, we still tried starting QEMU with various options and parsing
      the output, which was guaranteed to fail because the output changed.
      Let's just refuse parsing -help for QEMU >= 1.2.0.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1160318Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      ae3e29e6
    • J
      qemu: Always set migration capabilities · ab393383
      Jiri Denemark 提交于
      We used to set migration capabilities only when a user asked for them in
      flags. This is fine when migration succeeds since the QEMU process is
      killed in the end but in case migration fails or if it's cancelled, some
      capabilities may remain turned on with no way to turn them off. To fix
      that, migration capabilities have to be turned on if requested but
      explicitly turned off in case they were not requested but QEMU supports
      them.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1163953Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      ab393383
  5. 13 11月, 2014 5 次提交
  6. 12 11月, 2014 2 次提交
    • J
      storage: Introduce 'managed' for the fchost parent · 5530f248
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Introduce a 'managed' attribute to allow libvirt to decide whether to
      delete a vHBA vport created via external means such as nodedev-create.
      The code currently decides whether to delete the vHBA based solely on
      whether the parent was provided at creation time. However, that may not
      be the desired action, so rather than delete and force someone to create
      another vHBA via an additional nodedev-create allow the configuration of
      the storage pool to decide the desired action.
      
      During createVport when libvirt does the VPORT_CREATE, set the managed
      value to YES if not already set to indicate to the deleteVport code that
      it should delete the vHBA when the pool is destroyed.
      
      If libvirtd is restarted all the memory only state was lost, so for a
      persistent storage pool, use the virStoragePoolSaveConfig in order to
      write out the managed value.
      
      Because we're now saving the current configuration, we need to be sure
      to not save the parent in the output XML if it was undefined at start.
      Saving the name would cause future starts to always use the same parent
      which is not the expected result when not providing a parent. By not
      providing a parent, libvirt is expected to find the best available
      vHBA port for each subsequent (re)start.
      
      At deleteVport, use the new managed value to decide whether to execute
      the VPORT_DELETE.  Since we no longer save the parent in memory or in
      XML when provided, if it was not provided, then we have to look it up.
      5530f248
    • J
      storage: Introduce virStoragePoolSaveConfig · 523c6908
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Introduce the ability to save a configuration of a persistent configuration
      that may be changed by storage pool backend activity, such as start or stop
      523c6908