1. 03 3月, 2015 4 次提交
    • J
      virsh.pod: Add information regarding LXC for setmem, memtune, and dominfo · 69db32f9
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1070695
      
      Modify the virsh man page to more accurately describe which values are
      set by the virsh setmem and displayed by the virsh memtune or dominfo
      based on the setmem command results.
      69db32f9
    • J
      disk: Provide a default storage source format type. · 832a9256
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1181062
      
      According to the formatstorage.html description for <source> element
      and "format" attribute: "All drivers are required to have a default
      value for this, so it is optional."
      
      As it turns out the disk backend did not choose a default value, so I
      added a default of "msdos" if the source type is "unknown" as well as
      updating the storage.html backend disk volume driver documentation to
      indicate the default format is dos.
      832a9256
    • J
      disk: Disallow duplicated target 'dev' values · e0e29055
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1142631
      
      This patch resolves a situation where the same "<target dev='$name'...>"
      can be used for multiple disks in the domain.
      
      While the $name is "mostly" advisory regarding the expected order that
      the disk is added to the domain and not guaranteed to map to the device
      name in the guest OS, it still should be unique enough such that other
      domblk* type operations can be performed.
      
      Without the patch, the domblklist will list the same Target twice:
      
      $ virsh domblklist $dom
      Target     Source
      ------------------------------------------------
      sda        /var/lib/libvirt/images/file.qcow2
      sda        /var/lib/libvirt/images/file.img
      
      Additionally, getting domblkstat, domblkerror, domblkinfo, and other block*
      type calls will not be able to reference the second target.
      
      Fortunately, hotplug disallows adding a "third" sda value:
      
      $ qemu-img create -f raw /var/lib/libvirt/images/file2.img 10M
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sda
      error: Failed to attach disk
      error: operation failed: target sda already exists
      
      $
      
      BUT, it since 'sdb' doesn't exist one would get the following on the same
      hotplug attempt, but changing to use 'sdb' instead of 'sda'
      
      $ virsh attach-disk $dom /var/lib/libvirt/images/file2.img sdb
      error: Failed to attach disk
      error: internal error: unable to execute QEMU command 'device_add': Duplicate ID 'scsi0-0-1' for device
      
      $
      
      Since we cannot fix this issue at parsing time, the best that can be done so
      as to not "lose" a domain is to make the check prior to starting the guest
      with the results as follows:
      
      $ virsh start $dom
      error: Failed to start domain $dom
      error: XML error: target 'sda' duplicated for disk sources '/var/lib/libvirt/images/file.qcow2' and '/var/lib/libvirt/images/file.img'
      
      $
      
      Running 'make check' found a few more instances in the tests where this
      duplicated target dev value was being used. These also exhibited some
      duplicated 'id=' values (negating the uniqueness argument of aliases) in
      the corresponding .args file and of course the *xmlout version of a few
      input XML files.
      e0e29055
    • J
      virsh: Adjust domblklist to understand disk volume syntax · 09aec2a4
      John Ferlan 提交于
      A disk using a source pool is listed as having a source '-' in domblklist
      because it doesn't check the right XML syntax to find the source.
      
      Add a check for "./source/volume" which is where the "path" (of sorts)
      to the volume name is described.
      09aec2a4
  2. 02 3月, 2015 26 次提交
  3. 27 2月, 2015 3 次提交
  4. 26 2月, 2015 7 次提交
    • P
      util: storage: Fix error type in virStorageSourceParseBackingURI · ef2e6f40
      Peter Krempa 提交于
      The gluster volume name extraction code was copied from the XML parser
      without changing the VIR_ERR_XML_ERROR error code. Use
      VIR_ERR_CONFIG_UNSUPPORTED instead.
      ef2e6f40
    • P
      util: storagefile: Don't crash on gluster URIs without path · fc56ecd7
      Peter Krempa 提交于
      Similar to commit fdb80ed4 libvirtd
      would crash if a gluster URI without path would be used in the backing
      chain of a volume. The crash happens in the gluster specific part of the
      parser that extracts the gluster volume name from the path.
      
      Fix the crash by checking that the PATH is NULL.
      
      This patch does not contain a test case as it's not possible to test it
      with the current infrastructure as the test suite would attempt to
      contact the gluster server in the URI. I'm working on the test suite
      addition but that will be post-release material.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1196528
      fc56ecd7
    • J
      conf: error out on missing dhcp host attributes · b15b21f3
      Ján Tomko 提交于
      In virNetworkDHCPHostDefParseXML an error is reported
      when partialOkay == true, and none of ip, mac, name
      were supplied.
      
      Add the missing goto and error out in this case.
      b15b21f3
    • L
      conf: error out on invalid host id · 719cd218
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1196503
      
      We already check whether the host id is valid or not, add a jump
      to forbid invalid host id.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      719cd218
    • L
      qemu: fix ifindex array reported to systemd · 4bbe1029
      Laine Stump 提交于
      Commit f7afeddc added code to report to systemd an array of interface
      indexes for all tap devices used by a guest. Unfortunately it not only
      didn't add code to report the ifindexes for macvtap interfaces
      (interface type='direct') or the tap devices used by type='ethernet',
      it ended up sending "-1" as the ifindex for each macvtap or hostdev
      interface. This resulted in a failure to start any domain that had a
      macvtap or hostdev interface (or actually any type other than
      "network" or "bridge").
      
      This patch does the following with the nicindexes array:
      
      1) Modify qemuBuildInterfaceCommandLine() to only fill in the
      nicindexes array if given a non-NULL pointer to an array (and modifies
      the test jig calls to the function to send NULL). This is because
      there are tests in the test suite that have type='ethernet' and still
      have an ifname specified, but that device of course doesn't actually
      exist on the test system, so attempts to call virNetDevGetIndex() will
      fail.
      
      2) Even then, only add an entry to the nicindexes array for
      appropriate types, and to do so for all appropriate types ("network",
      "bridge", and "direct"), but only if the ifname is known (since that
      is required to call virNetDevGetIndex().
      4bbe1029
    • L
      util: check for null ifname inside virNetDevBandwidthSet() · 153b06c6
      Laine Stump 提交于
      Previously this function relied on having ATTRIBUTE_NONNULL(1) in its
      prototype rather than explicitly checking for a null
      ifname. Unfortunately, ATTRIBUTE_NONNULL is just a hint to the
      optimizer and code analyzers like Coverity, it doesn't actually check
      anything at execution time, so the result was possible warnings from
      Coverity, along with the possibility of null dereferences when ifname
      wasn't available.
      
      This patch removes the ATTRIBUTE_NONNULL from the prototype, and
      checks ifname inside the function, logging an error if it's NULL (once
      we've determined that the user really is trying to set a bandwidth).
      153b06c6
    • L
      network: only clear bandwidth if it has been set · 118b2408
      Laine Stump 提交于
      libvirt was unconditionally calling virNetDevBandwidthClear() for
      every interface (and network bridge) of a type that supported
      bandwidth, whether it actually had anything set or not. This doesn't
      hurt anything (unless ifname == NULL!), but is wasteful.
      
      This patch makes sure that all calls to virNetDevBandwidthClear() are
      qualified by checking that the interface really had some bandwidth
      setup done, and checks for a null ifname inside
      virNetDevBandwidthClear(), silently returning success if it is null
      (as well as removing the ATTRIBUTE_NONNULL from that function's
      prototype, since we can't guarantee that it is never null,
      e.g. sometimes a type='ethernet' interface has no ifname as it is
      provided on the fly by qemu).
      118b2408