1. 07 5月, 2014 4 次提交
  2. 06 5月, 2014 13 次提交
    • C
      virdbus: Make virDBusCall static · 709f2455
      Cole Robinson 提交于
      709f2455
    • C
      virerror: Fix an error message typo · 3e8699d3
      Cole Robinson 提交于
      3e8699d3
    • D
      LSN-2014-0003: Don't expand entities when parsing XML · d6b27d3e
      Daniel P. Berrange 提交于
      If the XML_PARSE_NOENT flag is passed to libxml2, then any
      entities in the input document will be fully expanded. This
      allows the user to read arbitrary files on the host machine
      by creating an entity pointing to a local file. Removing
      the XML_PARSE_NOENT flag means that any entities are left
      unchanged by the parser, or expanded to "" by the XPath
      APIs.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d6b27d3e
    • L
      qemu: specify domain in host-side PCI addresses when needed/supported · 1e947cf7
      Laine Stump 提交于
      This uses the new QEMU_CAPS_HOST_PCI_MULTIDOMAIN capability when
      present, for -devivce pci-assign, -device vfio-pci, and -pcidevice.
      
      While creating tests for this new functionality, I noticed that the
      xmls for two existing tests had erroneously specified an
      until-now-ignored domain="0x0002", so I corrected those two tests, and
      also added two failure tests to be sure that we alert users who
      attempt to use a non-zero domain with a qemu that doesn't support it.
      1e947cf7
    • L
      qemu: add host-pci-multidomain capability · 17133e37
      Laine Stump 提交于
      Quite a long time ago, (apparently between qemu 0.12 and 0.13) qemu
      quietly began supporting the optional specification of a domain in the
      host-side address of all pci passthrough commands (by simply
      prepending it to the bus:slot.function format, as
      "dddd:bb:ss.f"). Since machines with multiple PCI domains are very
      rare, this never came up in practice, so libvirt was never updated to
      support it.
      
      This patch takes the first step to supporting specification of a non-0
      domain in the host-side address of PCI devices being assigned to a
      domain, by adding a capability bit to indicate support
      "QEMU_CAPS_HOST_PCI_MULTIDOMAIN", and detect it. Since this support
      was added in a version prior to the minimum version required for
      QMP-style capabilities detection, the capability is always enabled for
      any qemu that uses QMP for capabilities detection. For older qemus,
      the only clue that a domain can be specified in the host pci address
      is the presence of the string "[seg:]" in the help string for
      -pcidevice. (Ironically, libvirt will not be modified to support
      specification of domain for -pcidevice, since any qemu new enough for
      us to care about also supports "-device pci-assign" or "-device
      vfio-pci", which are greatly preferred).
      17133e37
    • M
      storageVolCreateXMLFrom: Allow multiple accesses to origvol · eb544266
      Michal Privoznik 提交于
      When creating a new volume, it is possible to copy data into it from
      another already existing volume (referred to as @origvol). Obviously,
      the read-only access to @origvol is required, which is thread safe
      (probably not performance-wise though). However, with current code
      both @newvol and @origvol are marked as building for the time of
      copying data from the @origvol to @newvol. The rationale behind
      is to disallow some operations on both @origvol and @newvol, e.g.
      vol-wipe, vol-delete, vol-download. While it makes sense to not allow
      such operations on partly copied mirror, but it doesn't make sense to
      disallow vol-create or vol-download on the source (@origvol).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      eb544266
    • J
      Fix build wihout macvtap or virtualport · c3f68823
      Ján Tomko 提交于
      Commit 1b14c449 broke the build on FreeBSD by changing
      the signature of a few functions without updating the
      corresponding stubs that are used when WITH_MACVTAP
      or WITH_VIRTUALPORT is not defined.
      c3f68823
    • J
      conf: use typedefs for enums in "src/conf/{network,interface}_conf.h" · 6000705a
      Julio Faracco 提交于
      In "src/conf/" there are many enumeration (enum) declarations.
      Similar to the recent cleanup to "src/util" directory, it's
      better to use a typedef for variable types, function types and
      other usages. Other enumeration and folders will be changed to
      typedef's in the future. Most of the files changed in this commit
      are reltaed to Network (network_conf.* and interface_conf.*) enums.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6000705a
    • J
      conf: use typedefs for enums in "src/conf/cpu_conf.h" · 00ee955d
      Julio Faracco 提交于
      In "src/conf/" there are many enumeration (enum) declarations.
      Similar to the recent cleanup to "src/util" directory, it's
      better to use a typedef for variable types, function types and
      other usages. Other enumeration and folders will be changed to
      typedef's in the future. Most of the files changed in this commit
      are related to CPU (cpu_conf) enums.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      00ee955d
    • J
      util: use typedefs for enums in "src/util/" directory · 1b14c449
      Julio Faracco 提交于
      In "src/util/" there are many enumeration (enum) declarations.
      Sometimes, it's better using a typedef for variable types,
      function types and other usages. Other enumeration will be
      changed to typedef's in the future.
      Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b14c449
    • J
      libxl: support PARAVIRT reboot flag · da744120
      Jim Fehlig 提交于
      Add support for the VIR_DOMAIN_REBOOT_PARAVIRT flag in
      libxlDomainReboot().
      da744120
    • J
      libxl: support PARAVIRT and ACPI shutdown flags · c4fe29f8
      Jim Fehlig 提交于
      Add support for VIR_DOMAIN_SHUTDOWN_PARAVIRT and
      VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN flags in
      libxlDomainShutdownFlags().
      c4fe29f8
    • E
      conf: drop extra storage probe · fff74b27
      Eric Blake 提交于
      All callers of virStorageFileGetMetadataFromBuf were first calling
      virStorageFileProbeFormatFromBuf, to learn what format to pass in.
      But this function is already wired to do the exact same probe if
      the incoming format is VIR_STORAGE_FILE_AUTO, so it's simpler to
      just refactor the probing into the central function.
      
      * src/util/virstoragefile.h (virStorageFileGetMetadataFromBuf):
      Drop parameter.
      (virStorageFileProbeFormatFromBuf): Drop declaration.
      * src/util/virstoragefile.c (virStorageFileGetMetadataFromBuf):
      Do probe here instead of in callers.
      (virStorageFileProbeFormatFromBuf): Make static.
      * src/libvirt_private.syms (virstoragefile.h): Drop function.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Update caller.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fff74b27
  3. 05 5月, 2014 3 次提交
  4. 04 5月, 2014 3 次提交
  5. 02 5月, 2014 6 次提交
    • J
      Restore skipping of setting capacity · f1856eb6
      John Ferlan 提交于
      Commit id 'ac9a0963' refactored out the 'withCapacity' for the
      virStorageBackendUpdateVolInfo() API.  See:
      
      http://www.redhat.com/archives/libvir-list/2014-April/msg00043.html
      
      This resulted in a difference in how 'virsh vol-info --pool <poolName>
      <volume>' or 'virsh vol-list vol-list --pool <poolName> --details' outputs
      the capacity information for a directory pool with a qcow2 sparse file.
      
      For example, using the following XML
      
      mkdir /home/TestPool
      cat testpool.xml
      <pool type='dir'>
        <name>TestPool</name>
        <uuid>6bf80895-10b6-75a6-6059-89fdea2aefb7</uuid>
        <source>
        </source>
        <target>
          <path>/home/TestPool</path>
          <permissions>
            <mode>0755</mode>
            <owner>0</owner>
            <group>0</group>
          </permissions>
        </target>
      </pool>
      
      virsh pool-create testpool.xml
      virsh vol-create-as --pool TestPool temp_vol_1 \
            --capacity 1048576 --allocation 1048576 --format qcow2
      virsh vol-info --pool TestPool temp_vol_1
      
      Results in listing a Capacity value.  Prior to the commit, the value would
      be '1.0 MiB' (1048576 bytes). However, after the commit the output would be
      (for example) '192.50 KiB', which for my system was the size of the volume
      in my file system (eg 'ls -l TestPool/temp_vol_1' results in '197120' bytes
      or 192.50 KiB). While perhaps technically correct, it's not necessarily
      what the user expected (certainly virt-test didn't expect it).
      
      This patch restores the code to not update the target capacity for this path
      f1856eb6
    • J
      fix build with older gcc · 1055852a
      Ján Tomko 提交于
      Older gcc (4.1.2-55.el5, 4.2.1 on FreeBSD) reports bogus warnings:
      ../../src/conf/nwfilter_conf.c:2111: warning: 'protocol' may be used
      uninitialized in this function
      ../../src/conf/nwfilter_conf.c:2110: warning: 'dataProtocolID' may be
      used uninitialized in this function
      
      Initialize them to NULL to make the compiler happy.
      1055852a
    • E
      storage: reject negative indices · 5c05e2b1
      Eric Blake 提交于
      Commit f22b7899 stumbled across a difference between 32-bit and
      64-bit platforms when parsing "-1" as an int.  Now that we've
      fixed that difference, it's time to fix the testsuite.
      
      * src/util/virstoragefile.c (virStorageFileParseChainIndex):
      Require a positive index.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      5c05e2b1
    • E
      util: new stricter unsigned int parsing · 7b045c8c
      Eric Blake 提交于
      strtoul() is required to parse negative numbers as their
      twos-complement positive counterpart.  But sometimes we want
      to reject negative numbers.  Add new functions to do this.
      The 'p' suffix is a mnemonic for 'positive' (technically it
      also parses 0, but 'non-negative' doesn't lend itself to a
      nice one-letter suffix).
      
      * src/util/virstring.h (virStrToLong_uip, virStrToLong_ulp)
      (virStrToLong_ullp): New prototypes.
      * src/util/virstring.c (virStrToLong_uip, virStrToLong_ulp)
      (virStrToLong_ullp): New functions.
      * src/libvirt_private.syms (virstring.h): Export them.
      * tests/virstringtest.c (testStringToLong): Test them.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7b045c8c
    • E
      util: fix uint parsing on 64-bit platforms · f18c02ec
      Eric Blake 提交于
      Commit f22b7899 called to light a long-standing latent bug: the
      behavior of virStrToLong_ui was different on 32-bit platforms
      than on 64-bit platforms.  Curse you, C type promotion and
      narrowing rules, and strtoul specification.  POSIX says that for
      a 32-bit long, strtol handles only 2^32 values [LONG_MIN to
      LONG_MAX] while strtoul handles 2^33 - 1 values [-ULONG_MAX to
      ULONG_MAX] with twos-complement wraparound for negatives.  Thus,
      parsing -1 as unsigned long produces ULONG_MAX, rather than a
      range error.  We WANT[1] this same shortcut for turning -1 into
      UINT_MAX when parsing to int; and get it for free with 32-bit
      long.  But with 64-bit long, ULONG_MAX is outside the range
      of int and we were rejecting it as invalid; meanwhile, we were
      silently treating -18446744073709551615 as 1 even though it
      textually exceeds INT_MIN.  Too bad there's not a strtoui() in
      libc that does guaranteed parsing to int, regardless of the size
      of long.
      
      The bug has been latent since 2007, introduced by Jim Meyering
      in commit 5d254191 in the attempt to eradicate unsafe use of
      strto[u]l when parsing ints and longs.  How embarrassing that we
      are only discovering it now - so I'm adding a testsuite to ensure
      that it covers all the corner cases we care about.
      
      [1] Ideally, we really want the caller to be able to choose whether
      to allow negative numbers to wrap around to their 2s-complement
      counterpart, as in strtoul, or to force a stricter input range
      of [0 to UINT_MAX] by rejecting negative signs; this will be added
      in a later patch for all three int types.
      
      This patch is tested on both 32- and 64-bit; the enhanced
      virstringtest passes on both platforms, while virstoragetest now
      reliably fails on both platforms instead of just 32-bit platforms.
      That test will be fixed later.
      
      * src/util/virstring.c (virStrToLong_ui): Ensure same behavior
      regardless of platform long size.
      * tests/virstringtest.c (testStringToLong): New function.
      (mymain): Comprehensively test string to long parsing.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f18c02ec
    • D
      Misc error reporting bugs in QEMU cli builder · dca027a9
      Daniel P. Berrange 提交于
      A couple of places in the QEMU XML -> ARGV conversion code
      raised an error but then forgot to return an error status
      due to missing gotos. While fixing this also tweak style
      of a couple of other error reports
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      dca027a9
  6. 01 5月, 2014 4 次提交
  7. 30 4月, 2014 4 次提交
  8. 29 4月, 2014 3 次提交