1. 02 9月, 2009 6 次提交
    • M
      Secret manipulation API docs refresh & wire up python generator · 9dc3b993
      Miloslav Trmač 提交于
      Sample session:
      
      >>> import libvirt
      >>> c = libvirt.open('qemu:///session')
      
      >>> c.listSecrets()
      ['12247729-47d2-a783-88ce-b329d4781cd3', 'reee', 'abc']
      
      >>> s = c.secretDefineXML("<secret ephemeral='no' private='no'>\n<description>Something for use</description>\n<volume>/foo/bar</volume>\n</secret>\n")
      
      >>> s.UUIDString()
      '340c2dfb-811b-eda8-da9e-25ccd7bfd650'
      
      >>> s.XMLDesc()
      "<secret ephemeral='no' private='no'>\n  <uuid>340c2dfb-811b-eda8-da9e-25ccd7bfd650</uuid>\n  <description>Something for use</description>\n  <volume>/foo/bar</volume>\n</secret>\n"
      
      >>> s.setValue('abc\0xx\xffx')
      0
      
      >>> s.value()
      'abc\x00xx\xffx'
      
      >>> s.undefine()
      0
      
      * python/generator.py: Add rules for virSecret APIs
      * python/libvir.c, python/libvirt-python-api.xml: Manual impl of
        virSecretSetValue, virSecretGetValue$ and virConnectListSecrets APIs
      * python/libvirt_wrap.h, python/types.c: Wrapper for virSecret objects
      * docs/libvirt-api.xml, docs/libvirt-refs.xml,
        docs/html/libvirt-virterror.html, docs/html/libvirt-libvirt.html,
        docs/devhelp/libvirt-virterror.html, docs/devhelp/libvirt-libvirt.html:
        Re-generate with 'make api'
      9dc3b993
    • M
      Secret manipulation remote client · f68c91fa
      Miloslav Trmač 提交于
      * src/remote_internal.c: Implement client binding for new secrets
        APIs
      * src/datatypes.h: Add 'void *secretPrivateData' to virConnectPtr
        struct
      f68c91fa
    • M
      Secret manipulation libvirtd wire protocol & remote dispatcher · 0de63c67
      Miloslav Trmač 提交于
      * qemud/remote_protocol.x: Define wire protocol for secrets public
        APIs
      * qemud/remote_protocol.h, qemud/remote_protocol.c,
        qemud/remote_dispatch_table.h, qemud/remote_dispatch_ret.h,
        qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_args.h:
        Re-generate from updated protocol definition
      * qemud/remote.c: Implement RPC dispatchers for new secrets APIs
      0de63c67
    • M
      Secret manipulation public API implementation · b35f0131
      Miloslav Trmač 提交于
      * include/libvirt/virterror.h, src/virterror.c: Add VIR_ERR_INVALID_SECRET
        and VIR_FROM_SECRET
      * src/libvirt.c: Define stubs for every new public API
      b35f0131
    • M
      Secret manipulation internal API · eb42e0ab
      Miloslav Trmač 提交于
      * include/libvirt/virterror.h, src/virterror.c: Add VIR_WAR_NO_SECRET
      * src/libvirt_private.syms, src/datatypes.h, src/datatypes.c: Type
        virSecret struct definition and helper APIs
      * src/driver.h: Sub-driver API definitions for secrets
      * src/libvirt.c: Define new sub-driver for secrets
      eb42e0ab
    • M
      Secret manipulation public API · 6acc17af
      Miloslav Trmač 提交于
      This patch adds a "secret" as a separately managed object, using a
      special-purpose API to transfer the secret values between nodes and
      libvirt users.
      
      * docs/schemas/secret.rng, docs/schemas/Makefilem.am: Add new
        schema for virSecret objects
      * docs/*html: Re-generated
      * docs/formatsecret.html.in, docs/sitemap.html.in: Add page
        describing the virSecret XML schema
      * include/libvirt/libvirt.h.in: Define the new virSecret public
        API
      * src/libvirt_public.syms: Export symbols for new public APIs
      * mingw32-libvirt.spec.in, libvirt.spec.in: Add secret.rng to
        files list
      6acc17af
  2. 01 9月, 2009 5 次提交
  3. 30 8月, 2009 1 次提交
    • J
      Fix sexpr2string() to handle empty list. · 8fd7eee9
      Jim Fehlig 提交于
      S-expression containing empty lists, e.g. (cpus (() () () ())),
      was not being handled properly in sexpr2string() serialization.
      Emit an empty list when encountering NIL sexpr kind.
      8fd7eee9
  4. 28 8月, 2009 2 次提交
  5. 26 8月, 2009 1 次提交
  6. 25 8月, 2009 1 次提交
    • D
      Support new PolicyKit 1.0 API · 8e06c8b3
      Daniel P. Berrange 提交于
      * configure.in: Check for pkcheck which indicates new policykit
      * qemud/Makefile.am: Install different versions of policy
      * qemud/libvirtd.policy: Rename to libvirtd.policy-0
      * qemud/libvirtd.policy-1: new style policy
      * qemud/qemud.c, qemud/qemud.h, qemud/remote.c: Support new
        policykit API via external pkcheck helper
      * src/remote_internal.c: Don't prompt for polkit auth with new
        policykit API
      * libvirt.spec.in: deal with new policy install locations & deps
      8e06c8b3
  7. 21 8月, 2009 2 次提交
  8. 20 8月, 2009 5 次提交
    • M
      Fix phypOpen() escape_specialcharacters · 40d46934
      Mattias Bolte 提交于
      Matthias correctly points out that escape_specialcharaters() takes a
      length, and since we are now malloc()'ing string in phypOpen instead of
      making it a static array, we can't use sizeof(string) anymore.  Calculate
      the proper strlen and then use that both to allocate the string and also
      pass it to escape_specialcharacters().
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      40d46934
    • M
      Power Hypervisor: fix potential segfault · 1aa16833
      Mattias Bolte 提交于
      I came across this line in the phypOpen function:
      
      char string[strlen(conn->uri->path)];
      
      Here the path part of the given URI is used without checking it for
      NULL, this can cause a segfault as strlen expects a string != NULL.
      Beside that uuid_db and connection_data leak in case of an error.
      
      In this line
      
      conn->uri->path = string;
      
      the original path of the URI leaks. The patch adds a VIR_FREE call
      before setting the new path.
      
      The attached patch is compile-tested but I don't have a Power
      Hypervisor installation at hand to test it for real.
      
      Matthias
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      1aa16833
    • C
      Small fixes for qemu save compression. · 2e7c8b0b
      Chris Lalancette 提交于
      Fix up a small memory leak pointed out by DanB; I was forgetting
      to release memory allocated to driver->saveImageFormat.
      Also add the "save_image_format" and "security" entries to
      the augeas lens.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2e7c8b0b
    • 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
    • D
      14194f1d
  9. 19 8月, 2009 1 次提交
  10. 18 8月, 2009 13 次提交
    • M
      Fix bridge/tap system error reporting · 3ec80d01
      Mark McLoughlin 提交于
      * src/qemu_conf.c, src/uml_conf.c: use virReportSystemError() to report
        system errors
      3ec80d01
    • M
      Don't expose 'vnet%d' to the user · 2b1f67d4
      Mark McLoughlin 提交于
      https://bugzilla.redhat.com/517371
      
      Matt Booth points out that if you use a non-existent bridge name when
      start a guest you get a weird error message:
      
        Failed to add tap interface 'vnet%d' to bridge 'virbr0'
      
      and dev='vnet%d' appears in the dumpxml output.
      
      Fix that by not including 'vnet%d' in the error message and freeing the
      'vnet%d' string if adding the tap device to the bridge fails.
      
      * src/qemu_conf.c, src/uml_conf.c: fix qemudNetworkIfaceConnect()
        and umlConnectTapDevice() to not expose 'vnet%d' to the user
      2b1f67d4
    • M
      Maintain a list of active PCI hostdevs and use it in pciResetDevice() · e8ad3393
      Mark McLoughlin 提交于
      As we start/shutdown guests, or hotplug/hot-unplug devices, we can add
      or delete devices as appropriate from a list of active devices.
      
      Then, in pciReset(), we can use this to determine whether its safe to
      reset a device as a side effect of resetting another device.
      
      * src/qemu_conf.h: add activePciHostdevs to qemud_driver
      
      * src/qemu_driver.c: maintain the activePciHostdevs list, and pass it
        to pciResetDevice()
      
      * src/pci.[ch]: pass the activeDevs list to pciResetDevice() and use
        it to determine whether a Secondary Bus Reset is safe
      e8ad3393
    • M
      Simplify PCI hostdev prepare/re-attach using a pciDeviceList type · 78675b22
      Mark McLoughlin 提交于
      The qemuPrepareHostDevices() and qemuDomainReAttachHostDevices()
      functions are clutter with a bunch of calls to pciGetDevice() and
      pciFreeDevice() obscuring the basic logic.
      
      Add a pciDeviceList type and add a qemuGetPciHostDeviceList() function
      to build a list from a domain definition. Use this in prepare/re-attach
      fto simplify things and eliminate the multiple pciGetDevice calls.
      
      This is especially useful because in the next patch we need to iterate
      the hostdevs list a third time and we also need a list type for keeping
      track of active devices.
      
      * src/pci.[ch]: add pciDeviceList type and also a per-device 'managed'
        property
      
      * src/libvirt_private.syms: export the new functions
      
      * src/qemu_driver.c: add qemuGetPciHostDeviceList() and re-write
        qemuPrepareHostDevices() and qemuDomainReAttachHostDevices() to use it
      78675b22
    • M
      Use pci_addr=auto with QEMU's pci_add monitor command · 60ff0758
      Mark McLoughlin 提交于
      Newer versions of QEMU accept 'pci_add auto', but older versions require
      'pci_add pci_addr=auto'
      
      * src/qemu_driver.c: use pci_addr= in qemudDomainAttachHostPciDevice()
        for older versions of QEMU
      60ff0758
    • M
      Fix thinko in PCI hostdev detach · 457e0506
      Mark McLoughlin 提交于
      * src/qemu_driver.c: Add missing break statement in
        qemudDomainDetachHostDevice()
      457e0506
    • M
      Reset PCI host devices after hot-unplug · 12edef9a
      Mark McLoughlin 提交于
      When we hot-unplug a PCI host device from a guest, we should reset it.
      
      Both managed and unmanaged devices should be reset, but only managed
      devices should be re-attached.
      
      * src/qemu_driver.c: reset devices in qemudDomainDetachHostPciDevice()
      12edef9a
    • M
      Reset unmanaged PCI host devices before hotplug · 4dbecff9
      Mark McLoughlin 提交于
      Right now we're only resetting managed devices before hotplug, but we
      should reset them irrespective of whether they are managed.
      
      * src/qemu_driver.c: reset all PCI hostdevs before hotplug
      4dbecff9
    • M
      Revert changes to allow pciResetDevice() reset multiple devices · 4954e079
      Mark McLoughlin 提交于
      It turns out that the previous attempt at this doesn't work well
      in the case of hotplug. We need qemuCheckPciHostDevice() to
      disallow the reset affecting devices already attach to the guest,
      but we still need to avoid double locking the virDomainObjPtr.
      
      This is all getting messy, I've a better idea.
      
      This reverts commit 63188082 and
      c106c8a1.
      
      * src/qemu_driver.c, src/pci.[ch], src/xen_unified.c,
        src/libvirt_private.syms: revert a bunch of stuff.
      4954e079
    • M
      Fix list updating after disk/network/hostdev hot-unplug · 0b973381
      Mark McLoughlin 提交于
      The current code makes a poor effort at updating the device arrays after
      hot-unplug. Fix that and combine the two code paths into one.
      
      * src/qemu_driver.c: fix list updating in qemudDomainDetachNetDevice(),
        qemudDomainDetachPciDiskDevice() and qemudDomainDetachHostPciDevice()
      0b973381
    • M
      Re-name remote_internal.c:driver to remote_driver · 331e1fcb
      Mark McLoughlin 提交于
      Confused me when poking at another 'driver' variable in gdb which gcc
      had optimized away
      
      * src/remote_internal.c: rename driver to remote_driver
      331e1fcb
    • M
      Cosmetic change to 'virsh nodedev-list --tree' output · 097c818b
      Mark McLoughlin 提交于
      Maybe it's just me, but I try to select an item from the tree using
      double-click and get annoyed when "+-" gets included in the selection.
      
      * src/virsh.c: add a space between "+-" and the node device name
        in 'virsh nodedev-list --tree'
      097c818b
    • C
      Fix up connection reference counting. · cb51aa48
      Chris Lalancette 提交于
      Currently the reference counting for connections is busted.  I
      first noticed it while trying to use virConnectRef; it would
      eventually cause a crash in the remote_internal driver, although
      that was really just a victim.  Really, we should only call the
      close callbacks on the methods when the references drop to 0.  To
      accomplish this, move all of the close callbacks into
      virUnrefConnect (since there are lots of internal users of that
      function), and arrange for virConnectClose to call that.
      
      V2: Make sure to drop the connection lock before we call the close
          callbacks, otherwise we could deadlock the daemon
      V3: Fix up a crash when we got an error from one of the drivers
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      cb51aa48
  11. 17 8月, 2009 2 次提交
    • D
      Fix LXC driver crash when kernel doesn't support clone · e403f8d4
      Daniel P. Berrange 提交于
      * src/domain_conf.c: Make virDomainObjListFree a no-op if list
        is NULL
      * src/domain_event.c: make virDomainEventCallbackListFree a no-op
        if event list is NULL
      * src/lxc_driver.c: Log a message if LXC driver does not startup
        due to lacking kernel support
      e403f8d4
    • C
      Compressed save image format for Qemu. · 2d6a5819
      Chris Lalancette 提交于
      Implement a compressed save image format for qemu.  While ideally
      we would have the choice between compressed/non-compressed
      available to the libvirt API, unfortunately there is no "flags"
      parameter to the virDomainSave() API.  Therefore, implement this
      as a qemu.conf option.  gzip, bzip2, and lzma are implemented, and
      it should be very easy to implement additional compression
      methods.
      
      One open question is if/how we should detect the compression
      binaries.  One way to do it is to do compile-time setting of the
      paths (via configure.in), but that doesn't seem like a great thing
      to do.  My preferred solution is not to detect at all;
      when we go to run the commands that need them, if they
      aren't available, or aren't available in one of the standard paths,
      then we'll fail.  That's also the solution implemented in this patch.
      
      In the future, we'll have a more robust (managed) save/restore API,
      at which time we can expose this functionality properly in the API.
      
      V2: get rid of redundant dd command and just use >> to append data.
      V3: Add back the missing pieces for the enum and bumping the save version.
      V4: Make the compressed field in the save_header an int.
          Implement LZMA compression.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2d6a5819
  12. 14 8月, 2009 1 次提交