1. 23 3月, 2015 12 次提交
    • P
      conf: Add device address type for dimm devices · 62b825a2
      Peter Krempa 提交于
      Dimm devices are described by the slot and base address. Add a new
      address type to be able to describe such address.
      62b825a2
    • P
      qemu: Implement setup of memory hotplug parameters · a41185d8
      Peter Krempa 提交于
      To enable memory hotplug the maximum memory size and slot count need to
      be specified. As qemu supports now other units than mebibytes when
      specifying memory, use the new interface in this case.
      a41185d8
    • P
      conf: Add support for parsing and formatting max memory and slot count · bffb9163
      Peter Krempa 提交于
      Add a XML element that will allow to specify maximum supportable memory
      and the count of memory slots to use with memory hotplug.
      
      To avoid possible confusion and misuse of the new element this patch
      also explicitly forbids the use of the maxMemory setting in individual
      drivers's post parse callbacks. This limitation will be lifted when the
      support is implemented.
      bffb9163
    • P
      libxl: Refactor logic in domain post parse callback · 19e85d84
      Peter Krempa 提交于
      With the current control flow the post parse callback returned success
      right away for fully virtualized VMs. To allow adding additional checks
      into the post parse callback tweak the conditions so that the function
      doesn't return early except for error cases.
      
      To clarify the original piece of code borrow the wording from the commit
      message for the patch that introduced the code.
      19e85d84
    • P
      qemu: monitor: Don't leak @props with non-JSON in qemuMonitorAddObject · b15f5883
      Peter Krempa 提交于
      The function comment states that @props is always consumed, even on
      failure. This was not true with the failure if the monitor is not using
      QMP.
      b15f5883
    • P
      qemu: Don't return memory device config on error in qemuBuildMemoryBackendStr · 104011ea
      Peter Krempa 提交于
      In the last section if the function determines that the config is
      invalid when QEMU doesn't support the memory device the JSON config
      object would be returned even if it doesn't make sense.
      
      Assign the object to be returned only on success.
      104011ea
    • B
      qemu: Set default SCSI controller model for S390 arch · c35b2776
      Boris Fiuczynski 提交于
      When no model is specified in the domain definition for
      a scsi controller and the architectur is s390 than virtio-scsi
      is set as default model.
      Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NDaniel Hansel <daniel.hansel@linux.vnet.ibm.com>
      Reviewed-by: NStefan Zimmermann <stzi@linux.vnet.ibm.com>
      Reviewed-by: NJens Freimann <jfrei@linux.vnet.ibm.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      c35b2776
    • N
      Fix underlinking of libvirt_driver_interface.so · 6392a610
      Natanael Copa 提交于
      Always add udev linker flags when WITH_UDEV is enabled to avoid
      underlinking.
      
      See commit 43dbcb15 (interface: always build all available backends)
      Signed-off-by: NNatanael Copa <ncopa@alpinelinux.org>
      6392a610
    • M
      qemu: skip precreation of network disks · a1b18051
      Michael Chapman 提交于
      Commit cf54c606 introduced the ability
      to create missing storage volumes during migration. For network disks,
      however, we may not necessarily be able to detect whether they already
      exist -- there is no straight-forward way to map the disk to a storage
      volume, and even if there were it's possible no configured storage pool
      actually contains the disk.
      
      It is better to assume the network disk exists in this case, rather than
      aborting the migration completely. If the volume really is missing, QEMU
      will generate an appropriate error later in the migration.
      Signed-off-by: NMichael Chapman <mike@very.puzzling.org>
      a1b18051
    • M
      network_conf: Drop virNetworkObjIsDuplicate · d9706aea
      Michal Privoznik 提交于
      This function does not make any sense now, that network driver is
      (almost) dropped. I mean, previously, when threads were
      serialized, this function was there to check, if no other network
      with the same name or UUID exists. However, nowadays that threads
      can run more in parallel, this function is useless, in fact it
      gives misleading return values. Consider the following scenario.
      Two threads, both trying to define networks with same name but
      different UUID (e.g. because it was generated during XML parsing
      phase, whatever). Lets assume that both threads are about to call
      networkValidate() which immediately calls
      virNetworkObjIsDuplicate().
      
      T1: calls virNetworkObjIsDuplicate() and since no network with
      given name or UUID exist, success is returned.
      T2: calls virNetworkObjIsDuplicate() and since no network with
      given name or UUID exist, success is returned.
      
      T1: calls virNetworkAssignDef() and successfully places its
      network into the virNetworkObjList.
      T2: calls virNetworkAssignDef() and since network with the same
      name exists, the network definition is replaced.
      
      Okay, this is mainly because virNetworkAssignDef() does not check
      whether name and UUID matches. Well, lets make it so! And drop
      useless function too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d9706aea
    • M
      networkStateInitialize: Don't lock network driver · dd7bfb2c
      Michal Privoznik 提交于
      There's no need to lock the network driver, as network driver
      initialization is done prior accepting any client. There's nobody
      to hop in and do something over partially initialized driver. Nor
      qemu driver is doing that.
      
      ==30532== Observed (incorrect) order is: acquisition of lock at 0x1439EF50
      ==30532==    at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0x5324895: virMutexLock (virthread.c:88)
      ==30532==    by 0x5307E86: virObjectLock (virobject.c:323)
      ==30532==    by 0x5396440: virNetworkObjListForEach (network_conf.c:4511)
      ==30532==    by 0x19B29308: networkStateInitialize (bridge_driver.c:686)
      ==30532==    by 0x53E1CCC: virStateInitialize (libvirt.c:777)
      ==30532==    by 0x11DEB7: daemonRunStateInit (libvirtd.c:906)
      ==30532==    by 0x5324B6A: virThreadHelper (virthread.c:197)
      ==30532==    by 0x4C30456: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0xA1EC1F2: start_thread (in /lib64/libpthread-2.19.so)
      ==30532==    by 0xA4EDC8C: clone (in /lib64/libc-2.19.so)
      ==30532==
      ==30532==  followed by a later acquisition of lock at 0x1439CD60
      ==30532==    at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0x5324895: virMutexLock (virthread.c:88)
      ==30532==    by 0x19B27B2C: networkDriverLock (bridge_driver.c:102)
      ==30532==    by 0x19B27B60: networkGetDnsmasqCaps (bridge_driver.c:113)
      ==30532==    by 0x19B2856A: networkUpdateState (bridge_driver.c:389)
      ==30532==    by 0x53963E9: virNetworkObjListForEachHelper (network_conf.c:4488)
      ==30532==    by 0x52E2224: virHashForEach (virhash.c:521)
      ==30532==    by 0x539645B: virNetworkObjListForEach (network_conf.c:4512)
      ==30532==    by 0x19B29308: networkStateInitialize (bridge_driver.c:686)
      ==30532==    by 0x53E1CCC: virStateInitialize (libvirt.c:777)
      ==30532==    by 0x11DEB7: daemonRunStateInit (libvirtd.c:906)
      ==30532==    by 0x5324B6A: virThreadHelper (virthread.c:197)
      ==30532==
      ==30532== Required order was established by acquisition of lock at 0x1439CD60
      ==30532==    at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0x5324895: virMutexLock (virthread.c:88)
      ==30532==    by 0x19B27B2C: networkDriverLock (bridge_driver.c:102)
      ==30532==    by 0x19B28DF9: networkStateInitialize (bridge_driver.c:609)
      ==30532==    by 0x53E1CCC: virStateInitialize (libvirt.c:777)
      ==30532==    by 0x11DEB7: daemonRunStateInit (libvirtd.c:906)
      ==30532==    by 0x5324B6A: virThreadHelper (virthread.c:197)
      ==30532==    by 0x4C30456: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0xA1EC1F2: start_thread (in /lib64/libpthread-2.19.so)
      ==30532==    by 0xA4EDC8C: clone (in /lib64/libc-2.19.so)
      ==30532==
      ==30532==  followed by a later acquisition of lock at 0x1439EF50
      ==30532==    at 0x4C31A26: pthread_mutex_lock (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0x5324895: virMutexLock (virthread.c:88)
      ==30532==    by 0x5307E86: virObjectLock (virobject.c:323)
      ==30532==    by 0x538A09C: virNetworkAssignDef (network_conf.c:527)
      ==30532==    by 0x5391EB2: virNetworkLoadState (network_conf.c:3008)
      ==30532==    by 0x53922D4: virNetworkLoadAllState (network_conf.c:3128)
      ==30532==    by 0x19B2929A: networkStateInitialize (bridge_driver.c:671)
      ==30532==    by 0x53E1CCC: virStateInitialize (libvirt.c:777)
      ==30532==    by 0x11DEB7: daemonRunStateInit (libvirtd.c:906)
      ==30532==    by 0x5324B6A: virThreadHelper (virthread.c:197)
      ==30532==    by 0x4C30456: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
      ==30532==    by 0xA1EC1F2: start_thread (in /lib64/libpthread-2.19.so)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      dd7bfb2c
    • M
      Fix common misspellings · 0e7457e5
      Martin Kletzander 提交于
      Wikipedia's list of common misspellings [1] has a machine-readable
      version.  This patch fixes those misspellings mentioned in the list
      which don't have multiple right variants (as e.g. "accension", which can
      be both "accession" and "ascension"), such misspellings are left
      untouched.  The list of changes was manually re-checked for false
      positives.
      
      [1] https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machinesSigned-off-by: NMartin Kletzander <mkletzan@redhat.com>
      0e7457e5
  2. 20 3月, 2015 3 次提交
  3. 19 3月, 2015 15 次提交
  4. 18 3月, 2015 10 次提交
    • J
      network: Resolve Coverity FORWARD_NULL · 0e3c68ac
      John Ferlan 提交于
      The following is a long winded way to say this patch is avoiding a
      false positive.
      
      Coverity complains that calling networkPlugBandwidth() could eventually
      end up with a NULL dereference on iface->bandwidth because in the
      networkAllocateActualDevice there's a check of 'iface->bandwidth'
      before deciding to try to use the 'portgroup' if it exists or to not
      perferm the virNetDevBandwidthCopy if 'bandwidth' is not NULL.
      
      Later in networkPlugBandwidth the 'iface->bandwidth' is sourced from
      virDomainNetGetActualBandwidth - which would be either iface->bandwidth
      or (preferably) iface->data.network.actual->bandwidth which would have
      been filled in from either 'iface->bandwidth' or 'portgroup->bandwidth'
      back in networkAllocateActualDevice
      
      There *is* a check in networkCheckBandwidth for the result of the
      virDomainNetGetActualBandwidth being NULL and a return 1 based on
      that which would cause networkPlugBandwidth to exit properly and thus
      never hit the condition that Coverity complains about.
      
      However, since Coverity checks all paths - it somehow believes that
      a return of 0 by networkCheckBandwidth in this condition would end
      up causing the possible NULL dereference. The "fix" to silence Coverity
      is to not have networkCheckBandwidth also call virDomainNetGetActualBandwidth
      in order to get the ifaceBand, but rather have it accept it as an argument
      which causes Coverity to "see" that it's the exit condition of 1 that won't
      have the possible NULL dereference.  Since we're passing that, I added the
      passing of iface->mac rather than passing iface as well. This just hopefully
      makes sure someone doesn't undo this in the future...
      0e3c68ac
    • J
      Use PAUSED state for domains that are starting up · 18441ab9
      Jiri Denemark 提交于
      When libvirt is starting a domain, it reports the state as SHUTOFF until
      it's RUNNING. This is not ideal because domain startup may take a long
      time (usually because of some configuration issues, firewalls blocking
      access to network disks, etc.) and domain lists provided by libvirt look
      awkward. One can see weird shutoff domains with IDs in a list of active
      domains or even shutoff transient domains. In any case, it looks more
      like a bug in libvirt than a normal state a domain goes through.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      18441ab9
    • J
      tests: Add tests for virCgroupDetectMounts · 2dbfa716
      Jiri Denemark 提交于
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      2dbfa716
    • M
      qemuGetDHCPInterfaces: Don't leak @network · 3353c7c4
      Michal Privoznik 提交于
      The function needs a pointer to the network to get list of DHCP
      leases. The pointer is obtained via virNetworkLookupByName() which
      requires callers to free the returned network once no longer needed.
      Otherwise it's leaked.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3353c7c4
    • M
      qemuAgentGetInterfaces: Don't error out on missing HW address · 100fb08c
      Michal Privoznik 提交于
      Now that we allow HW address to be not present on our RPC layer,
      don't error out if qemu-ga hasn't provided any.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      100fb08c
    • M
      RPC: Allow HW address in remote_domain_interface struct to be NULL · 3640245d
      Michal Privoznik 提交于
      Not all NICs (esp. the virtual ones like TUN) must have a hardware
      address. Teach our RPC that it's possible.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3640245d
    • E
      qemu: read backing chain names from qemu · f9ea3d60
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1199182 documents that
      after a series of disk snapshots into existing destination images,
      followed by active commits of the top image, it is possible for
      qemu 2.2 and earlier to end up tracking a different name for the
      image than what it would have had when opening the chain afresh.
      That is, when starting with the chain 'a <- b <- c', the name
      associated with 'b' is how it was spelled in the metadata of 'c',
      but when starting with 'a', taking two snapshots into 'a <- b <- c',
      then committing 'c' back into 'b', the name associated with 'b' is
      now the name used when taking the first snapshot.
      
      Sadly, older qemu doesn't know how to treat different spellings of
      the same filename as identical files (it uses strcmp() instead of
      checking for the same inode), which means libvirt's attempt to
      commit an image using solely the names learned from qcow2 metadata
      fails with a cryptic:
      
      error: internal error: unable to execute QEMU command 'block-commit': Top image file /tmp/images/c/../b/b not found
      
      even though the file exists.  Trying to teach libvirt the rules on
      which name qemu will expect is not worth the effort (besides, we'd
      have to remember it across libvirtd restarts, and track whether a
      file was opened via metadata or via snapshot creation for a given
      qemu process); it is easier to just always directly ask qemu what
      string it expects to see in the first place.
      
      As a safety valve, we validate that any name returned by qemu
      still maps to the same local file as we have tracked it, so that
      a compromised qemu cannot accidentally cause us to act on an
      incorrect file.
      
      * src/qemu/qemu_monitor.h (qemuMonitorDiskNameLookup): New
      prototype.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONDiskNameLookup):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorDiskNameLookup): New function.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONDiskNameLookup)
      (qemuMonitorJSONDiskNameLookupOne): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainBlockCommit)
      (qemuDomainBlockJobImpl): Use it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f9ea3d60
    • A
      network: Add midonet virtual port type support to qemu · d490f47b
      Antoni Segura Puimedon 提交于
      Use the utilities introduced in the previous patches so the qemu
      driver is able to create tap devices that are bound (and unbound
      on domain destroyal) to Midonet virtual ports.
      Signed-off-by: NAntoni Segura Puimedon <toni+libvirt@midokura.com>
      d490f47b
    • A
      docs: schema and docs for the midonet virtualport type · a9fbe3b1
      Antoni Segura Puimedon 提交于
      Midonet is an opensource virtual networking that over lays the IP
      network between hypervisors. Currently, such networks can be made
      with the openvswitch virtualport type.
      
      This patch, defines the schema and documentation that will serve
      as basis for the follow up patches that will add support to libvirt
      for using Midonet virtual ports for its interfaces. The schema
      definition requires that the port profile expresses its interfaceid
      as part of the port profile. For that reason, this is part of the
      patch too.
      Signed-off-by: NAntoni Segura Puimedon <toni+libvirt@midokura.com>
      a9fbe3b1
    • A
      util: functions to support binding/unbinding midonet virtualports · e1f64856
      Antoni Segura Puimedon 提交于
      Adds the port type definitions and methods that will be used to bind
      interfaces to the Midonet virtual ports.
      
      virtnetdevmidonet.c adds the way to bind and unbind the ports by
      calling into the Midonet Host Agent control command line (installed
      with the midolman package).
      Signed-off-by: NAntoni Segura Puimedon <toni+libvirt@midokura.com>
      e1f64856