Re: [libvirt] [PATCH] Account for defined networks when generating bridge names

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

 



Cole Robinson <crobinso@xxxxxxxxxx> wrote:
> This is the second part of the fix for rhbz 479622. If we are generating
> a bridge name for a virtual network, don't collide with any bridge name
> in a defined network. This patch also generates a bridge name at network
> define time, if none was passed in the xml.
>
> The downside to all this is that it won't fix things for existing
> victims of the bug: if they have 2 networks with the same bridge device
> in the xml, we can't intelligently remedy the situation. This patch just
> helps prevent future users getting into that predicament.
>
> Thanks,
> Cole
>
> diff --git a/src/bridge.c b/src/bridge.c
> index fc11429..4446a95 100644
> --- a/src/bridge.c
> +++ b/src/bridge.c
> @@ -49,7 +49,7 @@
>  #include "util.h"
>  #include "logging.h"
>
> -#define MAX_BRIDGE_ID 256
> +#define MAX_TAP_ID 256
>
>  #define JIFFIES_TO_MS(j) (((j)*1000)/HZ)
>  #define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000)
> @@ -127,32 +127,13 @@ brShutdown(brControl *ctl)
>  #ifdef SIOCBRADDBR
>  int
>  brAddBridge(brControl *ctl,
> -            char **name)
> +            char *name)

Hi Cole,

Presuming this part will stay, as you rework the patch,
please make that "const".
and maybe save a line of vertical space:

  brAddBridge(brControl *ctl, const char *name)

--
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]