1. 20 1月, 2012 3 次提交
    • E
      lxc: use live/config helper · 9c377576
      Eric Blake 提交于
      Based on qemu changes made in commits ae523427 and 659ded58.
      
      * src/lxc/lxc_driver.c (lxcSetSchedulerParametersFlags)
      (lxcGetSchedulerParametersFlags, lxcDomainSetBlkioParameters)
      (lxcDomainGetBlkioParameters): Use helpers.
      (lxcDomainSetBlkioParameters): Allow setting live and config at
      once.
      9c377576
    • E
      build: silence some compiler warnings from gnulib · d940e3bd
      Eric Blake 提交于
      Gnulib claims that there are some classes of warnings that are
      worth enabling during development, but where silencing those
      warnings causes code bloat that is not necessary in an optimized
      build.  The code bloat to silence the warnings is only enabled
      by -Dlint.  Follow the lead of coreutils in setting up -Dlint
      whenever full warnings are requested.
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Add
      -Dlint, and move _FORTIFY_SOURCE to config.h instead of CFLAGS.
      d940e3bd
    • E
      threads: check for failure to set thread-local value · 927cfaf4
      Eric Blake 提交于
      We had a memory leak on a very arcane OOM situation (unlikely to ever
      hit in practice, but who knows if libvirt.so would ever be linked
      into some other program that exhausts all thread-local storage keys?).
      I found it by code inspection, while analyzing a valgrind report
      generated by Alex Jia.
      
      * src/util/threads.h (virThreadLocalSet): Alter signature.
      * src/util/threads-pthread.c (virThreadHelper): Reduce allocation
      lifetime.
      (virThreadLocalSet): Detect failure.
      * src/util/threads-win32.c (virThreadLocalSet): Likewise.
      (virCondWait): Fix caller.
      * src/util/virterror.c (virLastErrorObject): Likewise.
      927cfaf4
  2. 19 1月, 2012 6 次提交
  3. 18 1月, 2012 10 次提交
    • D
      Fix startup of LXC containers with filesystems containing symlinks · c53ba61b
      Daniel P. Berrange 提交于
      Given an LXC guest with a root filesystem path of
      
        /export/lxc/roots/helloworld/root
      
      During startup, we will pivot the root filesystem to end up
      at
      
        /.oldroot/export/lxc/roots/helloworld/root
      
      We then try to open
      
        /.oldroot/export/lxc/roots/helloworld/root/dev/pts
      
      Now consider if '/export/lxc' is an absolute symlink pointing
      to '/media/lxc'. The kernel will try to open
      
        /media/lxc/roots/helloworld/root/dev/pts
      
      whereas it should be trying to open
      
        /.oldroot//media/lxc/roots/helloworld/root/dev/pts
      
      To deal with the fact that the root filesystem can be moved,
      we need to resolve symlinks in *any* part of the filesystem
      source path.
      
      * src/libvirt_private.syms, src/util/util.c,
        src/util/util.h: Add virFileResolveAllLinks to resolve
        all symlinks in a path
      * src/lxc/lxc_container.c: Resolve all symlinks in filesystem
        paths during startup
      c53ba61b
    • O
      qemu: Prohibit reattaching node device if it is in use · 7aeb9794
      Osier Yang 提交于
      It doesn't make sense to reattach a device to host while it's
      still in use, e.g, by a domain.
      7aeb9794
    • O
      qemu: Introduce inactive PCI device list · 6be610bf
      Osier Yang 提交于
      pciTrySecondaryBusReset checks if there is active device on the
      same bus, however, qemu driver doesn't maintain an effective
      list for the inactive devices, and it passes meaningless argument
      for parameter "inactiveDevs". e.g. (qemuPrepareHostdevPCIDevices)
      
      if (!(pcidevs = qemuGetPciHostDeviceList(hostdevs, nhostdevs)))
          return -1;
      
      ..skipped...
      
      if (pciResetDevice(dev, driver->activePciHostdevs, pcidevs) < 0)
          goto reattachdevs;
      
      NB, the "pcidevs" used above are extracted from domain def, and
      thus one won't be able to attach a device of which bus has other
      device even detached from host (nodedev-detach). To see more
      details of the problem:
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=773667
      
      This patch is to resolve the problem by introducing an inactive
      PCI device list (just like qemu_driver->activePciHostdevs), and
      the whole logic is:
      
        * Add the device to inactive list during nodedev-dettach
        * Remove the device from inactive list during nodedev-reattach
        * Remove the device from inactive list during attach-device
          (for non-managed device)
        * Add the device to inactive list after detach-device, only
          if the device is not managed
      
      With the above, we have a sufficient inactive PCI device list, and thus
      we can use it for pciResetDevice. e.g.(qemuPrepareHostdevPCIDevices)
      
      if (pciResetDevice(dev, driver->activePciHostdevs,
                         driver->inactivePciHostdevs) < 0)
          goto reattachdevs;
      6be610bf
    • M
      Permission change for systemtap examples. · a0671075
      Martin Kletzander 提交于
      Execute bit on *.stp files in examples/systemtap/ caused dependency when
      building RPM packages. Disabling execute permission should help the auto
      dependency resolver to see that systemtap is not needed.
      a0671075
    • D
      Add new attribute wrpolicy to <driver> element · d9e0d820
      Deepak C Shetty 提交于
      This introduces new attribute wrpolicy with only supported
      value as immediate. This will be an optional
      attribute with no defaults. This helps specify whether
      to skip the host page cache.
      
      When wrpolicy is specified, meaning when wrpolicy=immediate
      a writeback is explicitly initiated for the dirty pages in
      the host page cache as part of the guest file write operation.
      
      Usage:
      <filesystem type='mount' accessmode='passthrough'>
        <driver type='path' wrpolicy='immediate'/>
        <source dir='/export/to/guest'/>
        <target dir='mount_tag'/>
      </filesystem>
      
      Currently this only works with type='mount' for the QEMU/KVM driver.
      Signed-off-by: NDeepak C Shetty <deepakcs@linux.vnet.ibm.com>
      d9e0d820
    • J
      qemu: Don't break domain with 0:0:2.0 assigned to anything but VGA · 9619d8a6
      Jiri Denemark 提交于
      In the past we didn't reserve 0:0:2.0 PCI address if there was no video
      device assigned to a domain, which made it impossible to add a video
      device later on. So we fixed it (commit v0.9.0-37-g7b2cac12) by always
      reserving that address. However, that breaks existing domains without
      video devices that already have another device assigned to the
      problematic address.
      
      This patch reserves address 0:0:2.0 only in case it was not explicitly
      assigned to another device, which means libvirt will try to keep this
      address free and will not automatically assign it new devices. But
      existing domains for which older libvirt already assigned the address to
      a non-video device will keep working as they used to work before 0.9.1.
      Moreover, users who want to create a domain without a video device and
      use its address for another device may do so by explicitly configuring
      the PCI address in domain XML.
      9619d8a6
    • E
      tests: avoid dirname in tests · dccf45f3
      Eric Blake 提交于
      qemuxml2argvtest sanitizes PATH to just /bin, but on at least
      Fedora 16, dirname lives in /usr/bin instead.  Regression
      introduced in commit e7201afd.
      
      * tests/qemuxml2argvdata/qemu.sh: Avoid forking a dirname call,
      since dirname might not be in PATH after test sanitization.
      * tests/qemuxml2argvdata/qemu-supported-cpus.sh: Likewise.
      Diagnosed by Michal Privoznik.
      dccf45f3
    • M
      Fixed dumpxml of <iotune> parameters · e1eb9347
      Martin Kletzander 提交于
      The output of dumpxml for <iotune> settings was misformatted, this
      patch just adds missing newlines.
      e1eb9347
    • S
      nwfilter: fix typing error in filter · af5594c8
      Stefan Berger 提交于
      Fix a typing error in the no-ip-spoofing filter.
      Return DHCP request packets passing through this filter. Have
      the user use another filter to actually allow DHCP requests to be
      sent (action='accept').
      af5594c8
    • D
      Remove dmidecode dependancy outside PC arches · 450c927d
      Daniel Veillard 提交于
      The new dependancy is only available on ix86, x86_64 and ia64
      450c927d
  4. 17 1月, 2012 9 次提交
    • J
      qemu: Add support for host CPU modes · e7201afd
      Jiri Denemark 提交于
      This adds support for host-model and host-passthrough CPU modes to qemu
      driver. The host-passthrough mode is mapped to -cpu host.
      e7201afd
    • J
      Taint domains configured with cpu mode=host-passthrough · c8506d66
      Jiri Denemark 提交于
      There are several reasons for doing this:
      
      - the CPU specification is out of libvirt's control so we cannot
        guarantee stable guest ABI
      - not every feature of a CPU may actually work as expected when
        advertised directly to a guest
      - migration between two machines with exactly the same CPU may work but
        no guarantees can be made
      - this mode is not supported and its use is at one's own risk
      c8506d66
    • J
      cpu: Update guest CPU in host-* mode · 277bc0dc
      Jiri Denemark 提交于
      VIR_DOMAIN_XML_UPDATE_CPU flag for virDomainGetXMLDesc may be used to
      get updated custom mode guest CPU definition in case it depends on host
      CPU. This patch implements the same behavior for host-model and
      host-passthrough CPU modes.
      277bc0dc
    • J
      Add support for cpu mode attribute · f7dd3a4e
      Jiri Denemark 提交于
      The mode can be either of "custom" (default), "host-model",
      "host-passthrough". The semantics of each mode is described in the
      following examples:
      
      - guest CPU is a default model with specified topology:
          <cpu>
            <topology sockets='1' cores='2' threads='1'/>
          </cpu>
      
      - guest CPU matches selected model:
          <cpu mode='custom' match='exact'>
            <model>core2duo</model>
          </cpu>
      
      - guest CPU should be a copy of host CPU as advertised by capabilities
        XML (this is a short cut for manually copying host CPU specification
        from capabilities to domain XML):
          <cpu mode='host-model'/>
      
        In case a hypervisor does not support the exact host model, libvirt
        automatically falls back to a closest supported CPU model and
        removes/adds features to match host. This behavior can be disabled by
          <cpu mode='host-model'>
            <model fallback='forbid'/>
          </cpu>
      
      - the same as previous returned by virDomainGetXMLDesc with
        VIR_DOMAIN_XML_UPDATE_CPU flag:
          <cpu mode='host-model' match='exact'>
            <model fallback='allow'>Penryn</model>       --+
            <vendor>Intel</vendor>                         |
            <topology sockets='2' cores='4' threads='1'/>  + copied from
            <feature policy='require' name='dca'/>         | capabilities XML
            <feature policy='require' name='xtpr'/>        |
            ...                                          --+
          </cpu>
      
      - guest CPU should be exactly the same as host CPU even in the aspects
        libvirt doesn't model (such domain cannot be migrated unless both
        hosts contain exactly the same CPUs):
          <cpu mode='host-passthrough'/>
      
      - the same as previous returned by virDomainGetXMLDesc with
        VIR_DOMAIN_XML_UPDATE_CPU flag:
          <cpu mode='host-passthrough' match='minimal'>
            <model>Penryn</model>                        --+ copied from caps
            <vendor>Intel</vendor>                         | XML but doesn't
            <topology sockets='2' cores='4' threads='1'/>  | describe all
            <feature policy='require' name='dca'/>         | aspects of the
            <feature policy='require' name='xtpr'/>        | actual guest CPU
            ...                                          --+
          </cpu>
      f7dd3a4e
    • J
      cpu: Optionally forbid fallback CPU models · a6f88cbd
      Jiri Denemark 提交于
      In case a hypervisor doesn't support the exact CPU model requested by a
      domain XML, we automatically fallback to a closest CPU model the
      hypervisor supports (and make sure we add/remove any additional features
      if needed). This patch adds 'fallback' attribute to model element, which
      can be used to disable this automatic fallback.
      a6f88cbd
    • J
      tests: Print XML file name in verbose CPU test · 23cf79f0
      Jiri Denemark 提交于
      It's not totally obvious that a failure in
      
          CPU guest data(x86): host/guest (models, pref="qemu64")
      
      test means one needs to fix
      
          x86-host+guest,models,qemu64-result.xml
      
      where the expected XML is stored. Better to provide a nice hint in
      verbose mode for failed tests.
      23cf79f0
    • J
      Clarify semantics of virDomainMigrate{,ToURI}2 · 5e31e713
      Jiri Denemark 提交于
      Commit 5d784bd6 was a nice attempt to
      clarify the semantics by requiring domain name from dxml to either match
      original name or dname. However, setting dxml domain name to dname
      doesn't really work since destination host needs to know the original
      domain name to be able to use it in migration cookies. This patch
      requires domain name in dxml to match the original domain name. The
      change should be safe and backward compatible since migration would fail
      just a bit later in the process.
      5e31e713
    • O
      docs: Add missed RNG schema for interface · a5f8a01a
      Osier Yang 提交于
      We support <interface> of type "mcast", "server", and "client",
      but the RNG schema for them are missed. Attribute "address" is
      optional for "server" type. And these 3 types support
      <mac address='MAC'/>, too.
      a5f8a01a
    • E
      build: fix bootstrap on fresh clone · 9a070e83
      Eric Blake 提交于
      Commit 29db7a00 picked up a gnulib bug, where a change in
      bootstrap meant that it would fail to run libtoolize on
      projects, like libvirt, that used the older spelling
      AM_PROG_LIBTOOL instead of LT_INIT for the sake of building
      on RHEL 5.  Now that gnulib is fixed, we should pick up that
      fix.
      
      * .gnulib: Update to latest, for bootstrap fix.
      * bootstrap: Resync from gnulib.
      9a070e83
  5. 16 1月, 2012 2 次提交
  6. 14 1月, 2012 7 次提交
    • M
      conf: Remove do-nothing validation functions · bfbbc496
      Michael Ellerman 提交于
      There are three address validation routines that do nothing:
        virDomainDeviceDriveAddressIsValid()
        virDomainDeviceUSBAddressIsValid()
        virDomainDeviceVirtioSerialAddressIsValid()
      
      Remove them, and replace their call sites with "1" which is what they
      currently return. In some cases this means we can remove an entire
      if block.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      bfbbc496
    • M
      tests: Add qemuxml2argv tests for PPC64 pseries machine · 4b942fe8
      Michael Ellerman 提交于
      Add four tests of the XML -> argv handling for the PPC64 pseries machine.
      
      The first is just a basic test of a bare bones machine.
      
      The three others test various aspects of the spapr-vio address handling.
      
      It seems that currently we can't include network devices, doing so leads
      to a segfault because the network driverState is not initialised. Working
      around that leads us to the problem that the 'default' network doesn't
      exist. So for now just leave network devices out.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      4b942fe8
    • M
      tests: Teach qemuxml2argvtest about spapr-vio addresses · 69dde2e6
      Michael Ellerman 提交于
      We can't call qemuCapsExtractVersionInfo() from test code, because it
      expects to be able to call the emulator, and for testing we have fake
      emulators that can't be executed. For that reason qemuxml2argvtest.c
      doesn't call qemuDomainAssignPCIAddresses(), instead it open codes its
      own version.
      
      That means we can't call qemuDomainAssignAddresses() from the test code,
      instead we need to manually call qemuDomainAssignSpaprVioAddresses().
      
      Also add logic to cope with qemuDomainAssignSpaprVioAddresses() failing,
      so that we can write a test that checks for a known failure in there.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      69dde2e6
    • M
      Make drive unit attribute optional in the XML schema · 8611d9c3
      Michael Ellerman 提交于
      The "unit" attribute of a drive address is optional in the code, so should
      also be in the XML schema.
      Signed-off-by: NMichael Ellerman <michael@ellerman.id.au>
      8611d9c3
    • P
      qemu: add virtio-scsi controller model · c9abfadf
      Paolo Bonzini 提交于
      Adding a new model for virtio-scsi roughly follows the same scheme
      as the previous patch.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c9abfadf
    • P
      qemu: add ibmvscsi controller model · 7b345b69
      Paolo Bonzini 提交于
      KVM will be able to use a PCI SCSI controller even on POWER.  Let
      the user specify the vSCSI controller by other means than a default.
      
      After this patch, the QEMU driver will actually look at the model
      and reject anything but auto, lsilogic and ibmvscsi.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7b345b69
    • A
      events: Return the correct number of registered events · c972237e
      Adam Litke 提交于
      Commit d09f6ba5 introduced a regression in event
      registration.  virDomainEventCallbackListAddID() will only return a positive
      integer if the type of event being registered is VIR_DOMAIN_EVENT_ID_LIFECYCLE.
      For other event types, 0 is always returned on success.  This has the
      unfortunate side effect of not enabling remote event callbacks because
      remoteDomainEventRegisterAny() uses the return value from the local call to
      determine if an event callback needs to be registered on the remote end.
      
      Make sure virDomainEventCallbackListAddID() returns the callback count for the
      eventID being registered.
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      c972237e
  7. 13 1月, 2012 3 次提交