1. 26 6月, 2014 17 次提交
  2. 25 6月, 2014 12 次提交
  3. 24 6月, 2014 11 次提交
    • P
      bridge: leases: Fix potential crash caused by use after free · 11863f70
      Peter Krempa 提交于
      Don't free individual JSON array members as the array will be freed at
      the end. This may potentially lead to a crash although it didn't crash
      on my setup.
      11863f70
    • J
      Free DHCP leases file in networkGetDHCPLeasesHelper · 15b46520
      Ján Tomko 提交于
      Introduced by commit ba513982
      15b46520
    • J
      Rework remoteSerializeDHCPLease · 364586d3
      Ján Tomko 提交于
      Don't leak the temporary variables on success if NULL is returned
      for that field.
      
      Don't dereference NULL on failure to allocate some of the temporaries.
      
      Introduced by commit 990c3b65
      364586d3
    • J
      Free file header in virStorageFileGetMetadataRecurse · 7086d7fa
      Ján Tomko 提交于
      Introduced by commit 2bdb8b96
      7086d7fa
    • D
      Change 'interface' to 'iface' in virNetworkDHCPLease · 6512c8b4
      Daniel P. Berrange 提交于
      Variables/fields named 'interface' clash with system
      header symbols on some platforms.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      6512c8b4
    • G
      graphics: remember graphics not auto allocated ports · 1a065caa
      Giuseppe Scrivano 提交于
      When looking for a port to allocate, the port allocator didn't take in
      consideration ports that are statically set by the user.  Defining
      these two graphics elements in the XML would cause an error, as the
      port allocator would try to use the same port for the spice graphics
      element:
      
          <graphics type='spice' autoport='yes'/>
          <graphics type='vnc' port='5900' autoport='no'/>
      
      The new *[pP]ortReserved variables keep track of the ports that were
      successfully tracked as used by the port allocator but that weren't
      bound.
      
      Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1081881Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
      1a065caa
    • G
      virtportallocator: new function "virPortAllocatorSetUsed" · 1d8d2fbc
      Giuseppe Scrivano 提交于
      virPortAllocatorSetUsed permits to set a port as already used and
      prevent the port allocator to use it without any attempt to bind it.
      Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1d8d2fbc
    • N
      net-dhcp-leases: Add virsh support · 59cac9a9
      Nehal J Wani 提交于
      Use virNetworkGetDHCPLeases and virNetworkGetDHCPLeasesForMAC in virsh.
      
      The new feature supports the follwing methods:
      
      1. Retrieve leases info for a given virtual network
      
      2. Retrieve leases info for given network interface
      
      tools/virsh-domain-monitor.c
         * Introduce new command : net-dhcp-leases
           Example Usage: net-dhcp-leases <network> [mac]
      
         virsh # net-dhcp-leases --network default6
         Expiry Time          MAC address        Protocol  IP address                Hostname        Client ID or DUID
         -------------------------------------------------------------------------------------------------------------------
         2014-06-16 03:40:14  52:54:00:85:90:e2  ipv4      192.168.150.231/24        fedora20-test   01:52:54:00:85:90:e2
         2014-06-16 03:40:17  52:54:00:85:90:e2  ipv6      2001:db8:ca2:2:1::c0/64   fedora20-test   00:04:b1:d8:86:42:e1:6a:aa:cf:d5:86:94:23:6f:94:04:cd
         2014-06-16 03:34:42  52:54:00:e8:73:eb  ipv4      192.168.150.181/24        ubuntu14-vm     -
         2014-06-16 03:34:46  52:54:00:e8:73:eb  ipv6      2001:db8:ca2:2:1::5b/64   -               00:01:00:01:1b:30:c6:aa:52:54:00:e8:73:eb
      
      tools/virsh.pod
         * Document new command
      
      src/internal.h
         * Introduce new macro: EMPTYSTR
      59cac9a9
    • N
      net-dhcp-leases: Private implementation inside network · ba513982
      Nehal J Wani 提交于
      Query the network driver for the path of the custom leases file for the given
      virtual network and parse it to retrieve info.
      
      src/network/bridge_driver.c:
      * Implement networkGetDHCPLeases
      * Implement networkGetDHCPLeasesForMAC
      * Implement networkGetDHCPLeasesHelper
      ba513982
    • N
      net-dhcp-leases: Implement the remote protocol · 990c3b65
      Nehal J Wani 提交于
      Implement RPC calls for virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC
      
      daemon/remote.c
         * Define remoteSerializeNetworkDHCPLeases,
                  remoteDispatchNetworkGetDHCPLeases
         * Define remoteDispatchNetworkGetDHCPLeasesForMAC
         * Define helper function remoteSerializeDHCPLease
      
      src/remote/remote_driver.c
         * Define remoteNetworkGetDHCPLeases
         * Define remoteNetworkGetDHCPLeasesForMAC
         * Define helper function remoteSerializeDHCPLease
      
      src/remote/remote_protocol.x
         * New RPC procedure: REMOTE_PROC_NETWORK_GET_DHCP_LEASES
         * Define structs remote_network_dhcp_leases, remote_network_get_dhcp_leases_args,
                          remote_network_get_dhcp_leases_ret
         * New RPC procedure: REMOTE_PROC_NETWORK_GET_DHCP_LEASES_FOR_MAC
         * Define structs remote_network_dhcp_leases_for_mac, remote_network_get_dhcp_leases_for_mac_args,
                          remote_network_get_dhcp_leases_for_mac_ret
      
      src/remote_protocol-structs
         * New structs added
      
      src/rpc/gendispatch.pl
         * Add exception (s/Dhcp/DHCP) for auto-generating names of the remote functions
           in daemon/remote_dispatch.h
      990c3b65
    • N
      net-dhcp-leases: Implement the public APIs · 03e0e79e
      Nehal J Wani 提交于
      Introduce 3 new APIs, virNetworkGetDHCPLeases, virNetworkGetDHCPLeasesForMAC
      and virNetworkDHCPLeaseFree.
      
      * virNetworkGetDHCPLeases: returns the dhcp leases information for a given
           virtual network.
      
        For DHCPv4, the information returned:
        - Network Interface Name
        - Expiry Time
        - MAC address
        - IAID (NULL)
        - IPv4 address (with type and prefix)
        - Hostname (can be NULL)
        - Client ID (can be NULL)
      
        For DHCPv6, the information returned:
        - Network Interface Name
        - Expiry Time
        - MAC address
        - IAID (can be NULL, only in rare cases)
        - IPv6 address (with type and prefix)
        - Hostname (can be NULL)
        - Client DUID
      
        Note: @mac, @iaid, @ipaddr, @clientid are in ASCII form, not raw bytes.
        Note: @expirytime can 0, in case the lease is for infinite time.
      
      * virNetworkGetDHCPLeasesForMAC: returns the dhcp leases information for a
           given virtual network and specified MAC Address.
      
      * virNetworkDHCPLeaseFree: allows the upper layer application to free the
           network interface object conveniently.
      
      There is no support for flags, so user is expected to pass 0 for
      both the APIs.
      
      include/libvirt/libvirt.h.in:
        * Define virNetworkGetDHCPLeases
        * Define virNetworkGetDHCPLeasesForMAC
        * Define virNetworkDHCPLeaseFree
      
      src/driver.h:
        * Define networkGetDHCPLeases
        * Define networkGetDHCPLeasesForMAC
      
      src/libvirt.c:
        * Implement virNetworkGetDHCPLeases
        * Implement virNetworkGetDHCPLeasesForMAC
        * Implement virNetworkDHCPLeaseFree
      
      src/libvirt_public.syms:
        * Export the new symbols
      03e0e79e