1. 12 4月, 2016 1 次提交
    • J
      tests: fix xen-related tests · 4b35a715
      Ján Tomko 提交于
      My commit 6879be48 moved the addition of the implicit video device
      from the XML parser to the PostParse function, but did not regenerate
      all the tests.
      4b35a715
  2. 19 2月, 2016 1 次提交
    • C
      domain: add implicit controllers from post parse · 4066c734
      Cole Robinson 提交于
      Seems like the natural fit, since we are already adding other XML bits
      in the PostParse routine.
      
      Previously AddImplicitControllers was only called at the end of XML
      parsing, meaning code that builds a DomainDef by hand had to manually
      call it. Now those PostParse callers get it for free.
      
      There's some test churn here; xen xm and sexpr test suite bits weren't
      calling this before, but now they are, so you'll see new IDE controllers.
      I don't think this will cause problems in practice, since the code already
      needs to handle these implicit controllers like in the case when a user
      defines their own XML.
      4066c734
  3. 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
  4. 09 1月, 2016 1 次提交
    • J
      xenconfig: support vif bandwidth in sexpr parser and formatter · 1dd34bbb
      Jim Fehlig 提交于
      The xen sexpr config format has long supported specifying vif rate
      limiting, e.g.
      
        (device
          (vif
            (mac '00:16:3e:1b:b1:47')
            (rate '10240KB/s')
            ...
          )
        )
      
      Add support for mapping rate to and from <bandwidth> in the xenconfig
      sexpr parser and formatter. rate is mapped to the required 'average'
      attribute of the <outbound> element, e.g.
      
        <interface type='bridge'>
          ...
          <bandwidth>
            <outbound average='10240'/>
          </bandwidth>
        </interface>
      
      Also add unit tests to check the conversion logic.
      
      This patch benefits both the old xen driver and the libxl driver.
      Both drivers gain support for vif bandwidth when converting to/from
      domXML and xen-sxpr. In addition, the old xen driver will now be
      able to handle vif 'rate' setting when communicating with xend.
      1dd34bbb
  5. 18 12月, 2015 2 次提交
  6. 09 12月, 2015 1 次提交
  7. 06 1月, 2015 1 次提交
  8. 10 9月, 2014 1 次提交
    • M
      conf: Extend <loader/> and introduce <nvram/> · 68bf13db
      Michal Privoznik 提交于
      Up to now, users can configure BIOS via the <loader/> element. With
      the upcoming implementation of UEFI this is not enough as BIOS and
      UEFI are conceptually different. For instance, while BIOS is ROM, UEFI
      is programmable flash (although all writes to code section are
      denied). Therefore we need new attribute @type which will
      differentiate the two. Then, new attribute @readonly is introduced to
      reflect the fact that some images are RO.
      
      Moreover, the OVMF (which is going to be used mostly), works in two
      modes:
      1) Code and UEFI variable store is mixed in one file.
      2) Code and UEFI variable store is separated in two files
      
      The latter has advantage of updating the UEFI code without losing the
      configuration. However, in order to represent the latter case we need
      yet another XML element: <nvram/>. Currently, it has no additional
      attributes, it's just a bare element containing path to the variable
      store file.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68bf13db
  9. 24 4月, 2014 1 次提交
    • J
      conf: Format and parse backing chains in domain XML · 546154e3
      Jiri Denemark 提交于
      This patch implements formating and parsing code for the backing store
      schema defined and documented by the previous patch.
      
      This patch does not aim at providing full persistent storage of disk
      backing chains yet. The formatter is supposed to provide the backing
      chain detected when starting a domain and thus it is not formatted into
      an inactive domain XML. The parser is implemented mainly for the purpose
      of testing the XML generated by the formatter and thus it does not
      distinguish between no backingStore element and an empty backingStore
      element. This will have to change once we fully implement support for
      user-supplied backing chains.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      546154e3
  10. 19 2月, 2014 1 次提交
  11. 20 10月, 2012 1 次提交
    • E
      storage: treat 'aio' like 'raw' at parse time · 41e0edaf
      Eric Blake 提交于
      We have historically allowed 'aio' as a synonym for 'raw' for
      back-compat to xen, but since a future patch will move to using
      an enum value, we have to pick one to be our preferred output
      name.  This is a slight change in the output XML, but the sexpr
      and xm outputs should still be identical, and the input XML can
      still use either form.
      
      * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Move aio
      back-compat...
      (virDomainDiskDefParseXML): ...to parse time.
      * src/xenxs/xen_sxpr.c (xenParseSxprDisks, xenFormatSxprDisk): ...and
      to output time.
      * src/xenxs/xen_xm.c (xenParseXM, xenFormatXMDisk): Likewise.
      * tests/sexpr2xmldata/sexpr2xml-*.xml: Update tests.
      41e0edaf
  12. 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
  13. 02 4月, 2012 1 次提交
    • P
      Xen: Fix <clock> handling · 11ec6bd8
      Philipp Hahn 提交于
      XenD-3.1 introduced managed domains. HV-domains have rtc_timeoffset
      (hgd24f37b31030 from 2007-04-03), which tracks the offset between the
      hypervisors clock and the domains RTC, and is persisted by XenD.
      In combination with localtime=1 this had a bug until XenD-3.4
      (hg5d701be7c37b from 2009-04-01) (I'm not 100% sure how that bug
      manifests, but at least for me in TZ=Europe/Berlin I see the previous
      offset relative to utc being applied to localtime again, which manifests
      in an extra hour being added)
      
      XenD implements the following variants for clock/@offset:
      - PV domains don't have a RTC → 'localtime' | 'utc'
      - <3.1: no managed domains → 'localtime' | 'utc'
      - ≥3.1: the offset is tracked for HV → 'variable'
              due to the localtime=1 bug → 'localtime' | 'utc'
      - ≥3.4: the offset is tracked for HV → 'variable'
      
      Current libvirtd still thinks XenD only implements <clock offset='utc'/>
      and <clock offset='localtime'/>, which is wrong, since the semantic of
      'utc' and 'localtime' specifies, that the offset will be reset on
      domain-restart, while with 'variable' the offset is kept. (keeping the
      offset over "virsh edit" is important, since otherwise the clock might
      jump, which confuses certain guest OSs)
      
      xendConfigVersion was last incremented to 4 by the xen-folks for
      xen-3.1.0. I know of no way to reliably detect the version of XenD
      (user space tools), which may be different from the version of the
      hypervisor (kernel) version! Because of this only the change from
      'utc'/'localtime' to 'variable' in XenD-3.1 is handled, not the buggy
      behaviour of XenD-3.1 until XenD-3.4.
      
      For backward compatibility with previous versions of libvirt Xen-HV
      still accepts 'utc' and 'localtime', but they are returned as 'variable'
      on the next read-back from Xend to libvirt, since this is what XenD
      implements: The RTC is NOT reset back to the specified time on next
      restart, but the previous offset is kept.
      This behaviour can be turned off by adding the additional attribute
      adjustment='reset', in which case libvirt will report an error instead
      of doing the conversion. The attribute can also be used as a shortcut to
      offset='variable' with basis='...'.
      
      With these changes, it is also necessary to adjust the xen tests:
      
      "localtime = 0" is always inserted, because otherwise on updates the
      value is not changed within XenD.
      
      adjustment='reset' is inserted for all cases, since they're all <
      XEND_CONFIG_VERSION_3_1_0, only 3.1 introduced persistent
      rtc_timeoffset.
      
      Some statements change their order because code was moved around.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      11ec6bd8
  14. 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
  15. 11 10月, 2011 1 次提交
    • G
      xen_xs: Guard against set but empty kernel argument · dca1a6b4
      Guido Günther 提交于
      On xen 4.1 I observed configurations that look like:
      
      (image
          (hvm
              (kernel '')
              (loader '/foo/bar')
      ))
      
      The kernel element is there but unset. This leads to an empty <kernel/>
      element in the XML and even worse makes us skip the boot order parsing
      and therefore not emit a <boot device='$dev>'/> element which breaks CD
      booting.
      dca1a6b4
  16. 29 7月, 2011 1 次提交
    • L
      conf: add <listen> subelement to domain <graphics> element · ef79fb5b
      Laine Stump 提交于
      Once it's plugged in, the <listen> element will be an optional
      replacement for the "listen" attribute that graphics elements already
      have. If the <listen> element is type='address', it will have an
      attribute called 'address' which will contain an IP address or dns
      name that the guest's display server should listen on. If, however,
      type='network', the <listen> element should have an attribute called
      'network' that will be set to the name of a network configuration to
      get the IP address from.
      
      * docs/schemas/domain.rng: updated to allow the <listen> element
      
      * docs/formatdomain.html.in: document the <listen> element and its
        attributes.
      
      * src/conf/domain_conf.[hc]:
      
        1) The domain parser, formatter, and data structure are modified to
           support 0 or more <listen> subelements to each <graphics>
           element. The old style "legacy" listen attribute is also still
           accepted, and will be stored internally just as if it were a
           separate <listen> element. On output (i.e. format), the address
           attribute of the first <listen> element of type 'address' will be
           duplicated in the legacy "listen" attribute of the <graphic>
           element.
      
        2) The "listenAddr" attribute has been removed from the unions in
           virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
           This attribute is now in the <listen> subelement (aka
           virDomainGraphicsListenDef)
      
        3) Helper functions were written to provide simple access
           (both Get and Set) to the listen elements and their attributes.
      
      * src/libvirt_private.syms: export the listen helper functions
      
      * src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
        src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
        src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
      
        Modify all these files to use the listen helper functions rather
        than directly referencing the (now missing) listenAddr
        attribute. There can be multiple <listen> elements to a single
        <graphics>, but the drivers all currently only support one, so all
        replacements of direct access with a helper function indicate index
        "0".
      
      * tests/* - only 3 of these are new files added explicitly to test the
        new <listen> element. All the others have been modified to reflect
        the fact that any legacy "listen" attributes passed in to the domain
        parse will be saved in a <listen> element (i.e. one of the
        virDomainGraphicsListenDefs), and during the domain format function,
        both the <listen> element as well as the legacy attributes will be
        output.
      ef79fb5b
  17. 11 7月, 2011 1 次提交
    • J
      Do not drop kernel cmdline for xen pv domains · eb314315
      Jim Fehlig 提交于
      Kernel cmdline args can be passed to xen pv domains even when a
      bootloader is specified.  The current config-to-sxpr mapping
      ignores cmdline when bootloader is present.
      
      Since the xend sub-driver is used with many xen toolstack versions,
      this patch takes conservative approach of adding an else block to
      existing !def->os.bootloader, and only appends sxpr if def->os.cmdline
      is non-NULL.
      
      V2: Fix existing testcase broken by this patch and add new testcases
      eb314315
  18. 11 5月, 2011 1 次提交
    • P
      xen: parse and generate hpet item in sxpr · e547e44c
      Paolo Bonzini 提交于
      Recent versions of Xen disable the virtual HPET by default.  This is
      usually more precise because tick policies are not implemented for
      the HPET in Xen.  However, there may be several reasons to control
      the HPET manually: 1) to test the emulation; 2) because distros may
      provide the knob while leaving the default to "enabled" for compatibility
      reasons.
      
      This patch provides support for the hpet item in both sexpr and xm
      formats, and translates it to a <timer> element.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e547e44c
  19. 03 3月, 2011 1 次提交
    • E
      maint: avoid long lines in more tests · 3b750d13
      Eric Blake 提交于
      * tests/xml2sexprdata/*.sexpr: Add backslash-newlines.
      * tests/sexpr2xmldata/*.sexpr: Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-aio.args: Likewise.
      3b750d13
  20. 26 2月, 2011 1 次提交
    • M
      Add support for multiple serial ports into the Xen driver · 3ee7cf6c
      Michal Novotny 提交于
      this is the patch to add support for multiple serial ports to the
      libvirt Xen driver. It support both old style (serial = "pty") and
      new style (serial = [ "/dev/ttyS0", "/dev/ttyS1" ]) definition and
      tests for xml2sexpr, sexpr2xml and xmconfig have been added as well.
      
      Written and tested on RHEL-5 Xen dom0 and working as designed but
      the Xen version have to have patch for RHBZ #614004 but this patch
      is for upstream version of libvirt.
      
      Also, this patch is addressing issue described in RHBZ #670789.
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      3ee7cf6c
  21. 18 12月, 2010 1 次提交
    • E
      maint: improve tests distribution · 65532f45
      Eric Blake 提交于
      * tests/Makefile.am (EXTRA_DIST): Sort, and add directories.
      (SUBDIRS): Drop automake recursion into subdirs.
      * tests/commanddata/Makefile.am: Delete.
      * tests/confdata/Makefile.am: Likewise.
      * tests/sexpr2xmldata/Makefile.am: Likewise.
      * tests/xencapsdata/Makefile.am: Likewise.
      * tests/xmconfigdata/Makefile.am: Likewise.
      * tests/xml2sexprdata/Makefile.am: Likewise.
      65532f45
  22. 20 10月, 2010 1 次提交
    • E
      vcpu: improve vcpu support in xen command line · 0fab10e5
      Eric Blake 提交于
      This patch series focuses on xendConfigVersion 2 (xm_internal) and 3
      (xend_internal), but leaves out changes for xenapi drivers.
      
      See this link for more details about vcpu_avail for xm usage.
      http://lists.xensource.com/archives/html/xen-devel/2009-11/msg01061.html
      
      This relies on the fact that def->maxvcpus can be at most 32 with xen.
      
      * src/xen/xend_internal.c (xenDaemonParseSxpr)
      (sexpr_to_xend_domain_info, xenDaemonFormatSxpr): Use vcpu_avail
      when current vcpus is less than maximum.
      * src/xen/xm_internal.c (xenXMDomainConfigParse)
      (xenXMDomainConfigFormat): Likewise.
      * tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr: New file.
      * tests/sexpr2xmldata/sexpr2xml-pv-vcpus.sexpr: Likewise.
      * tests/sexpr2xmldata/sexpr2xml-pv-vcpus.xml: Likewise.
      * tests/xmconfigdata/test-paravirt-vcpu.cfg: Likewise.
      * tests/xmconfigdata/test-paravirt-vcpu.xml: Likewise.
      * tests/xml2sexprtest.c (mymain): New test.
      * tests/sexpr2xmltest.c (mymain): Likewise.
      * tests/xmconfigtest.c (mymain): Likewise.
      0fab10e5
  23. 13 10月, 2010 1 次提交
    • D
      Fix Xen SEXPR generation to properly quote strings containing () · 3a092f38
      Daniel P. Berrange 提交于
      * src/xen/sexpr.c: Ensure () are escaped in sexpr2string
      * tests/sexpr2xmldata/sexpr2xml-boot-grub.sexpr,
        tests/sexpr2xmldata/sexpr2xml-boot-grub.xml,
        tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr,
        tests/xml2sexprdata/xml2sexpr-boot-grub.xml: Data files to
        check escaping
      * tests/sexpr2xmltest.c, tests/xml2sexprtest.c: Add boot-grub
        escaping test case
      3a092f38
  24. 31 8月, 2010 1 次提交
  25. 29 7月, 2010 1 次提交
    • C
      domain conf: Track <console> target type · 6b247552
      Cole Robinson 提交于
      All <console> devices now export a <target> type attribute. QEMU defaults
      to 'serial', UML defaults to 'uml, xen can be either 'serial' or 'xen'
      depending on fullvirt. Understandably there is lots of test fallout.
      
      This will be used to differentiate between a serial vs. virtio console for
      QEMU.
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      6b247552
  26. 15 6月, 2010 1 次提交
    • E
      maint: simplify some ignore files · fb8552f8
      Eric Blake 提交于
      * .hgignore: Delete, no longer used.
      * examples/python/.gitignore: Delete, covered globally.
      * include/.gitignore: Likewise.
      * python/tests/.gitignore: Likewise.
      * docs/schemas/.gitignore: Likewise.
      * tests/xml2sexprdata/.gitignore: Likewise.
      * tests/sexpr2xmldata/.gitignore: Likewise.
      * tests/confdata/.gitignore: Likewise.
      * tests/xencapsdata/.gitignore: Likewise.
      * tests/xmconfigdata/.gitignore: Likewise.
      * tests/xml2sexprdata/.gitignore: Likewise.
      fb8552f8
  27. 28 5月, 2010 1 次提交
  28. 25 2月, 2010 1 次提交
    • J
      build: avoid non-srcdir "make distcheck" failures (srcdir vs wildcard) · 083b901e
      Jim Meyering 提交于
      * tests/xencapsdata/Makefile.am: Use $(wildcard in $(srcdir)-aware manner
      * tests/xmconfigdata/Makefile.am: Likewise.
      * tests/xml2sexprdata/Makefile.am: Likewise.
      * tests/sexpr2xmldata/Makefile.am (EXTRA_DIST): Likewise.
      * Makefile.am (XML_EXAMPLES): Use $(wildcard in $(srcdir)-aware manner.
      083b901e
  29. 05 12月, 2009 1 次提交
  30. 02 9月, 2009 1 次提交
    • D
      Don't blindly reorder disk drives · 2d6adabd
      Daniel P. Berrange 提交于
      Calling qsort() on the disks array causes disk to be
      unneccessarily re-ordered, potentially breaking the
      ability to boot if the boot disk gets moved later in
      the list. The new algorithm will insert a new disk as
      far to the end of the list as possible, while being
      ordered correctly wrt other disks on the same bus.
      
      * src/domain_conf.c, src/domain_conf.h: Remove disk sorting
        routines. Add API to insert a disk into existing list at
        the optimal position, without resorting disks
      * src/libvirt_private.syms: Export virDomainDiskInsert
      * src/xend_internal.c, src/xm_internal.c: Remove calls to
        qsort, use virDomainDiskInsert instead.
      * src/qemu_driver.c: Remove calls to qsort, use virDoaminDiskInsert
        instead. Fix reordering bugs when hotunplugging disks and
        networks. Fix memory leak in disk/net unplug
      2d6adabd
  31. 20 8月, 2009 1 次提交
    • D
      Add test for recently fixed crash with latest XenD · da8b7c9f
      Daniel P. Berrange 提交于
      Test case for the fix applied in
      
        commit 14435163
        Author: Daniel Veillard <veillard@redhat.com>
        Date:   Fri Jun 26 18:14:16 2009 +0000
      
      * tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.sexpr,
        tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml: Data
        files exhibiting the crash
      * tests/sexpr2xmltest.c: Process new data files
      da8b7c9f
  32. 16 7月, 2009 1 次提交
    • J
      remove all trailing blank lines · 07613d20
      Jim Meyering 提交于
      by running this command:
      git ls-files -z | xargs -0 perl -pi -0777 -e 's/\n\n+$/\n/'
      This is in preparation for a more strict make syntax-check
      rule that will detect trailing blank lines.
      07613d20
  33. 08 7月, 2009 1 次提交
  34. 03 4月, 2009 1 次提交
  35. 01 4月, 2009 1 次提交
  36. 30 1月, 2009 1 次提交
  37. 23 1月, 2009 2 次提交
  38. 21 1月, 2009 1 次提交