1. 05 12月, 2017 1 次提交
    • M
      tests: Drop qemuxml2argv- prefix for qemuxml2argv-*.xml test cases · 2e02f2b2
      Michal Privoznik 提交于
      These XMLs live in a separate directory, there's no need for them
      to have a special prefix in addition. It also doesn't play nicely
      with ':e' completion in Vim, finding proper file based on
      qemuxml2argvtest.c is also needlessly complicated.
      
      The files were renamed using the following commands. From
      qemuxml2argvdata:
      
        for i in qemuxml2argv-*.xml; do mv $i ${i#qemuxml2argv-}; done
      
      and then (to fix broken symlinks) from qemuxml2argvdata and
      qemuxml2xmloutdata:
      
        for i in $(find . -xtype l); do \
            ln -sf $(readlink $i | sed 's/qemuxml2argv-//') $i;
        done
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2e02f2b2
  2. 11 4月, 2017 1 次提交
  3. 19 4月, 2016 1 次提交
    • J
      tests: Fix syntax in iSCSI auth/secret tests · dd140028
      John Ferlan 提交于
      While working on the tests for the secret initialization vector, I found
      that the existing iSCSI tests were lacking in how they defined the IQN.
      Many had IQN's of just 'iqn.1992-01.com.example' for one disk while using
      'iqn.1992-01.com.example/1' for the second disk (same for hostdevs - guess
      how they were copied/generated).
      
      Typically (and documented this way), IQN's would include be of the form
      'iqn.1992-01.com.example:storage/1' indicating an IQN using "storage" for
      naming authority specific string and "/1" for the iSCSI LUN.
      
      So modify the input XML's to use the more proper format - this of course
      has a ripple effect on the output XML and the args.
      
      Also note that the "%3A" is generated by the virURIFormat/xmlSaveUri
      to represent the colon.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      dd140028
  4. 27 1月, 2016 1 次提交
    • P
      device: cleanup input device code · 36785c7e
      Pavel Hrdina 提交于
      The current code was a little bit odd.  At first we've removed all
      possible implicit input devices from domain definition to add them later
      back if there was any graphics device defined while parsing XML
      description.  That's not all, while formating domain definition to XML
      description we at first ignore any input devices with bus different to
      USB and VIRTIO and few lines later we add implicit input devices to XML.
      
      This seems to me as a lot of code for nothing.  This patch may look
      to be more complicated than original approach, but this is a preferred
      way to modify/add driver specific stuff only in those drivers and not
      deal with them in common parsing/formating functions.
      
      The update is to add those implicit input devices into config XML to
      follow the real HW configuration visible by guest OS.
      
      There was also inconsistence between our behavior and QEMU's in the way,
      that in QEMU there is no way how to disable those implicit input devices
      for x86 architecture and they are available always, even without graphics
      device.  This applies also to XEN hypervisor.  VZ driver already does its
      part by putting correct implicit devices into live XML.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      36785c7e
  5. 08 8月, 2014 1 次提交
    • J
      hostdev: Add iSCSI hostdev XML · 54ac483e
      John Ferlan 提交于
      Introduce a new structure to handle an iSCSI host device based on the
      existing virDomainHostdevSubsysSCSI by adding a "protocol='iscsi'" to
      the <source/> element. The existing scsi_host subsystem RNG was modified
      to read an optional "protocol='adapter'", although it won't be written
      out nor is it documented as an option (by choice).
      
      The new hostdev structure mimics the existing <disk/> element for an
      iSCSI device (network) device. New XML is:
      
        <hostdev mode='subsystem' type='scsi' managed='yes'>
          <source protocol='iscsi' name='iqn.1992-01.com.example'>
            <host name='example.org' port='3260'/>
            <auth username='myname'>
              <secret type='iscsi' usage='mycluster_myname'/>
            </auth>
          </source>
          <address type='drive' controller='0' bus='0' target='2' unit='5'/>
        </hostdev>
      
      The controller element will mimic the existing scsi_host code insomuch
      as when 'lsi' and 'virtio-scsi' are used.
      54ac483e
  6. 13 5月, 2013 2 次提交
    • H
      qemu: Build qemu command line for scsi host device · 0d70656a
      Han Cheng 提交于
      Except the scsi host device's controller is "lsilogic", mapping
      between the libvirt attributes and scsi-generic properties is:
      
        libvirt     qemu
      -----------------------------------------
        controller  bus ($libvirt_controller.0)
        bus         channel
        target      scsi-id
        unit        lun
      
      For scsi host device with "lsilogic" controller, the mapping is:
      ('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
      must <= 7).
      
        libvirt            qemu
      ----------------------------------------------------------
        controller && bus  bus ($libvirt_controller.$libvirt_bus)
        unit               scsi-id
      
      It's not good to hardcode/hard-check limits of these attributes,
      and even worse, these limits are not documented, one has to find
      out by either testing or reading the qemu code, I'm looking forward
      to qemu expose limits like these one day). For example, exposing
      "max_target", "max_lun" for megasas:
      
      static const struct SCSIBusInfo megasas_scsi_info = {
          .tcq = true,
          .max_target = MFI_MAX_LD,
          .max_lun = 255,
      
          .transfer_data = megasas_xfer_complete,
          .get_sg_list = megasas_get_sg_list,
          .complete = megasas_command_complete,
          .cancel = megasas_command_cancel,
      };
      
      Example of the qemu command line (lsilogic controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,scsi-id=8,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      
      Example of the qemu command line (virtio-scsi controller):
      
        -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
        -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
        drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      0d70656a
    • H
      conf: Generic XMLs for scsi hostdev · 5c811dce
      Han Cheng 提交于
      An example of the scsi hostdev XML:
      
          <hostdev mode='subsystem' type='scsi'>
            <source>
              <adapter name='scsi_host0'/>
              <address bus='0' target='0' unit='0'/>
            </source>
            <address type='drive' controller='0' bus='0' target='4' unit='8'/>
          </hostdev>
      
      Controller is implicitly added for scsi hostdev, though the scsi
      controller's model defaults to "lsilogic", which might be not what
      the user wants (same problem exists for virtio-scsi disk). It's
      the existing problem, will be addressed later.
      
      The device address must be specified manually. Later patch will let
      libvirt generate it automatically.
      
      This only introduces the generic XMLs for scsi hostdev, later patches
      will add other elements, e.g. <readonly>, <shareable>.
      Signed-off-by: NHan Cheng <hanc.fnst@cn.fujitsu.com>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      5c811dce
  7. 29 4月, 2013 1 次提交
  8. 25 4月, 2013 2 次提交
    • J
      qemu: auto-add pci-root controller for pc machine types · b33eb0dc
      Ján Tomko 提交于
      <controller type='pci' index='0' model='pci-root'/>
      is auto-added to pc* machine types.
      Without this controller PCI bus 0 is not available and
      no PCI addresses are assigned by default.
      
      Since older libvirt supported PCI bus 0 even without
      this controller, it is removed from the XML when migrating.
      b33eb0dc
    • J
      qemu: call post-parse callbacks when parsing command line too · 024e9af3
      Ján Tomko 提交于
      Now we set the default disk driver name when parsing
      the qemu command line too, hence all the test changes.
      
      Assume format type is 'auto' when none is specified on
      qemu command line.
      024e9af3
  9. 09 5月, 2012 1 次提交
    • O
      numad: Always output 'placement' of <vcpu> · d70f2e11
      Osier Yang 提交于
      <vcpu> is not an optional node. The value for its 'placement'
      actually always defaults to 'static' in the underlying codes.
      (Even no 'cpuset' and 'placement' is specified, the domain
      process will be pinned to all the available pCPUs).
      d70f2e11
  10. 08 3月, 2012 1 次提交
    • E
      xml: output memory unit for clarity · 26545784
      Eric Blake 提交于
      Make it obvious to 'dumpxml' readers what unit we are using,
      since our default of KiB for memory (1024) differs from qemu's
      default of MiB; and differs from our use of bytes for storage.
      
      Tests were updated via:
      
      $ find tests/*data tests/*out -name '*.xml' | \
        xargs sed -i 's/<\(memory\|currentMemory\|hard_limit\|soft_limit\|min_guarantee\|swap_hard_limit\)>/<\1 unit='"'KiB'>/"
      $ find tests/*data tests/*out -name '*.xml' | \
        xargs sed -i 's/<\(capacity\|allocation\|available\)>/<\1 unit='"'bytes'>/"
      
      followed by a few fixes for the stragglers.
      
      Note that with this patch, the RNG for <memory> still forbids
      validation of anything except unit='KiB', since the code silently
      ignores the attribute; a later patch will expand <memory> to allow
      scaled input in the code and update the RNG to match.
      
      * docs/schemas/basictypes.rng (unit): Add 'bytes'.
      (scaledInteger): New define.
      * docs/schemas/storagevol.rng (sizing): Use it.
      * docs/schemas/storagepool.rng (sizing): Likewise.
      * docs/schemas/domaincommon.rng (memoryKBElement): New define; use
      for memory elements.
      * src/conf/storage_conf.c (virStoragePoolDefFormat)
      (virStorageVolDefFormat): Likewise.
      * src/conf/domain_conf.h (_virDomainDef): Document unit used
      internally.
      * src/conf/storage_conf.h (_virStoragePoolDef, _virStorageVolDef):
      Likewise.
      * tests/*data/*.xml: Update all tests.
      * tests/*out/*.xml: Likewise.
      * tests/define-dev-segfault: Likewise.
      * tests/openvzutilstest.c (testReadNetworkConf): Likewise.
      * tests/qemuargv2xmltest.c (blankProblemElements): Likewise.
      26545784
  11. 28 2月, 2012 1 次提交
    • O
      conf: Introduce new attribute for device address format · 4288b22f
      Osier Yang 提交于
      * src/conf/domain_conf.h: Add new member "target" to struct
        _virDomainDeviceDriveAddress.
      
      * src/conf/domain_conf.c: Parse and format "target"
      
      * Lots of tests (.xml) in tests/domainsnapshotxml2xmlout,
        tests/qemuxml2argvdata, tests/qemuxml2xmloutdata, and
        tests/vmx2xmldata/ are modified for newly introduced
        attribute "target" for address of "drive" type.
      4288b22f
  12. 10 2月, 2012 1 次提交
    • M
      domain: add implicit USB controller · 42043afc
      Marc-André Lureau 提交于
      Some tools, such as virt-manager, prefers having the default USB
      controller explicit in the XML document. This patch makes sure there
      is one. With this patch, it is now possible to switch from USB1 to
      USB2 from the release 0.9.1 of virt-manager.
      
      Fix tests to pass with this change.
      42043afc
  13. 29 1月, 2011 1 次提交
    • M
      Add VIR_DIV_UP to divide memory or storage request sizes with round up · d9ad8ac3
      Matthias Bolte 提交于
      Use it in all places where a memory or storage request size is converted
      to a larger granularity. This avoids requesting too small memory or storage
      sizes that could result from the truncation done by a simple division.
      
      This extends the round up fix in 6002e040
      to the whole codebase.
      
      Instead of reporting errors for odd values in the VMX code round them up.
      
      Update the QEMU Argv tests accordingly as the original memory size 219200
      isn't a even multiple of 1024 and is rounded up to 215 megabyte now. Change
      it to 219100 and 219136. Use two different values intentionally to make
      sure that rounding up works.
      
      Update virsh.pod accordingly, as rounding down and rejecting are replaced
      by rounding up.
      d9ad8ac3
  14. 21 7月, 2010 1 次提交
    • D
      Explicitly represent balloon device in XML and handle PCI address · b2f18635
      Daniel P. Berrange 提交于
      To allow compatibility with older QEMU PCI device slot assignment
      it is necessary to explicitly track the balloon device in the
      XML. This introduces a new device
      
         <memballoon model='virtio|xen'/>
      
      It can also have a PCI address, auto-assigned if necessary.
      
      The memballoon will be automatically added to all Xen and QEMU
      guests by default.
      
      * docs/schemas/domain.rng: Add <memballoon> element
      * src/conf/domain_conf.c, src/conf/domain_conf.h: parsing
        and formatting for memballoon device. Always add a memory
        balloon device to Xen/QEMU if none exists in XML
      * src/libvirt_private.syms: Export memballoon model APIs
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Honour the
        PCI device address in memory balloon device
      * tests/*: Update to test new functionality
      b2f18635
  15. 18 1月, 2010 1 次提交
    • D
      Auto-add disk controllers based on defined disks · b030084f
      Daniel P. Berrange 提交于
      Existing applications using libvirt are not aware of the disk
      controller concept. Thus, after parsing the <disk> definitions
      in the XML, it is neccessary to create <controller> elements
      to satisfy all requested disks, as per their defined drive
      addresses
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDefAddDiskControllers()
        method for populating disk controllers, and call it after
        parsing disk definitions.
      * src/qemu/qemu_conf.c: Call virDomainDefAddDiskControllers()
        when doing ARGV -> XML conversion
      * tests/qemuxml2argvdata/qemuxml2argv*.xml: Add disk controller
        data to all data files which don't have it already
      b030084f
  16. 16 1月, 2010 1 次提交
    • D
      Set default disk controller/bus/unit props · 776e37e1
      Daniel P. Berrange 提交于
      When parsing the <disk> element specification, if no <address>
      is provided for the disk, then automatically assign one based on
      the <target dev='sdXX'/> device name. This provides for backwards
      compatability with existing applications using libvirt, while also
      allowing new apps to have complete fine grained control.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c,
        src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
        for assigning a controller/bus/unit address based on disk target
      * src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
        generating XML from ARGV
      * tests/qemuxml2argvdata/*.xml: Add in drive address information
        to all XML files
      776e37e1
  17. 21 5月, 2009 1 次提交
  18. 03 3月, 2009 1 次提交
    • D
      adds a new <hostdev managed='(yes|no)'> property to host devices in domains · 09fb8845
      Daniel Veillard 提交于
      * docs/schemas/domain.rng src/domain_conf.c src/domain_conf.h
        src/qemu_conf.c
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml:
        adds a new <hostdev managed='(yes|no)'> property
        to host devices indicating whether or not we should
        automatically dettach/reset, patch by Mark McLoughlin
      daniel
      09fb8845
  19. 12 1月, 2009 1 次提交
    • D
      Add tests and docs for the new PCI passthrough format · c8ef64bd
      Daniel Veillard 提交于
      * docs/formatdomain.html.in docs/libvirt.rng docs/formatdomain.html:
        document the new PCI passthrough format
      * tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.args
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml:
        and add a regression test for it.
      Daniel
      c8ef64bd
  20. 08 8月, 2008 1 次提交
    • D
      Extend parser and add support for USB devices in QEmu/KVM · d1710d35
      Daniel Veillard 提交于
      * src/domain_conf.c src/domain_conf.h src/qemu_conf.c
        src/qemu_driver.c: Patch from Guido Günther allowing to pass
        usb devices to qemu/kvm
      * docs/libvirt.rng: add the new functionality to the grammar
      * tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.args
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml
        tests/qemuxml2argvtest.c tests/qemuxml2xmltest.c: adding examples
        to the regression tests
      * libvirt.spec.in: fix the licence tag
      Daniel
      d1710d35
  21. 10 5月, 2008 1 次提交
  22. 19 7月, 2007 1 次提交