1. 03 7月, 2013 5 次提交
  2. 02 7月, 2013 2 次提交
    • G
      LXC: sort the uidmap/gidmap of domain · 43d4f46a
      Gao feng 提交于
      Make sure the mapping line contains the root user of container
      is the first element of idmap array. So we can get the real
      user id on host for the container easily.
      
      This patch also check the map information, User must map
      the root user of container to any user of host.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      43d4f46a
    • G
      LXC: Introduce New XML element for user namespace · 6c30ea2c
      Gao feng 提交于
      This patch introduces new element <idmap> for
      user namespace. for example
      <idmap>
          <uid start='0' target='1000' count='10'/>
          <gid start='0' target='1000' count='10'/>
      </idmap>
      
      this new element is used for setting proc files
      /proc/<pid>/{uid_map,gid_map}.
      
      This patch also supports multiple uid/gid elements
      setting in XML configuration.
      
      We don't support the semi configuation, user has to
      configure uid and gid both.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      6c30ea2c
  3. 01 7月, 2013 1 次提交
  4. 29 6月, 2013 2 次提交
    • J
      Resolve valgrind errors for nodedev cap parsing · 79e9a224
      John Ferlan 提交于
      There were two errors, one as a direct result of commit id '8807b285'
      and the other from cut-n-paste
      
      TEST: nodedevxml2xmltest
            ..............                           14  OK
      ==25735== 3 bytes in 1 blocks are definitely lost in loss record 1 of 24
      ==25735==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
      ==25735==    by 0x344D2AF275: xmlStrndup (in /usr/lib64/libxml2.so.2.9.1)
      ==25735==    by 0x4D0C767: virNodeDeviceDefParseNode (node_device_conf.c:997)
      ==25735==    by 0x4D0D3D2: virNodeDeviceDefParse (node_device_conf.c:1337)
      ==25735==    by 0x401CA4: testCompareXMLToXMLHelper (nodedevxml2xmltest.c:28)
      ==25735==    by 0x402B2F: virtTestRun (testutils.c:158)
      ==25735==    by 0x401B27: mymain (nodedevxml2xmltest.c:81)
      ==25735==    by 0x40316A: virtTestMain (testutils.c:722)
      ==25735==    by 0x37C1021A04: (below main) (libc-start.c:225)
      ==25735==
      ==25735== 16 bytes in 1 blocks are definitely lost in loss record 10 of 24
      ==25735==    at 0x4A08A6E: realloc (vg_replace_malloc.c:662)
      ==25735==    by 0x4C7385E: virReallocN (viralloc.c:184)
      ==25735==    by 0x4C73906: virExpandN (viralloc.c:214)
      ==25735==    by 0x4C73B4A: virInsertElementsN (viralloc.c:324)
      ==25735==    by 0x4D0C84C: virNodeDeviceDefParseNode (node_device_conf.c:1026)
      ==25735==    by 0x4D0D3D2: virNodeDeviceDefParse (node_device_conf.c:1337)
      ==25735==    by 0x401CA4: testCompareXMLToXMLHelper (nodedevxml2xmltest.c:28)
      ==25735==    by 0x402B2F: virtTestRun (testutils.c:158)
      ==25735==    by 0x401B27: mymain (nodedevxml2xmltest.c:81)
      ==25735==    by 0x40316A: virtTestMain (testutils.c:722)
      ==25735==    by 0x37C1021A04: (below main) (libc-start.c:225)
      ==25735==
      PASS: nodedevxml2xmltest
      
      The first error was resolved by adding a missing VIR_FREE(numberStr); in
      the new function virNodeDevCapPciDevIommuGroupParseXML().
      
      The second error was a bit more opaque as the error was a result of copying
      the free methodolgy of the existing code in virNodeDevCapsDefFree(). The code
      would free each of the entries in the array, but not the memory for the
      array itself.  Added the necessary VIR_FREE(data->pci_dev.iommuGroupDevices)
      and while at it added the missing VIR_FREE(data->pci_dev.virtual_functions)
      although there wasn't a test that tripped across it (thus it's been lurking
      since commit id 'a010165d').
      79e9a224
    • J
      Resolve valgrind error in virNetDevVlanParse() · babb57aa
      John Ferlan 提交于
      Commit '861d4056' introduced the following:
      
      TEST: networkxml2xmltest
            ..................                       18  OK
      ==25504== 7 bytes in 1 blocks are definitely lost in loss record 5 of 23
      ==25504==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
      ==25504==    by 0x37C1085D71: strdup (strdup.c:42)
      ==25504==    by 0x4CB835F: virStrdup (virstring.c:546)
      ==25504==    by 0x4CC5179: virXPathString (virxml.c:90)
      ==25504==    by 0x4CC75C2: virNetDevVlanParse (netdev_vlan_conf.c:78)
      ==25504==    by 0x4CF928A: virNetworkPortGroupParseXML (network_conf.c:1555)
      ==25504==    by 0x4CFE385: virNetworkDefParseXML (network_conf.c:2049)
      ==25504==    by 0x4D0113B: virNetworkDefParseNode (network_conf.c:2273)
      ==25504==    by 0x4D01254: virNetworkDefParse (network_conf.c:2234)
      ==25504==    by 0x401E80: testCompareXMLToXMLHelper (networkxml2xmltest.c:32)
      ==25504==    by 0x402D4F: virtTestRun (testutils.c:158)
      ==25504==    by 0x401CE9: mymain (networkxml2xmltest.c:110)
      ==25504==
      PASS: networkxml2xmltest
      
      Also changed the label from error to cleanup and adjusted code since it's
      all one exit path
      babb57aa
  5. 28 6月, 2013 1 次提交
  6. 27 6月, 2013 1 次提交
    • L
      nodedev: add iommuGroup to node device object · 8807b285
      Laine Stump 提交于
      This includes adding it to the nodedev parser and formatter, docs, and
      test.
      
      An example of the new iommuGroup element that is a part of the output
      from "virsh nodedev-dumpxml" (virNodeDeviceGetXMLDesc()):
      
        <device>
          <name>pci_0000_02_00_1</name>
          <capability type='pci'>
          ...
            <iommuGroup number='12'>
              <address domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
              <address domain='0x0000' bus='0x02' slot='0x00' function='0x1'/>
            </iommuGroup>
          </capability>
        </device>
      8807b285
  7. 25 6月, 2013 1 次提交
  8. 21 6月, 2013 3 次提交
    • J
      conf: add features to volume target XML · 31d42506
      Ján Tomko 提交于
      Add <features> and <compat> elements to volume target XML.
      
      <compat> is a string which for qcow2 represents the QEMU version
      it should be compatible with. Valid values are 0.10 and 1.1.
      1.1 is implicit if the <features> element is present, otherwise
      qemu-img default is used. 0.10 can be specified to explicitly
      create older images after the qemu-img default changes.
      
      <features> contains optional features, so far
      <lazy_refcounts/> is available, which enables caching of reference
      counters, improving performance for snapshots.
      31d42506
    • J
      conf: add vapic and spinlocks to hyperv features · 800b51d7
      Ján Tomko 提交于
      Add new CPU features for HyperV:
      vapic for virtual APIC support
      spinlocks for setting spinlock support
      
      <features>
        <hyperv>
          <vapic state='on'/>
          <spinlocks state='on' retries='4096'/>
        </hyperv>
      </features>
      
      https://bugzilla.redhat.com/show_bug.cgi?id=784836
      800b51d7
    • O
      conf: Requires either uuid or usage of secret · 9b8ee6d0
      Osier Yang 提交于
      As the RNG schema for disk auth secret implies, it requires either
      "uuid" or "usage":
      
        <define name='diskAuthSecret'>
          <element name='secret'>
            <attribute name='type'>
              <choice>
                <value>ceph</value>
                <value>iscsi</value>
              </choice>
            </attribute>
            <choice>
              <attribute name='uuid'>
                <ref name="UUID"/>
              </attribute>
              <attribute name='usage'>
                <ref name='genericName'/>
              </attribute>
            </choice>
          </element>
        </define>
      9b8ee6d0
  9. 19 6月, 2013 1 次提交
  10. 18 6月, 2013 3 次提交
    • O
      4a7b3e58
    • O
      nodedev_udev: Enumerate scsi generic device · 92fd4c09
      Osier Yang 提交于
      Since scsi generic device doesn't have DEVTYPE property set, the
      only way to know if it's a  scsi generic device or not is to read
      the "SUBSYSTEM" property.
      
      The XML of the scsi generic device will be like:
      
      <device>
        <name>scsi_generic_sg0</name>
        <path>/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/scsi_generic/sg0</path>
        <parent>scsi_0_0_0_0</parent>
        <capability type='scsi_generic'>
          <char>/dev/sg0</char>
        </capability>
      </device>
      92fd4c09
    • O
      nodedev: Expose sysfs path of device · c4a4603d
      Osier Yang 提交于
      The name format is constructed by libvirt, it's not that clear to
      get what the device's sysfs path should be. This exposes the device's
      sysfs path by a new tag <path>.
      
      Since the sysfspath is filled during enumerating the devices by
      either udev or HAL. It's an output-only tag.
      c4a4603d
  11. 11 6月, 2013 1 次提交
    • M
      qemu_migrate: Dispose listen address if set from config · 6546017c
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=971485
      
      As of d7f9d827 we copy the listen
      address from the qemu.conf config file in case none has been provided
      via XML. But later, when migrating, we should not include such listen
      address in the migratable XML as it is something autogenerated, not
      requested by user. Moreover, the binding to the listen address will
      likely fail, unless the address is '0.0.0.0' or its IPv6 equivalent.
      This patch introduces a new boolean attribute to virDomainGraphicsListenDef
      to distinguish autofilled listen addresses. However, we must keep the
      attribute over libvirtd restarts, so it must be kept within status XML.
      6546017c
  12. 07 6月, 2013 2 次提交
    • M
      Prefer VIR_STRDUP over virAsprintf(&dst, "%s", str) · e463f4de
      Michal Privoznik 提交于
      There's no sense in using virAsprintf() just to duplicate a string.
      We should use VIR_STRDUP which is designed just for that.
      e463f4de
    • O
      qemu: Report the offset from host UTC for RTC_CHANGE event · e31b5cf3
      Osier Yang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=964177
      
      Though both libvirt and QEMU's document say RTC_CHANGE returns
      the offset from the host UTC, qemu actually returns the offset
      from the specified date instead when specific date is provided
      (-rtc base=$date).
      
      It's not safe for qemu to fix it in code, it worked like that
      for 3 years, changing it now may break other QEMU use cases.
      What qemu tries to do is to fix the document:
      
      http://lists.gnu.org/archive/html/qemu-devel/2013-05/msg04782.html
      
      And in libvirt side, instead of replying on the value from qemu,
      this converts the offset returned from qemu to the offset from
      host UTC, by:
      
        /*
         * a: the offset from qemu RTC_CHANGE event
         * b: The specified date (-rtc base=$date)
         * c: the host date when libvirt gets the RTC_CHANGE event
         * offset: What libvirt will report
         */
      
        offset = a + (b - c);
      
      The specified date (-rtc base=$date) is recorded in clock's def as
      an internal only member (may be useful to exposed outside?).
      
      Internal only XML tag "basetime" is introduced to not lose the
      guest's basetime after libvirt restarting/reloading:
      
      <clock offset='variable' adjustment='304' basis='utc' basetime='1370423588'/>
      e31b5cf3
  13. 06 6月, 2013 2 次提交
  14. 03 6月, 2013 2 次提交
  15. 01 6月, 2013 1 次提交
    • O
      conf: Generate address for scsi host device automatically · cdb97895
      Osier Yang 提交于
      With unknown good reasons, the attribute "bus" of scsi device
      address is always set to 0, same for attribute "target". (See
      virDomainDiskDefAssignAddress).
      
      Though we might need to change the algorithm to honor "bus"
      and "target" too, that's a different issue. The address generator
      for scsi host device in this patch just follows the unknown
      good reasons, only considering the "controller" and "unit".
      It walks through all scsi controllers and their units, to see
      if the address $controller:0:0:$unit can be used (if not used
      by any disk or scsi host device yet), if found one, it sits on
      it, otherwise, it creates a new controller (actually the controller
      is implicitly created by someone else), and sits on
      $new_controller:0:0:0 instead.
      cdb97895
  16. 31 5月, 2013 1 次提交
    • J
      Resolve memory leak found by valgrind · 2f3e7f1e
      John Ferlan 提交于
      Commit '6afdfc8e' adjusted the exit and error paths to go through the error
      and cleanup labels, but neglected to remove the return ret prior to cleanup.
      Also noted the 'type' xml string fetch was never checked for NULL which
      could lead to some interesting results.
      2f3e7f1e
  17. 29 5月, 2013 6 次提交
  18. 28 5月, 2013 1 次提交
    • E
      syntax: prefer space after semicolon in for loop · 146ba114
      Eric Blake 提交于
      I noticed several unusual spacings in for loops, and decided to
      fix them up.  See the next commit for the syntax check that found
      all of these.
      
      * examples/domsuspend/suspend.c (main): Fix spacing.
      * python/libvirt-override.c: Likewise.
      * src/conf/interface_conf.c: Likewise.
      * src/security/virt-aa-helper.c: Likewise.
      * src/util/virconf.c: Likewise.
      * src/util/virhook.c: Likewise.
      * src/util/virlog.c: Likewise.
      * src/util/virsocketaddr.c: Likewise.
      * src/util/virsysinfo.c: Likewise.
      * src/util/viruuid.c: Likewise.
      * src/vbox/vbox_tmpl.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * tools/virsh-domain-monitor.c (vshDomainStateToString): Drop
      default case, to let compiler check us.
      * tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      146ba114
  19. 24 5月, 2013 4 次提交