From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 932001FF385 for ; Wed, 24 Apr 2024 22:45:15 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E99B4151AE; Wed, 24 Apr 2024 22:45:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bhmsd-org.20230601.gappssmtp.com; s=20230601; t=1713991507; x=1714596307; darn=lists.proxmox.com; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=nSthYWEmouv9HxwgHuT4IB3OvwrcCx0DgXEaDj8Xy3w=; b=iNzBHxSiPNzGYT7HMJRzZ+frB0DYrec8dxevdKyCzGhCVPkR3vOFlZfL/t+FiO9ijn 7pENZxw/4EwsiHXEwWzxIRAOe8hk+fIsVAU6mBkhsqXIfdOV8ajuoTeulsqxukM9wWq6 MIe1p6ruiUobJ/qCI9C46lKv5ZxlcGR1KRaIYNzU1hvXD763Pz+gTwMPgBbnKHa07WIq owYE7Be3wBZNdwpZYAzVz9lWgRO7Y/tpME8LgOMdgO1sbid2XI2E3IWjN/UGBwexaJON 29PqqSew9RV21uquOtvgG8zUn6PphKgtqT+LBiSZ/3nv82lmjjxxsVWaEh2678CRxxdT aC1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713991507; x=1714596307; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nSthYWEmouv9HxwgHuT4IB3OvwrcCx0DgXEaDj8Xy3w=; b=irfI08+0nfTzL6h+JCaWg72tDe124BNiHPLwin307UBtE1k+MQY8c5LCdvTXuEqm7L ctHvNaJPZ/Bevfn10KCifbX2GBWT2XLRepJwdvxSR7V2Lr245G0WZ5LWCGuigs1H2XlV eOQS7JzAEyzsy41Inw57WQn0ANBCrS1728lXuIZ8AZ0jdimSuLqp0enwNjEWrVBa5KUN q6P0SAQ6hl5dtMWtKvo9FcOu22DkkTLBPeazUd3YqDM/jVNiYpwKxBCFsYlkKLm9s4m1 Ld9eJSJLx69buPa+xY0oToSlCCMSVqx073LEjv4CkZ72eCUwU0ZtH6KlGcr2fyUH5uP4 2+/g== X-Gm-Message-State: AOJu0Yy9g8er7McXS4nxg48sY5NXNblurDD3HSXhpp+G+n58b+A4GNQd eaKhrZ/uNBKzUSFqVxBlfkD36C3l7UCgrNznqRdw36rh47yD9YCQw6uATq12R6vX1TwX484IqZ2 pG6evCkM9WVOfXGbKGNgB2e5bPKQlAQJy5tdWX7zw7TdA5Acyom2sKg== X-Google-Smtp-Source: AGHT+IFu5wHdil4qbQMFGwM1mAXvMAhdr9Vmiugs11MJvhthQzppFhq5ZQQ8+mV6Man6FQ8J9U4MmxI6gHDbiY8Wcf0= X-Received: by 2002:a17:90a:6984:b0:2ae:91e5:7c9b with SMTP id s4-20020a17090a698400b002ae91e57c9bmr1200934pjj.7.1713991506841; Wed, 24 Apr 2024 13:45:06 -0700 (PDT) MIME-Version: 1.0 From: Ben Dailey Date: Wed, 24 Apr 2024 16:44:41 -0400 Message-ID: To: pve-devel@lists.proxmox.com X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DMARC_MISSING 0.1 Missing DMARC policy HTML_MESSAGE 0.001 HTML included in message RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [pve-devel] vma extract force flag X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Would the development team consider a patch like below to add a force flag to the vma extract command? diff --git a/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch b/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch index 1620a56..931bebc 100644 --- a/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch +++ b/debian/patches/pve/0027-PVE-Backup-add-vma-backup-format-code.patch @@ -1797,7 +1797,7 @@ index 0000000000..347f6283ca + "vma list \n" + "vma config [-c config]\n" + "vma create [-c config] pathname ...\n" -+ "vma extract [-d ] [-r ] \n" ++ "vma extract [-d ] [-r ] [-f] \n" + "vma verify [-v]\n" + ; + @@ -1939,6 +1939,7 @@ index 0000000000..347f6283ca +{ + int c, ret = 0; + int verbose = 0; ++ int force = 0; + const char *filename; + const char *dirname; + const char *readmap = NULL; @@ -1957,6 +1958,9 @@ index 0000000000..347f6283ca + case 'd': + drive_list = g_strsplit(optarg, ",", 254); + break; ++ case 'f': ++ force = 1; ++ break; + case 'r': + readmap = optarg; + break; @@ -1982,7 +1986,7 @@ index 0000000000..347f6283ca + g_error("%s", error_get_pretty(errp)); + } + -+ if (mkdir(dirname, 0777) < 0) { ++ if (mkdir(dirname, 0777) < 0 && !force) { + g_error("unable to create target directory %s - %s", + dirname, g_strerror(errno)); + } @@ -2100,7 +2104,13 @@ index 0000000000..347f6283ca + VmaDeviceInfo *di = vma_reader_get_device_info(vmar, i); + if (di && (strcmp(di->devname, "vmstate") == 0)) { + char *statefn = g_strdup_printf("%s/vmstate.bin", dirname); -+ vmstate_fd = open(statefn, O_WRONLY|O_CREAT|O_EXCL, 0644); ++ int open_flags =O_WRONLY|O_CREAT; ++ if(force) { ++ open_flags |= O_TRUNC; ++ }else{ ++ open_flags |= O_EXCL; ++ } ++ vmstate_fd = open(statefn, open_flags, 0644); + if (vmstate_fd < 0) { + g_error("create vmstate file '%s' failed - %s", statefn, + g_strerror(errno)); I would like to keep extracted backups on an NFS server backed with ZFS and retain the benefits of differential snapshots and it would be helpful to have the vma extract replace the previous backups directly. Thank you for your consideration. Praise the Lord! Ben Dailey Associate Technology Director Bluffton-Harrison MSD bdailey@bhmsd.org _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel