1. 04 5月, 2010 7 次提交
    • E
      build: avoid compiler warning · 7f31e28c
      Eric Blake 提交于
      Necessary on cygwin, where uid_t and gid_t are 4-byte long rather
      than int, causing gcc -Wformat warnings.
      
      * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork)
      (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and
      gid_t before passing to printf.
      * .gitignore: Ignore Windows executables.
      7f31e28c
    • S
      nwfilter: skip some interfaces on filter update · 018fd697
      Stefan Berger 提交于
      When a filter is updated, only those interfaces must have their old
      rules cleared that either reference the filter directly or indirectly
      through another filter. Remember between the different steps of the
      instantiation of the filters which interfaces must be skipped. I am
      using a hash map to remember the names of the interfaces and store a
      bogus pointer to ~0 into it that need not be freed.
      018fd697
    • S
      pass info where request stems from to have rules applied · 5c77fddf
      Stefan Berger 提交于
      For the decision on whether to instantiate the rules, the check for a
      pending IP address learn request is not sufficient since then only the
      thread could instantiate the rules. So, a boolean needs to be passed
      when the thread instantiates the filter rules late and the IP address
      learn request is still pending in order to override the check for the
      pending learn request. If the rules are to be updated while the thread
      is active, this will not be done immediately but the thread will do that
      later on.
      5c77fddf
    • E
      build: prefer WIN32 over __MINGW32__ checks · 9f87b631
      Eric Blake 提交于
      WIN32 is always defined when __MINGW32__ is defined, but the
      converse is not true.  WIN32 is more generic, if someone were
      to ever attempt porting to a microsoft compiler.  This does
      not affect Cygwin, which intentionally does not define WIN32.
      
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Use more
      generic flag macro.
      * src/storage/storage_backend.c
      (virStorageBackendUpdateVolTargetInfoFD)
      (virStorageBackendRunProgRegex): Likewise.
      * tools/console.h (vshRunConsole): Likewise.
      9f87b631
    • R
      cgroup: Fix possible memory leak in virCgroupMakeGroup · c4157e52
      Ryota Ozaki 提交于
      * src/util/cgroup.c: free temporal path string before breaking loop
      c4157e52
    • E
      dnsmasqReload: avoid mingw link failure · b9c4db0d
      Eric Blake 提交于
      * src/util/dnsmasq.c (dnsmasqReload): Mingw lacks kill, but is not
      running a dnsmasq daemon either.
      b9c4db0d
    • M
      dnsmasq.c: Fix OOM error reporting · 254ade37
      Matthias Bolte 提交于
      Also do some indentation clean up.
      254ade37
  2. 03 5月, 2010 1 次提交
    • R
      lxc: Fix failure on starting a domain with multiple interfaces · d2ac3c2f
      Ryota Ozaki 提交于
      [Error message]
      error: Failed to start domain lxc_test1
      error: internal error Failed to create veth device pair: 512
      
      The reason of the failure is that lxc driver unexpectedly re-uses
      an auto-assigned veth name and tries to create the created veth
      again. The failure will happen when a domain has multiple network
      interfaces and the names of those are not specified in XML.
      
      The patch fixes the problem by resetting buffers of veth names
      in every iteration of creating veth.
      
      * src/lxc/lxc_driver.c: prevent re-using auto-assigned veth name
        Reported by Kumar L Srikanth-B22348.
      d2ac3c2f
  3. 01 5月, 2010 1 次提交
    • C
      domain: Fix PCI address decimal parsing regression · e9840196
      Cole Robinson 提交于
      <hostdev> address parsing previously attempted to detect the number
      base: currently it is hardcoded to base 16, which can break PCI
      assignment via virt-manager. Revert to the previous behavior.
      
      * src/conf/domain_conf.c: virDomainDevicePCIAddressParseXML, switch to
        virStrToLong_ui(bus, NULL, 0, ...) to autodetect base
      e9840196
  4. 30 4月, 2010 12 次提交
    • D
      Add support for another explicit IO error event · 34dcbbb4
      Daniel P. Berrange 提交于
      This introduces a new event type
      
         VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
      
      This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR
      event, but also includes a string describing the cause of
      the event.
      
      Thus there is a new callback definition for this event type
      
      typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn,
                                                                 virDomainPtr dom,
                                                                 const char *srcPath,
                                                                 const char *devAlias,
                                                                 int action,
                                                                 const char *reason,
                                                                 void *opaque);
      
      This is currently wired up to the QEMU block IO error events
      
      * daemon/remote.c: Dispatch IO error events to client
      * examples/domain-events/events-c/event-test.c: Watch for
        IO error events
      * include/libvirt/libvirt.h.in: Define new IO error event ID
        and callback signature
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Extend API to handle IO error events
      * src/qemu/qemu_driver.c: Connect to the QEMU monitor event
        for block IO errors and emit a libvirt IO error event
      * src/remote/remote_driver.c: Receive and dispatch IO error
        events to application
      * src/remote/remote_protocol.x: Wire protocol definition for
        IO error events
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event
        from QEMU monitor
      34dcbbb4
    • J
      c90a1ad7
    • S
      Prevent updates while IP address learn thread is running · 5054e892
      Stefan Berger 提交于
      Prevent updating and tearing down of filter while the IP
      address learning thread is running and has its own filtering
      rules applied.
      5054e892
    • S
      Syncronize the teardown of rules with the thread · ebacb31f
      Stefan Berger 提交于
      Introduce a function to notify the IP address learning
      thread to terminate and thus release the lock on the interface.
      Notify the thread before grabbing the lock on the interface
      and tearing down the rules. This prevents a 'virsh destroy' to
      tear down the rules that the IP address learning thread has
      applied.
      ebacb31f
    • S
      Clean all tables before applying 'basic' rules · 59fe163f
      Stefan Berger 提交于
      The functions invoked by the IP address learning thread
      that apply some basic filtering rules did not clean up
      any previous filtering rules that may still be there
      (due to a libvirt restart for example). With the
      patch below all the rules are cleaned up first.
      
      Also, I am introducing a function to drop all traffic
      in case the IP address learning thread could not apply
      the rules.
      59fe163f
    • D
      MAke virFileHasSuffix case insensitive · b9efc7dc
      Daniel Veillard 提交于
      * src/util/util.c: as it's used for checking things like .iso suffixes
      b9efc7dc
    • S
      nwfilter: Also pick IP address from a DHCP ACK message · 7c66c033
      Stefan Berger 提交于
      The local DHCP server on virtbr0 sends DHCP ACK messages when a VM is
      started and requests an IP address while the initial DHCP lease on the
      VM's MAC address hasn't expired. So, also pick the IP address of the VM
      if that type of message is seen.
      Thanks to Gerhard Stenzel for providing a test case for this.
      
      Changes from V1 to V2:
      - cleanup: replacing DHCP option numbers through constants
      7c66c033
    • J
      qemudDomainSaveFlag: remove dead store · 5b0aed68
      Jim Meyering 提交于
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Remove dead store to "rc".
      5b0aed68
    • D
      Fix detection of disk in IO events · 0eecdd68
      Daniel P. Berrange 提交于
      When using -device syntax, the IO event will have a different
      prefix, 'drive-' that needs to be skipped over before matching
      against the libvirt disk alias
      
      * src/qemu/qemu_driver.c: Skip QEMU_DRIVE_HOST_PREFIX in IO event
      0eecdd68
    • D
      Implement virDomainGetBlockInfo in QEMU driver · db57a7be
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Implementation of virDomainGetBlockInfo
      * src/util/storage_file.h: Add DEV_BSIZE
      * src/storage/storage_backend.c: Remove DEV_BSIZE
      db57a7be
    • D
      Remote protocol impl for virDomainGetBlockInfo · 84a3269a
      Daniel P. Berrange 提交于
      * daemon/remote.c: Server side dispatcher
      * daemon/remote_dispatch_args.h, daemon/remote_dispatch_prototypes.h,
        daemon/remote_dispatch_ret.h, daemon/remote_dispatch_table.h: Update
        with new API
      * src/remote/remote_driver.c: Client side dispatcher
      * src/remote/remote_protocol.c, src/remote/remote_protocol.h: Update
      * src/remote/remote_protocol.x: Define new wire protocol
      84a3269a
    • D
      Internal driver API infrastructure for virDomainGetBlockInfo · 46bad512
      Daniel P. Berrange 提交于
      This defines the internal driver API and stubs out each driver
      
      * src/driver.h: Define virDrvDomainGetBlockInfo signature
      * src/libvirt.c, src/libvirt_public.syms: Glue public API to drivers
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub out driver
      46bad512
  5. 29 4月, 2010 7 次提交
  6. 28 4月, 2010 8 次提交
    • D
      Move dnsmasq host file to a separate directory · 4e041189
      Daniel Veillard 提交于
      use /var/lib/libvirt/dnsmasq since /var/lib/libvirt/network is
      unreadable by the dnsmasq binary
      
      * src/network/bridge_driver.c: update DNSMASQ_STATE_DIR
      * src/Makefile.am: create it on make install
      * libvirt.spec.in: take the new directory into account
      4e041189
    • D
      Fix handling of security driver restore failures in QEMU domain save · 51cd0196
      Daniel P. Berrange 提交于
      In cases where the security driver failed to restore a label after a
      guest has saved, we mistakenly jumped to the error cleanup paths.
      This is not good, because the operation has in fact completed and
      cannot be rolled back completely. Label restore is non-critical, so
      just log the problem instead. Also add a missing restore call in
      the error cleanup path
      
      * src/qemu/qemu_driver.c: Fix handling of security driver
        restore failures in QEMU domain save
      51cd0196
    • D
      Fix QEMU domain save to block devices with cgroups enabled · 712048bd
      Daniel P. Berrange 提交于
      When cgroups is enabled, access to block devices is likely to be
      restricted to a whitelist. Prior to saving a guest to a block device,
      it is necessary to add the block device to the whitelist. This is
      not required upon restore, since QEMU reads from stdin
      
      * src/qemu/qemu_driver.c: Add block device to cgroups whitelist
        if neccessary during domain save.
      712048bd
    • D
      Fix QEMU save/restore with block devices · 93e0b3c8
      Daniel P. Berrange 提交于
      The save process was relying on use of the shell >> append
      operator to ensure the save data was placed after the libvirt
      header + XML. This doesn't work for block devices though.
      Replace this code with use of 'dd' and its 'seek' parameter.
      This means that we need to pad the header + XML out to a
      multiple of dd block size (in this case we choose 512).
      
      The qemuMonitorMigateToCommand() monitor API is used for both
      save/coredump, and migration via UNIX socket. We can't simply
      switch this to use 'dd' since this causes problems with the
      migration usage. Thus, create a dedicated qemuMonitorMigateToFile
      which can accept an filename + offset, and remove the filename
      from the current qemuMonitorMigateToCommand() API
      
      * src/qemu/qemu_driver.c: Switch to qemuMonitorMigateToFile
        for save and core dump
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Create
        a new qemuMonitorMigateToFile, separate from the existing
        qemuMonitorMigateToCommand to allow handling file offsets
      93e0b3c8
    • D
      Avoid create/unlink with block devs used for QEMU save · ae42979a
      Daniel P. Berrange 提交于
      It is possible to use block devices with domain save/restore. Upon
      failure QEMU unlinks the path being saved to. This isn't good when
      it is a block device !
      
      * src/qemu/qemu_driver.c: Don't unlink block devices if save fails
      ae42979a
    • D
      Fix crash when cleaning up from failed save attempt · d7e0fe6e
      Daniel P. Berrange 提交于
      If a transient QEMU crashes during save attempt, then the virDomainPtr
      object may be freed. If a persistent QEMU crashes during save, then
      the 'priv->mon' field is no longer valid since it will be inactive.
      
      * src/qemu/qemu_driver.c: Fix two crashes when QEMU exits
        during a save attempt
      d7e0fe6e
    • C
    • K
      75d88455
  7. 27 4月, 2010 4 次提交
    • C
      Fix up the locking in the snapshot code. · b69bbebb
      Chris Lalancette 提交于
      In particular I was forgetting to take the qemuMonitorPrivatePtr
      lock (via qemuDomainObjBeginJob), which would cause problems
      if two users tried to access the same domain at the same time.
      This patch also fixes a problem where I was forgetting to remove
      a transient domain from the list of domains.
      
      Thanks to Stephen Shaw for pointing out the problem and testing
      out the initial patch.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      b69bbebb
    • S
      nwfilter: add support for RAPR protocol · aea68ce9
      Stefan Berger 提交于
      This patch adds support for the RARP protocol. This may be needed due to
      qemu sending out a RARP packet (at least that's what it seems to want to
      do even though the protocol id is wrong) when migration finishes and
      we'd need a rule to let the packets pass.
      
      Unfortunately my installation of ebtables does not understand -p RARP
      and also seems to otherwise depend on strings in /etc/ethertype
      translated to protocol identifiers. Therefore I need to pass -p 0x8035
      for RARP. To generally get rid of the dependency of that file I switch
      all so far supported protocols to use their protocol identifier in the
      -p parameter rather than the string.
      
      I am also extending the schema and added a test case.
      
      changes from v1 to v2:
      - added test case into patch
      aea68ce9
    • J
      Ignore qemu STOP event when stopping CPUs · 35b61376
      Jiri Denemark 提交于
      With JSON qemu monitor, we get a STOP event from qemu whenever qemu
      stops guests CPUs. The downside of it is that vm->state is changed to
      PAUSED and a new generic paused event is send to applications. However,
      when we ask qemu to stop the CPUs we are not really interested in qemu
      event and we usually want to issue a more specific event.
      
      By setting vm->status to PAUSED before actually sending the request to
      qemu (and resetting it back if the request fails) we can ignore the
      event since the event handler does nothing when the guest is already
      paused. This solution is quite hacky but unfortunately it's the best
      solution which I was able to come up with and it doesn't introduce a
      race condition.
      35b61376
    • J
      Fix build with DEBUG_RAW_IO=1 · 29bca037
      Jiri Denemark 提交于
      29bca037