X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvcopy-init.hc;h=80b7c67a35c8024c146dff0dfbce24ab9abb213b;hb=5b39edfee423f5f3cbe8fa223dcfdc9e8d66e286;hp=ace737eec1476a65a4fa49abfb28e72de63f9748;hpb=9f52547ae6ad8bde3d17856480453498e4bd0ab1;p=util-vserver.git diff --git a/util-vserver/src/vcopy-init.hc b/util-vserver/src/vcopy-init.hc index ace737e..80b7c67 100644 --- a/util-vserver/src/vcopy-init.hc +++ b/util-vserver/src/vcopy-init.hc @@ -68,23 +68,48 @@ initModeManually(int argc, char *argv[]) static void initModeVserver(int argc, char *argv[]) { - int count=argc; + int count = argc; + struct MatchVserverInfo src_vserver = { + .name = argv[1], + .use_pkgmgmt = true + }; + + if (!MatchVserverInfo_init(&src_vserver)) { + WRITE_MSG(2, "Failed to initialize unification for source-vserver\n"); + exit(1); + } if (count!=2) { WRITE_MSG(2, "Bad arguments; try '--help' for more information\n"); exit(1); } - if (!MatchList_initByVserver(&global_info.src_list, argv[1], 0)) { + if (!MatchList_initByVserver(&global_info.src_list, &src_vserver)) { WRITE_MSG(2, "unification not configured for source vserver\n"); exit(1); } - if (!global_args->is_strict) - createSkeleton(argv[0]); + MatchVserverInfo_free(&src_vserver); + - if (!MatchList_initByVserver(&global_info.dst_list, argv[0], 0)) { + + struct MatchVserverInfo dst_vserver = { + .name = argv[0], + .use_pkgmgmt = false + }; + + if (!global_args->is_strict) + createSkeleton(dst_vserver.name); + + if (!MatchVserverInfo_init(&dst_vserver)) { + WRITE_MSG(2, "Failed to initialize unification for destination-vserver\n"); + exit(1); + } + + if (!MatchList_initByVserver(&global_info.dst_list, &dst_vserver)) { WRITE_MSG(2, "unification not configured for destination vserver\n"); exit(1); } + + MatchVserverInfo_free(&dst_vserver); }