1. 05 4月, 2013 10 次提交
    • P
      virCaps: get rid of defaultConsoleTargetType callback · 482e5f15
      Peter Krempa 提交于
      This patch refactors various places to allow removing of the
      defaultConsoleTargetType callback from the virCaps structure.
      
      A new console character device target type is introduced -
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE - to mark that no type was
      specified in the XML. This type is at the end converted to the standard
      VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL. Other types that are
      different from this default have to be processed separately in the
      device post parse callback.
      482e5f15
    • P
      virCaps: get rid of macPrefix field · 46becc18
      Peter Krempa 提交于
      Use the virDomainXMLConf structure to hold this data and tweak the code
      to avoid semantic change.
      
      Without configuration the KVM mac prefix is used by default. I chose it
      as it's in the privately administered segment so it should be usable for
      any purposes.
      46becc18
    • P
      virCaps: get rid of hasWideScsiBus · 8960d656
      Peter Krempa 提交于
      Use the virDomainXMLConf structure to hold this data.
      8960d656
    • P
      virCaps: get rid of defaultDiskDriverType · b2990849
      Peter Krempa 提交于
      Use the qemu specific callback to fill this data in the qemu driver as
      it's the only place where it was used and fix tests as the qemu test
      capability object didn't configure the defaults for the tests.
      b2990849
    • P
      virCaps: get rid of emulatorRequired · b5def001
      Peter Krempa 提交于
      This patch removes the emulatorRequired field and associated
      infrastructure from the virCaps object. Instead the driver specific
      callbacks are used as this field isn't enforced by all drivers.
      
      This patch implements the appropriate callbacks in the qemu and lxc
      driver and moves to check to that location.
      b5def001
    • P
      virCaps: get rid of defaultDiskDriverName · 9ea249e7
      Peter Krempa 提交于
      This patch removes the defaultDiskDriverName from the virCaps
      structure. This particular default value is used only in the qemu driver
      so this patch uses the recently added callback to fill the driver name
      if it's needed instead of propagating it through virCaps.
      9ea249e7
    • P
      virCaps: get rid of "defaultInitPath" value in the virCaps struct · 4750c848
      Peter Krempa 提交于
      This gets rid of the parameter in favor of using the new callback
      infrastructure to do the same stuff.
      
      This patch implements the domain adjustment callback in the openVZ
      driver and moves the check from the parser to a new validation method in
      the callback infrastructure.
      4750c848
    • P
      conf callback: Rearrange function parameters · ad0d10b2
      Peter Krempa 提交于
      Move the xmlopt and caps arguments to the end of the argument list.
      ad0d10b2
    • P
      conf: Add post XML parse callbacks and prepare for cleaning of virCaps · 43b99fc4
      Peter Krempa 提交于
      This patch adds instrumentation that will allow hypervisor drivers to
      fill and validate domain and device definitions after parsed by the XML
      parser.
      
      With this patch, after the XML is parsed, a callback to the driver is
      issued requesting to fill and validate driver specific details of the
      configuration. This allows to use sensible defaults and checks on a per
      driver basis at the time the XML is parsed.
      
      Two callback pointers are stored in the new virDomainXMLConf object:
      * virDomainDeviceDefPostParseCallback (devicesPostParseCallback)
        - called for a single device parsed and for every single device in a
          domain config. A virDomainDeviceDefPtr is passed along with the
          domain definition and virCaps.
      
      * virDomainDefPostParseCallback, (domainPostParseCallback)
        - A callback that is meant to process the domain config after it's
        parsed.  A virDomainDefPtr is passed along with virCaps.
      
      Both types of callbacks support arbitrary opaque data passed for the
      callback functions.
      
      Errors may be reported in those callbacks resulting in a XML parsing
      failure.
      43b99fc4
    • P
      maint: Rename xmlconf to xmlopt and virDomainXMLConfig to virDomainXMLOption · e84b1931
      Peter Krempa 提交于
      This patch is the result of running:
      
      for i in $(git ls-files | grep -v html | grep -v \.po$ ); do
        sed -i -e "s/virDomainXMLConf/virDomainXMLOption/g" -e "s/xmlconf/xmlopt/g" $i
      done
      
      and a few manual tweaks.
      e84b1931
  2. 02 4月, 2013 2 次提交
  3. 28 3月, 2013 1 次提交
  4. 27 3月, 2013 1 次提交
    • G
      conf: fix a failure when detaching a usb device · a950f03e
      Guannan Ren 提交于
       #virsh detach-device $guest usb.xml
       error: Failed to detach device from usb2.xml
       error: operation failed: host usb device vendor=0x0951 \
       product=0x1625 not found
      
      This regresstion is due to a typo in matching function. The first
      argument is always the usb device that we are checking for. If the
      usb xml file provided by user contains bus and device info, we try
      to search it by them, otherwise, we use vendor and product info.
      
      The bug occurred only when detaching a usb device with no bus and
      device info provided in the usb xml file.
      a950f03e
  5. 23 3月, 2013 1 次提交
  6. 22 3月, 2013 3 次提交
  7. 21 3月, 2013 1 次提交
  8. 20 3月, 2013 2 次提交
  9. 14 3月, 2013 2 次提交
    • P
      virtio-rng: Add rate limiting options for virtio-RNG · 32bd699f
      Peter Krempa 提交于
      Qemu's implementation of virtio RNG supports rate limiting of the
      entropy used. This patch exposes the option to tune this functionality.
      
      This patch is based on qemu commit 904d6f588063fb5ad2b61998acdf1e73fb4
      
      The rate limiting is exported in the XML as:
      <devices>
        ...
        <rng model='virtio'>
          <rate bytes='123' period='1234'/>
          <backend model='random'/>
        </rng>
        ...
      32bd699f
    • V
      S390: domain_conf support for CCW · e50a1bae
      Viktor Mihajlovski 提交于
      Add necessary handling code for the new s390 CCW address type to
      virDomainDeviceInfo. Further, introduce  memory management, XML
      parsing, output formatting and range validation for the new
      virDomainDeviceCCWAddress type.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      e50a1bae
  10. 13 3月, 2013 1 次提交
    • P
      virCaps: conf: start splitting out irrelevat data · 27cf98e2
      Peter Krempa 提交于
      The virCaps structure gathered a ton of irrelevant data over time that.
      The original reason is that it was propagated to the XML parser
      functions.
      
      This patch aims to create a new data structure virDomainXMLConf that
      will contain immutable data that are used by the XML parser. This will
      allow two things we need:
      
      1) Get rid of the stuff from virCaps
      
      2) Allow us to add callbacks to check and add driver specific stuff
      after domain XML is parsed.
      
      This first attempt removes pointers to private data allocation functions
      to this new structure and update all callers and function that require
      them.
      27cf98e2
  11. 07 3月, 2013 2 次提交
    • D
      Fix crash parsing RNG device specification · 75e656a3
      Daniel P. Berrange 提交于
      Code that validates the whitelist for the RNG device filename
      didn't account for fact that filename may be NULL. This led
      to a NULL reference crash. This wasn't caught since the test
      suite was not covering this XML syntax
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      75e656a3
    • J
      Resolve valgrind error · 1cf4ef1f
      John Ferlan 提交于
      Resolves the following valgrind error from qemuxml2argvtest:
      
      ==20393== 5 bytes in 1 blocks are definitely lost in loss record 2 of 60
      ==20393==    at 0x4A0883C: malloc (vg_replace_malloc.c:270)
      ==20393==    by 0x38D690A167: __vasprintf_chk (in /usr/lib64/libc-2.16.so)
      ==20393==    by 0x4CB0D97: virVasprintf (stdio2.h:210)
      ==20393==    by 0x4CB0E53: virAsprintf (virutil.c:2017)
      ==20393==    by 0x428DC5: qemuAssignDeviceAliases (qemu_command.c:791)
      ==20393==    by 0x41DF93: testCompareXMLToArgvHelper (qemuxml2argvtest.c:151)
      ==20393==    by 0x41F53F: virtTestRun (testutils.c:157)
      ==20393==    by 0x41DA9B: mymain (qemuxml2argvtest.c:885)
      ==20393==    by 0x41FB7A: virtTestMain (testutils.c:719)
      ==20393==    by 0x38D6821A04: (below main) (in /usr/lib64/libc-2.16.so)
      ==20393==
      
      From qemu_command.c/line 791:
      
          if (def->rng) {
              if (virAsprintf(&def->rng->info.alias, "rng%d", 0) < 0)
                  goto no_memory;
          }
      1cf4ef1f
  12. 05 3月, 2013 4 次提交
    • P
      conf: Report errors on cputune parameter parsing · 7fc4864a
      Peter Krempa 提交于
      This patch adds proper error reporting if parsing of cputune parameters
      fails due to incorrect values provided by the user. Previously no errors
      were reported in such a case and the failure was silently ignored.
      7fc4864a
    • P
      conf: Make virDomainDeviceInfoIterate usable without os type · 5d9169e4
      Peter Krempa 提交于
      Make the iterator function usable in the next patches. Also refactor
      some parts to avoid strcmp if not necessary.
      
      This commit tweaks and shadows the change that was done in commit
      babe7dad and was needed after the
      support for multiple console devices was added. Historically the first
      <console> element is alias for the <serial> device.
      5d9169e4
    • P
      conf: whitespace cleanups and refactors with no semantic impact · bb98ba5d
      Peter Krempa 提交于
      This patch changes many unrelated places to simplify the code or update
      code style. This patch should not have any semantic impact on the code.
      bb98ba5d
    • E
      rng: restrict passthrough names to known-good files · 4932ef45
      Eric Blake 提交于
      There is some controversy[1] on the qemu list on whether qemu should
      have ever allowed arbitrary file name passthrough, or whether it
      should be restricted to JUST /dev/random and /dev/hwrng.  It is
      always easier to add support for additional filenames than it is
      to remove support for something once released, so this patch
      restricts libvirt 1.0.3 (where the virtio-random backend was first
      supported) to just the two uncontroversial names, letting us defer
      to a later date any decision on whether supporting arbitrary files
      makes sense. Additionally, since qemu 1.4 does NOT support
      /dev/fdset/nnn fd passthrough for the backend, limiting to just
      two known names means that we don't get tempted to try fd
      passthrough where it won't work.
      
      [1]https://lists.gnu.org/archive/html/qemu-devel/2013-03/threads.html#00023
      
      * src/conf/domain_conf.c (virDomainRNGDefParseXML): Only allow
      /dev/random and /dev/hwrng.
      * docs/schemas/domaincommon.rng: Flag invalid files.
      * docs/formatdomain.html.in (elementsRng): Document this.
      * tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args:
      Update test to match.
      * tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml:
      Likewise.
      4932ef45
  13. 27 2月, 2013 1 次提交
  14. 26 2月, 2013 1 次提交
  15. 25 2月, 2013 3 次提交
  16. 22 2月, 2013 2 次提交
  17. 21 2月, 2013 3 次提交