On 04/13/2015 06:23 AM, Peter Krempa wrote: > On Thu, Apr 02, 2015 at 13:39:44 -0400, John Ferlan wrote: >> Check proposed pool definitions to ensure they aren't trying to use the >> same host as currently defined definitions - disallow the duplicate > > This statement is invalid. Multiple pols can be hosted on a single host. > Hmm - brain shorthand... How about: Check the proposed pool source host XML definition against existing sheepdog pools to ensure the incoming definition doesn't use the same source host XML definition as an existing pool. > The check needs to do better than just check the host name. Port and > pool path may differ denoting a different pool. > Hmm.. yes 'port' is something I could add to virStoragePoolSourceMatchSingleHost and it's also extendable to iSCSI... doesn't make sense for NETFS, but would also be usable for gluster I'll squeeze in a patch in order to handle. > Btw same host can be described using multiple host strings so it also > isn't absolute. > Yep... That's where we're trying to get, but it takes a bit to get there! For example, I use "192.168.122.1' for my '<host name='...'/> string; however, if I add to /etc/hosts: 192.168.122.1 test1 and then use 'test1' in a different definition - the new code will fail to match, but they are essentially the same thing... There's a bz for that which I'm working to fix, but was trying to avoid a 20 patch series to do so... Gotta start somewhere. John BTW: It gets worse once IPv6 is added into the mix. >> >> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx> >> --- >> src/conf/storage_conf.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c >> index 5f1c151..5db7478 100644 >> --- a/src/conf/storage_conf.c >> +++ b/src/conf/storage_conf.c >> @@ -2427,9 +2427,12 @@ virStoragePoolSourceFindDuplicate(virConnectPtr conn, >> case VIR_STORAGE_POOL_DISK: >> matchpool = virStoragePoolSourceFindDuplicateDevices(pool, def); >> break; >> + case VIR_STORAGE_POOL_SHEEPDOG: >> + if (matchPoolSourceHost(&pool->def->source, &def->source)) >> + matchpool = pool; >> + break; > > Peter > -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list