PVE backup: don't call no_co_wrapper function from coroutine

Namely, pvebackup_co_prepare() needs to call bdrv_co_open() rather
than bdrv_open(), because it is a coroutine itself.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
master
Fiona Ebner 2023-05-15 15:39:55 +02:00 committed by Thomas Lamprecht
parent 53b56ca781
commit b64c4dec1c
15 changed files with 18 additions and 18 deletions

View File

@ -510,7 +510,7 @@ index 0000000000..1dda8b7d8f
+#endif /* PROXMOX_BACKUP_CLIENT_H */
diff --git a/pve-backup.c b/pve-backup.c
new file mode 100644
index 0000000000..389d6c84a0
index 0000000000..f77892a509
--- /dev/null
+++ b/pve-backup.c
@@ -0,0 +1,938 @@
@ -1253,7 +1253,7 @@ index 0000000000..389d6c84a0
+ goto err;
+ }
+
+ di->target = bdrv_open(di->targetfile, NULL, NULL, flags, &local_err);
+ di->target = bdrv_co_open(di->targetfile, NULL, NULL, flags, &local_err);
+ if (!di->target) {
+ error_propagate(task->errp, local_err);
+ goto err;

View File

@ -132,7 +132,7 @@ index 1dda8b7d8f..8cbf645b2c 100644
diff --git a/pve-backup.c b/pve-backup.c
index 389d6c84a0..c4cbff7fb1 100644
index f77892a509..d9942a14a1 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -7,6 +7,7 @@

View File

@ -36,7 +36,7 @@ index cda5de792b..ecbebd39ac 100644
NULL, NULL,
devlist, qdict_haskey(qdict, "speed"), speed, &error);
diff --git a/pve-backup.c b/pve-backup.c
index c4cbff7fb1..95f742e1d1 100644
index d9942a14a1..8f18145255 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -10,6 +10,7 @@

View File

@ -16,7 +16,7 @@ Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 files changed, 38 insertions(+)
diff --git a/pve-backup.c b/pve-backup.c
index 95f742e1d1..9eb8645e63 100644
index 8f18145255..1400c21c49 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -1054,3 +1054,12 @@ BackupStatus *qmp_query_backup(Error **errp)

View File

@ -69,7 +69,7 @@ index 087161a967..9a67e544ce 100644
info->zero_bytes, zero_per);
diff --git a/pve-backup.c b/pve-backup.c
index 9eb8645e63..2db35f90e0 100644
index 1400c21c49..0a0996b971 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -48,6 +48,7 @@ static struct PVEBackupState {
@ -255,7 +255,7 @@ index 9eb8645e63..2db35f90e0 100644
+ goto err_mutex;
}
di->target = bdrv_open(di->targetfile, NULL, NULL, flags, &local_err);
di->target = bdrv_co_open(di->targetfile, NULL, NULL, flags, &local_err);
if (!di->target) {
error_propagate(task->errp, local_err);
- goto err;

View File

@ -20,7 +20,7 @@ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
1 file changed, 50 insertions(+), 113 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
index 2db35f90e0..b4bc2de76e 100644
index 0a0996b971..629da3e6c7 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -54,6 +54,7 @@ static struct PVEBackupState {

View File

@ -57,7 +57,7 @@ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2 files changed, 138 insertions(+), 79 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
index b4bc2de76e..6d6d7708b6 100644
index 629da3e6c7..1da9dd9edc 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -35,7 +35,9 @@ const char *PBS_BITMAP_NAME = "pbs-incremental-dirty-bitmap";

View File

@ -175,7 +175,7 @@ index 0000000000..887e998b9e
+ NULL);
+}
diff --git a/pve-backup.c b/pve-backup.c
index 6d6d7708b6..e9264e5025 100644
index 1da9dd9edc..e0e38063a8 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -1110,6 +1110,7 @@ ProxmoxSupportStatus *qmp_query_proxmox_support(Error **errp)

View File

@ -119,7 +119,7 @@ index 4ce7bc0b5e..0923037dec 100644
static void proxmox_backup_schedule_wake(void *data) {
CoCtxData *waker = (CoCtxData *)data;
diff --git a/pve-backup.c b/pve-backup.c
index e9264e5025..4536650b24 100644
index e0e38063a8..88e507b3c2 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -356,7 +356,7 @@ static void job_cancel_bh(void *opaque) {
@ -423,7 +423,7 @@ index e9264e5025..4536650b24 100644
goto err_mutex;
}
di->target = bdrv_open(di->targetfile, NULL, NULL, flags, &local_err);
di->target = bdrv_co_open(di->targetfile, NULL, NULL, flags, &local_err);
if (!di->target) {
- error_propagate(task->errp, local_err);
+ error_propagate(errp, local_err);

View File

@ -33,7 +33,7 @@ index 56f39b14d4..f852c70611 100644
NULL, // PBS backup-id
false, 0, // PBS backup-time
diff --git a/pve-backup.c b/pve-backup.c
index 4536650b24..0d8bf1c332 100644
index 88e507b3c2..04c5f561cd 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -531,6 +531,7 @@ UuidInfo coroutine_fn *qmp_backup(

View File

@ -172,7 +172,7 @@ index 2f834cf42e..f03d9bab8d 100644
fprintf(stderr, "restore failed: %s\n", pbs_error);
return -1;
diff --git a/pve-backup.c b/pve-backup.c
index 0d8bf1c332..8a4ecba394 100644
index 04c5f561cd..08dfb9cbda 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -12,6 +12,8 @@

View File

@ -21,7 +21,7 @@ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
index 8a4ecba394..5eba2abde0 100644
index 08dfb9cbda..79d14d6a0b 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -505,6 +505,11 @@ static void create_backup_jobs_bh(void *opaque) {

View File

@ -23,7 +23,7 @@ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
index 5eba2abde0..99a91f88b2 100644
index 79d14d6a0b..67e2b99d74 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -318,6 +318,13 @@ static void coroutine_fn pvebackup_co_complete_stream(void *opaque)

View File

@ -39,7 +39,7 @@ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
1 file changed, 38 insertions(+), 19 deletions(-)
diff --git a/pve-backup.c b/pve-backup.c
index 99a91f88b2..04c8ce0a3d 100644
index 67e2b99d74..7a8240363d 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -356,12 +356,41 @@ static void pvebackup_complete_cb(void *opaque, int ret)

View File

@ -46,7 +46,7 @@ index ac23f21eef..636509b83e 100644
hmp_handle_error(mon, error);
}
diff --git a/pve-backup.c b/pve-backup.c
index 04c8ce0a3d..56da408001 100644
index 7a8240363d..cb5312fff3 100644
--- a/pve-backup.c
+++ b/pve-backup.c
@@ -57,6 +57,7 @@ static struct PVEBackupState {