1. 23 6月, 2011 19 次提交
    • M
      configure: Make libnl optional unless macvtap is required · 20991b93
      Matthias Bolte 提交于
      If macvtap is required then libnl has to be available, otherwise
      libnl is optional.
      20991b93
    • C
      python: Generate virStreamFree but don't expose in bindings · 1b68d3f0
      Cole Robinson 提交于
      Turns out I was right in removing this the first time :) This is
      needed in our custom __del__ function, but the C code wasn't
      being generated. Add new infrastructure to do what we want
      1b68d3f0
    • E
      maint: avoid future setgid problems · a585eba4
      Eric Blake 提交于
      * cfg.mk (sc_prohibit_setuid)
      (exclude_file_name_regexp--sc_prohibit_setuid): New rule.
      (VC_LIST_ALWAYS_EXCLUDE_REGEX): Always exempt po files.
      (exclude_file_name_regexp--sc_prohibit_asprintf): Simplify.
      (exclude_file_name_regexp--sc_prohibit_can_not): Drop.
      (exclude_file_name_regexp--sc_prohibit_doubled_word): Likewise.
      a585eba4
    • M
      docs: Make virConnectClose comply to apibuild.py expectations · 82915370
      Matthias Bolte 提交于
      apibuild.py expects a sentence that starts with "Returns"
      describing the return value of a function.
      82915370
    • O
      util: Fix memory leak in virJSONParserHandleStartMap · 91141474
      Osier Yang 提交于
      91141474
    • O
      qemu: Fix memory leak in qemuProcessWaitForMonitor · d61820df
      Osier Yang 提交于
      Move "VIR_FREE(buf) into label "closelog", so that "buf" could be
      freed before returning.
      d61820df
    • J
      qemu: Only check for NUMA availability if required · 6a15cc6b
      Jiri Denemark 提交于
      We only care about NUMA availability if NUMA configuration is requested
      in domain XML.
      6a15cc6b
    • M
      storage: fix volDelete return when volume still being allocated · 10208cc5
      Matthew Booth 提交于
      volDelete used to return VIR_ERR_INTERNAL_ERROR when attempting to
      delete a volume which was still being allocated. It should return
      VIR_ERR_OPERATION_INVALID.
      
      * src/storage/storage_driver.c: Fix return of volDelete.
      10208cc5
    • E
      util: avoid PATH_MAX-sized array · 60bfd5b5
      Eric Blake 提交于
      See previous patch for why this is good...
      
      * src/util/pci.c (struct _pciDevice, pciGetDevice, pciFreeDevice):
      Manage path dynamically.  Report snprintf overflow.
      * src/util/hostusb.c (struct _usbDevice, usbGetDevice)
      (usbFreeDevice): Likewise.
      60bfd5b5
    • E
      xen: avoid PATH_MAX-sized array · 565c975f
      Eric Blake 提交于
      See previous patch for why this is good...
      
      * src/xen/xen_driver.h (xenXMConfCache): Manage filename
      dynamically.
      * src/xen/xm_internal.c (xenXMConfigCacheAddFile)
      (xenXMConfigFree, xenXMDomainDefineXML): Likewise.
      565c975f
    • E
      tests: avoid PATH_MAX-sized array · ca8b4cec
      Eric Blake 提交于
      See previous patch for why this is good...
      
      * src/test/test_driver.c (struct _testConn, testOpenFromFile)
      (testClose): Manage path dynamically.
      ca8b4cec
    • E
      virStorageVol: avoid PATH_MAX-sized array · aa286e53
      Eric Blake 提交于
      POSIX allows implementations where PATH_MAX is undefined, leading
      to compilation error.  Not to mention that even if it is defined,
      it is often wasteful in relation to the amount of data being stored.
      
      All clients of vol->key were audited, and found not to care about
      whether key is static or dynamic, except for these offenders:
      
      * src/datatypes.h (struct _virStorageVol): Manage key dynamically.
      * src/datatypes.c (virReleaseStorageVol): Free key.
      (virGetStorageVol): Copy key.
      aa286e53
    • E
      maint: add omitted copyright header · 26dc216a
      Eric Blake 提交于
      Bug introduced in commit 6a597883.
      
      * src/util/netlink.h: Add boilerplate.
      26dc216a
    • E
      docs: fix docs to match behavior of virConnectClose · dbcd8c59
      Eric Blake 提交于
      * src/libvirt.c (virConnectClose): Mention reference count return.
      Reported by Michal Novotny, analyzed by Matthias Bolte.
      dbcd8c59
    • S
      cleanup: make several interface functions commonly available · df3d8c36
      Stefan Berger 提交于
      In a second cleanup step this patch makes several interface functions from macvtap.c commonly available by moving them into interface.c and prefixing their names with 'iface'. Those functions taking Linux-specific structures as parameters are only visible on Linux.
      
      ifaceRestoreMacAddress returns the return code from the ifaceSetMacAddr call and display an error message if setting the MAC address did not work. The caller is unchanged and still ignores the return code (which is ok).
      df3d8c36
    • S
      cleanup: make nlComm commonly available · 6a597883
      Stefan Berger 提交于
      In a first cleanup step, make nlComm from macvtap.c commonly available
      for other code to use. Since nlComm uses Linux-specific structures as
      parameters it's prototype is only visible on Linux.
      6a597883
    • E
      maint: remove syntax-check exception · 50a6a126
      Eric Blake 提交于
      We weren't using the @FOO@ notation for a Makefile substitution,
      but instead for a sed rule, so using [@]FOO@ instead avoids the
      need to exempt this syntax check.
      
      * cfg.mk (_makefile_at_at_check_exceptions): Delete.
      * tools/Makefile.am (virt-xml-validate, virt-pki-validate): Avoid
      tripping syntax-check.
      Reported by Daniel P. Berrange.
      50a6a126
    • D
      Fix use-after-free in handling domain taint flags · abb82f53
      Daniel P. Berrange 提交于
      * src/conf/domain_conf.c: Fix use after free
      abb82f53
    • D
      Remove macvtap dependency on domain configuration · caf808c7
      Daniel P. Berrange 提交于
      Files under src/util must not depend on src/conf
      Solve the macvtap problem by moving the definition
      of macvtap modes from domain_conf.h into macvtap.h
      
      * src/util/macvtap.c, src/util/macvtap.h: Add enum
        for macvtap modes
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove
        enum for macvtap modes
      caf808c7
  2. 22 6月, 2011 6 次提交
    • O
      util: Correct the error prompt string · 73b9246d
      Osier Yang 提交于
      virCommandProcessIO: It's reading from stdout or stderr of child,
      but not writing.
      73b9246d
    • O
      qemu: Fix one memory leak · 20d5e9db
      Osier Yang 提交于
      * src/qemu/qemu_domain.c: (qemuDomainAppendLog)
      
        Free "message" in "cleanup".
      20d5e9db
    • D
      Fix to python API extractor and API doc generation · d42ea21a
      Daniel Veillard 提交于
      This fixes a number of issues most of them raised by Eric Blake on the
      generated documentation output:
         - parsing of "long long int" and similar
         - add parsing of unions within a struct
         - remove spurious " * " fron comments on structure fields and enums
         - fix concatenation of base type and name in arrays
         - extend XSLT to cope with union in structs
      
      * docs/apibuild.py: fix and extend API extraction tool
      * docs/newapi.xsl: extend the stylesheets to cope with union in
        public structures
      d42ea21a
    • M
      qemu: domain I/O asynchronous handling · 017abcbb
      Michal Privoznik 提交于
      For virtio disks and interfaces, qemu allows users to enable or disable
      ioeventfd feature. This means, qemu can execute domain code, while
      another thread waits for I/O event. Basically, in some cases it is win,
      in some loss. This feature is available via 'ioeventfd' attribute in disk
      and interface <driver> element. It accepts 'on' and 'off'. Leaving this
      attribute out defaults to hypervisor decision.
      017abcbb
    • E
      build: require newer netcf when it is available · 1486099c
      Eric Blake 提交于
      When building rpms for newer Fedora or RHEL, take advantage of the
      newer netcf packaging to guarantee interface snapshot support.
      
      * libvirt.spec.in (BuildRequires): Bump minimum version on
      platforms that support netcf 0.1.8.
      1486099c
    • E
      virsh: avoid bogus description · 491858bf
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=682121
      
      Gettext reserves the empty string for internal use, and it must
      not be passed through _().  We were violating this for commands
      that (for whatever reason) used "" for their description.
      
      * tools/virsh.c (vshCmddefHelp): Don't translate empty string.
      Reported by Tatsuo Kawasaki.
      491858bf
  3. 21 6月, 2011 15 次提交
    • D
      set and restore MAC address of a NIC when using PASSTHROUGH mode · cbd8227e
      Dirk Herrendoerfer 提交于
      The following patch addresses the problem that when a PASSTHROUGH
      mode DIRECT NIC connection is made the MAC address of the NIC is
      not automatically set and reset to the configured VM MAC and
      back again.
      
      The attached patch fixes this problem by setting and resetting the MAC
      while remembering the previous setting while the VM is running.
      This also works if libvirtd is restarted while the VM is running.
      
      the patch passes make syntax-check
      cbd8227e
    • C
      python: Mark event callback wrappers as private · 7268cb92
      Cole Robinson 提交于
      These functions aren't intended to be called directly by users, so mark
      them as private.
      
      While we're at it, remove unneeded exception handling, and break some
      long lines.
      7268cb92
    • C
      python: events: Fix C->Python handle callback prototype · f2fb235b
      Cole Robinson 提交于
      If registering our own event loop implementation written in python,
      any handles or timeouts callbacks registered by libvirt C code must
      be wrapped in a python function. There is some argument trickery that
      makes this all work, by wrapping the user passed opaque value in
      a tuple, along with the callback function.
      
      Problem is, the current setup requires the user's event loop to know
      about this trickery, rather than just treating the opaque value
      as truly opaque.
      
      Fix this in a backwards compatible manner, and adjust the example
      python event loop to do things the proper way.
      f2fb235b
    • C
      python: Add bindings for virEvent*Handle/Timeout · d0e3f3d6
      Cole Robinson 提交于
      d0e3f3d6
    • C
      events: Correct virEventAddTimeout docs · 27e47955
      Cole Robinson 提交于
      27e47955
    • C
      Promote virEvent*Handle/Timeout to public API · 6094ad7b
      Cole Robinson 提交于
      Since we virEventRegisterDefaultImpl is now a public API, callers need
      a way to invoke the default registered Handle and Timeout functions. We
      already have general functions for these internally, so promote
      them to the public API.
      
      v2:
          Actually add APIs to libvirt.h
      6094ad7b
    • C
      python: Implement virStreamSend/RecvAll helpers · 3b04871e
      Cole Robinson 提交于
      Pure python implementation. The handler callbacks have been altered
      a bit compared to the C API: RecvAll doesn't pass length of the data read
      since that can be trivially obtained from python string objects, and SendAll
      requires the handler to return the string data to send rather than
      store the data in a string pointer.
      3b04871e
    • C
      python: Implement virStreamSend/Recv · ca55dc59
      Cole Robinson 提交于
      The return values for the python version are different that the C version
      of virStreamSend: on success we return a string, an error raises an exception,
      and if the stream would block we return int(-2). We need to do this
      since strings aren't passed by reference in python.
      ca55dc59
    • O
      conf: Make full use of goto label · a22dbe0d
      Osier Yang 提交于
      * virDomainDefParse: There is a goto label "no_memory", which
      reports OOM error, and then fallthrough label "error". This
      patch changes things like following:
      
          virReportOOMError();
          goto error;
      
      into:
      
          goto no_memory;
      a22dbe0d
    • O
      conf: Fix one memory leak · 9a2ac25a
      Osier Yang 提交于
      Free def->numatune.memory.nodemask in virDomainDefFree.
      9a2ac25a
    • C
      python: Implement bindings for virStreamEventAddCallback · b1ede4cf
      Cole Robinson 提交于
      v2:
          Don't generate virStreamFree
      b1ede4cf
    • C
      eb3151b4
    • C
      python: libvirt-override: use simpler debug · e8c8fc14
      Cole Robinson 提交于
      In a couple instances we have to mark a debug variable as ATTRIBUTE_UNUSED
      to avoid warnings.
      
      v2:
          Use #if 0 to comment out debug define
      e8c8fc14
    • E
      virsh: enhance snapshot-create-as · 9256ad84
      Eric Blake 提交于
      Similar to pool-create-as.
      
      * tools/virsh.c (cmdSnapshotCreateAs): Add --print-xml.
      * tools/virsh.pod: Document it.
      9256ad84
    • E
      virsh: add snapshot-create-as command · 1546dcf8
      Eric Blake 提交于
      Producing an xml file just for name and description fields is
      overkill; this makes life easier from virsh.
      
      * tools/virsh.c (cmdSnapshotCreateAs): New command.
      (snapshotCmds): Install it.
      * tools/virsh.pod: Document it.
      1546dcf8