Re: [PATCH v3 4/4] qemu: allow searching for all open ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 13, 2012 at 03:21:25PM +0200, Martin Kletzander wrote:
> This patch allows to specify a flag 'rotate' saying that the search
> for next port should not be limited from the 'startPort' upwards.
> 
> This is subsequently used in the search for open SPICE TLS port when
> none is specified and TLS is enabled.
> ---
>  src/qemu/qemu_process.c |   24 +++++++++++++++++-------
>  1 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 654cb51..097d73a 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -2450,10 +2450,12 @@ qemuProcessInitPCIAddresses(struct qemud_driver *driver,
> 
> 
>  static int qemuProcessNextFreePort(struct qemud_driver *driver,
> -                                   int startPort)
> +                                   int startPort,
> +                                   bool rotate)


I think this is bogus - we should simply not pass startPort or rotate
in as parameters at all. 

>  {
>      int i;
> 
> + retry:
>      for (i = startPort ; i < driver->remotePortMax; i++) {

This should just loop from driver->remotePortMin always


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]