* [pve-devel] [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver
@ 2024-01-09 14:09 Fiona Ebner
2024-01-09 14:10 ` [pve-devel] [PATCH qemu 2/2] backup: avoid bubbling up first ECANCELED error Fiona Ebner
2024-03-12 12:22 ` [pve-devel] applied-series: [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver Thomas Lamprecht
0 siblings, 2 replies; 3+ messages in thread
From: Fiona Ebner @ 2024-01-09 14:09 UTC (permalink / raw)
To: pve-devel
Makes it simpler and shorter. Still results in the same code after
applying both patches in question.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
...-Backup-add-backup-dump-block-driver.patch | 22 ++---
...ckup-Proxmox-backup-patches-for-QEMU.patch | 81 ++++---------------
2 files changed, 28 insertions(+), 75 deletions(-)
diff --git a/debian/patches/pve/0028-PVE-Backup-add-backup-dump-block-driver.patch b/debian/patches/pve/0028-PVE-Backup-add-backup-dump-block-driver.patch
index 0d7fd96..1adb45d 100644
--- a/debian/patches/pve/0028-PVE-Backup-add-backup-dump-block-driver.patch
+++ b/debian/patches/pve/0028-PVE-Backup-add-backup-dump-block-driver.patch
@@ -12,20 +12,20 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
[FE: adapt to coroutine changes]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
- block/backup-dump.c | 168 +++++++++++++++++++++++++++++++
+ block/backup-dump.c | 172 +++++++++++++++++++++++++++++++
block/backup.c | 30 ++----
block/meson.build | 1 +
include/block/block_int-common.h | 35 +++++++
job.c | 3 +-
- 5 files changed, 214 insertions(+), 23 deletions(-)
+ 5 files changed, 218 insertions(+), 23 deletions(-)
create mode 100644 block/backup-dump.c
diff --git a/block/backup-dump.c b/block/backup-dump.c
new file mode 100644
-index 0000000000..232a094426
+index 0000000000..e46abf1070
--- /dev/null
+++ b/block/backup-dump.c
-@@ -0,0 +1,168 @@
+@@ -0,0 +1,172 @@
+/*
+ * BlockDriver to send backup data stream to a callback function
+ *
@@ -37,6 +37,8 @@ index 0000000000..232a094426
+ */
+
+#include "qemu/osdep.h"
++
++#include "qapi/qmp/qdict.h"
+#include "qom/object_interfaces.h"
+#include "block/block_int.h"
+
@@ -169,7 +171,7 @@ index 0000000000..232a094426
+block_init(bdrv_backup_dump_init);
+
+
-+BlockDriverState *bdrv_backup_dump_create(
++BlockDriverState *coroutine_fn bdrv_co_backup_dump_create(
+ int dump_cb_block_size,
+ uint64_t byte_size,
+ BackupDumpFunc *dump_cb,
@@ -177,9 +179,11 @@ index 0000000000..232a094426
+ Error **errp)
+{
+ BDRVBackupDumpState *state;
-+ BlockDriverState *bs = bdrv_new_open_driver(
-+ &bdrv_backup_dump_drive, NULL, BDRV_O_RDWR, errp);
+
++ QDict *options = qdict_new();
++ qdict_put_str(options, "driver", "backup-dump-drive");
++
++ BlockDriverState *bs = bdrv_co_open(NULL, NULL, options, BDRV_O_RDWR, errp);
+ if (!bs) {
+ return NULL;
+ }
@@ -255,7 +259,7 @@ index 59b71ba9f3..6fde9f7dcd 100644
'blkdebug.c',
'blklogwrites.c',
diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
-index 74195c3004..0f2e1817ad 100644
+index 74195c3004..0a0339eee4 100644
--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -26,6 +26,7 @@
@@ -272,7 +276,7 @@ index 74195c3004..0f2e1817ad 100644
+typedef int BackupDumpFunc(void *opaque, uint64_t offset, uint64_t bytes, const void *buf);
+
-+BlockDriverState *bdrv_backup_dump_create(
++BlockDriverState *coroutine_fn bdrv_co_backup_dump_create(
+ int dump_cb_block_size,
+ uint64_t byte_size,
+ BackupDumpFunc *dump_cb,
diff --git a/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch b/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
index 3829068..bd1633b 100644
--- a/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
+++ b/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
@@ -84,63 +84,25 @@ Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
create jobs in a drained section]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
- block/backup-dump.c | 10 +-
- block/meson.build | 5 +
- block/monitor/block-hmp-cmds.c | 39 ++
- blockdev.c | 1 +
- hmp-commands-info.hx | 14 +
- hmp-commands.hx | 29 +
- include/block/block_int-common.h | 2 +-
- include/monitor/hmp.h | 3 +
- meson.build | 1 +
- monitor/hmp-cmds.c | 72 ++
- proxmox-backup-client.c | 146 ++++
- proxmox-backup-client.h | 60 ++
- pve-backup.c | 1067 ++++++++++++++++++++++++++++++
- qapi/block-core.json | 229 +++++++
- qapi/common.json | 14 +
- qapi/machine.json | 16 +-
- 16 files changed, 1690 insertions(+), 18 deletions(-)
+ block/meson.build | 5 +
+ block/monitor/block-hmp-cmds.c | 39 ++
+ blockdev.c | 1 +
+ hmp-commands-info.hx | 14 +
+ hmp-commands.hx | 29 +
+ include/monitor/hmp.h | 3 +
+ meson.build | 1 +
+ monitor/hmp-cmds.c | 72 +++
+ proxmox-backup-client.c | 146 +++++
+ proxmox-backup-client.h | 60 ++
+ pve-backup.c | 1067 ++++++++++++++++++++++++++++++++
+ qapi/block-core.json | 229 +++++++
+ qapi/common.json | 14 +
+ qapi/machine.json | 16 +-
+ 14 files changed, 1682 insertions(+), 14 deletions(-)
create mode 100644 proxmox-backup-client.c
create mode 100644 proxmox-backup-client.h
create mode 100644 pve-backup.c
-diff --git a/block/backup-dump.c b/block/backup-dump.c
-index 232a094426..e46abf1070 100644
---- a/block/backup-dump.c
-+++ b/block/backup-dump.c
-@@ -9,6 +9,8 @@
- */
-
- #include "qemu/osdep.h"
-+
-+#include "qapi/qmp/qdict.h"
- #include "qom/object_interfaces.h"
- #include "block/block_int.h"
-
-@@ -141,7 +143,7 @@ static void bdrv_backup_dump_init(void)
- block_init(bdrv_backup_dump_init);
-
-
--BlockDriverState *bdrv_backup_dump_create(
-+BlockDriverState *coroutine_fn bdrv_co_backup_dump_create(
- int dump_cb_block_size,
- uint64_t byte_size,
- BackupDumpFunc *dump_cb,
-@@ -149,9 +151,11 @@ BlockDriverState *bdrv_backup_dump_create(
- Error **errp)
- {
- BDRVBackupDumpState *state;
-- BlockDriverState *bs = bdrv_new_open_driver(
-- &bdrv_backup_dump_drive, NULL, BDRV_O_RDWR, errp);
-
-+ QDict *options = qdict_new();
-+ qdict_put_str(options, "driver", "backup-dump-drive");
-+
-+ BlockDriverState *bs = bdrv_co_open(NULL, NULL, options, BDRV_O_RDWR, errp);
- if (!bs) {
- return NULL;
- }
diff --git a/block/meson.build b/block/meson.build
index 6fde9f7dcd..6d468f89e5 100644
--- a/block/meson.build
@@ -281,19 +243,6 @@ index e352f86872..0c8b6725fb 100644
ERST
{
-diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
-index 0f2e1817ad..0a0339eee4 100644
---- a/include/block/block_int-common.h
-+++ b/include/block/block_int-common.h
-@@ -63,7 +63,7 @@
-
- typedef int BackupDumpFunc(void *opaque, uint64_t offset, uint64_t bytes, const void *buf);
-
--BlockDriverState *bdrv_backup_dump_create(
-+BlockDriverState *coroutine_fn bdrv_co_backup_dump_create(
- int dump_cb_block_size,
- uint64_t byte_size,
- BackupDumpFunc *dump_cb,
diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h
index 7a7def7530..cba7afe70c 100644
--- a/include/monitor/hmp.h
--
2.39.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] [PATCH qemu 2/2] backup: avoid bubbling up first ECANCELED error
2024-01-09 14:09 [pve-devel] [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver Fiona Ebner
@ 2024-01-09 14:10 ` Fiona Ebner
2024-03-12 12:22 ` [pve-devel] applied-series: [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Fiona Ebner @ 2024-01-09 14:10 UTC (permalink / raw)
To: pve-devel
With pvebackup_propagate_error(), the first error wins. When one job
in the transaction fails, it is expected that later jobs get the
ECANCELED error. Those are not interesting and by skipping them a more
interesting error, which is likely the actual root cause, can win.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
...E-Backup-Proxmox-backup-patches-for-QEMU.patch | 15 ++++++++++-----
...VE-Migrate-dirty-bitmap-state-via-savevm.patch | 4 ++--
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch b/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
index bd1633b..4ea1787 100644
--- a/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
+++ b/debian/patches/pve/0030-PVE-Backup-Proxmox-backup-patches-for-QEMU.patch
@@ -94,11 +94,11 @@ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
monitor/hmp-cmds.c | 72 +++
proxmox-backup-client.c | 146 +++++
proxmox-backup-client.h | 60 ++
- pve-backup.c | 1067 ++++++++++++++++++++++++++++++++
+ pve-backup.c | 1072 ++++++++++++++++++++++++++++++++
qapi/block-core.json | 229 +++++++
qapi/common.json | 14 +
qapi/machine.json | 16 +-
- 14 files changed, 1682 insertions(+), 14 deletions(-)
+ 14 files changed, 1687 insertions(+), 14 deletions(-)
create mode 100644 proxmox-backup-client.c
create mode 100644 proxmox-backup-client.h
create mode 100644 pve-backup.c
@@ -586,10 +586,10 @@ index 0000000000..8cbf645b2c
+#endif /* PROXMOX_BACKUP_CLIENT_H */
diff --git a/pve-backup.c b/pve-backup.c
new file mode 100644
-index 0000000000..d84d807654
+index 0000000000..5ed3c6a310
--- /dev/null
+++ b/pve-backup.c
-@@ -0,0 +1,1067 @@
+@@ -0,0 +1,1072 @@
+#include "proxmox-backup-client.h"
+#include "vma.h"
+
@@ -899,7 +899,12 @@ index 0000000000..d84d807654
+
+ qemu_co_mutex_lock(&backup_state.backup_mutex);
+
-+ if (ret < 0) {
++ /*
++ * All jobs in the transaction will be canceled when one receives an error.
++ * The first error wins, so only set it for ECANCELED if it was the last
++ * job. This allows more interesting errors from other jobs to win.
++ */
++ if (ret < 0 && (ret != -ECANCELED || !g_list_nth(backup_state.di_list, 1))) {
+ Error *local_err = NULL;
+ error_setg(&local_err, "job failed with err %d - %s", ret, strerror(-ret));
+ pvebackup_propagate_error(local_err);
diff --git a/debian/patches/pve/0034-PVE-Migrate-dirty-bitmap-state-via-savevm.patch b/debian/patches/pve/0034-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
index f6cd3c3..9414331 100644
--- a/debian/patches/pve/0034-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
+++ b/debian/patches/pve/0034-PVE-Migrate-dirty-bitmap-state-via-savevm.patch
@@ -174,10 +174,10 @@ index 0000000000..887e998b9e
+ NULL);
+}
diff --git a/pve-backup.c b/pve-backup.c
-index d84d807654..9c8b88d075 100644
+index 5ed3c6a310..6720e985bc 100644
--- a/pve-backup.c
+++ b/pve-backup.c
-@@ -1060,6 +1060,7 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
+@@ -1065,6 +1065,7 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)
ret->pbs_library_version = g_strdup(proxmox_backup_qemu_version());
ret->pbs_dirty_bitmap = true;
ret->pbs_dirty_bitmap_savevm = true;
--
2.39.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] applied-series: [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver
2024-01-09 14:09 [pve-devel] [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver Fiona Ebner
2024-01-09 14:10 ` [pve-devel] [PATCH qemu 2/2] backup: avoid bubbling up first ECANCELED error Fiona Ebner
@ 2024-03-12 12:22 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-03-12 12:22 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
Am 09/01/2024 um 15:09 schrieb Fiona Ebner:
> Makes it simpler and shorter. Still results in the same code after
> applying both patches in question.
>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> ...-Backup-add-backup-dump-block-driver.patch | 22 ++---
> ...ckup-Proxmox-backup-patches-for-QEMU.patch | 81 ++++---------------
> 2 files changed, 28 insertions(+), 75 deletions(-)
>
>
applied both patches, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-12 12:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 14:09 [pve-devel] [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver Fiona Ebner
2024-01-09 14:10 ` [pve-devel] [PATCH qemu 2/2] backup: avoid bubbling up first ECANCELED error Fiona Ebner
2024-03-12 12:22 ` [pve-devel] applied-series: [PATCH qemu 1/2] patch cleanup: squash backup dump driver change into patch introducing the driver Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox