[libvirt] [PATCH v3 REBASE 0/2] qemu: report block job errors from qemu to the user

2017-09-08 Thread Nikolay Shirokovskiy
So that you can see nice report on migration: "error: operation failed: migration of disk sda failed: No space left on device" diff from v2: 1. split into 2 patches 2. change formal documentation where it is present accordingly 3. add variable initialization for safet

Re: [libvirt] [PATCH] qemu: monitor: fix graceful shutdown corner cases

2017-09-08 Thread Nikolay Shirokovskiy
Ouch, I don't escape test patch [1] in message body so is is applied together with the main patch. Be careful. On 08.09.2017 10:16, Nikolay Shirokovskiy wrote: > Patch aeda1b8c needs some enhancement. > > 1. Shutdown event is delivired on reboot too and we don't want > to set wil

[libvirt] [PATCH] qemu: monitor: fix graceful shutdown corner cases

2017-09-08 Thread Nikolay Shirokovskiy
Patch aeda1b8c needs some enhancement. 1. Shutdown event is delivired on reboot too and we don't want to set willhangup flag is this case. 2. There is a next race condition. - EOF is delivered in event loop thread - qemuMonitorSend is called on client behalf and waits for notification on

Re: [libvirt] [PATCH v4 06/13] qemu: refactor fetching migration stats

2017-09-07 Thread Nikolay Shirokovskiy
On 07.09.2017 14:48, Jiri Denemark wrote: > On Fri, Sep 01, 2017 at 09:49:24 +0300, Nikolay Shirokovskiy wrote: >> qemuMigrationFetchJobStatus is rather inconvinient. Some of its >> callers don't need status to be updated, some don't need to update >> elapsed time right

[libvirt] [PATCH 0/4] qemu: fix restore domain with bypass cache flag

2017-09-07 Thread Nikolay Shirokovskiy
EINVAL is returned. Nikolay Shirokovskiy (4): iohelper: drop unused operation length limit iohelper: simplify last direct write alignment iohelper: reduce zero-out in align case iohelper: fix reading with O_DIRECT src/util/iohelper.c | 98

[libvirt] [PATCH 3/4] iohelper: reduce zero-out in align case

2017-09-07 Thread Nikolay Shirokovskiy
We only need to zero-out bytes that will be written. May be we even don't need to zero-out at all because of immediate truncate. --- src/util/iohelper.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 1896fd3..fe15a92

[libvirt] [PATCH 4/4] iohelper: fix reading with O_DIRECT

2017-09-07 Thread Nikolay Shirokovskiy
saferead is not suitable for direct reads. If file size is not multiple of align size then we get EINVAL on the read(2) that is supposed to return 0 because read buffer will not be aligned at this point. Let's not read again after partial read and check that we read everything by comparing the

[libvirt] [PATCH 1/4] iohelper: drop unused operation length limit

2017-09-07 Thread Nikolay Shirokovskiy
--- src/util/iohelper.c | 28 +++- src/util/virfile.c | 2 +- 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index d7bf5c7..5fc311b 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -44,7 +44,7 @@

[libvirt] [PATCH 2/4] iohelper: simplify last direct write alignment

2017-09-07 Thread Nikolay Shirokovskiy
Make alignment of last direct write more straightforward. Using additionally two flags 'end' and 'shortRead' looks complicated. --- src/util/iohelper.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c

[libvirt] [PATCH v4 10/13] qemu: introduce migrating job status

2017-09-01 Thread Nikolay Shirokovskiy
Instead of checking stat.status let's set status to migrating as soon as migrate command is send (waiting for completion is a good place too). --- src/qemu/qemu_domain.c| 1 + src/qemu/qemu_domain.h| 1 + src/qemu/qemu_driver.c| 4 +++- src/qemu/qemu_migration.c | 9 +++-- 4 files

[libvirt] [PATCH v4 07/13] qemu: simplify getting completed job stats

2017-09-01 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_driver.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 43244d0..fe41b9f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12987,12 +12987,17 @@

[libvirt] [PATCH v4 13/13] qemu: migration: don't expose incomplete job as complete

2017-09-01 Thread Nikolay Shirokovskiy
In case of real migration (not migrating to file on save, dump etc) migration info is not complete at time qemu finishes migration in normal (non postcopy) mode. We need to update disks stats, downtime info etc. Thus let's not expose this job status as completed. To archive this let's set status

[libvirt] [PATCH v4 06/13] qemu: refactor fetching migration stats

2017-09-01 Thread Nikolay Shirokovskiy
qemuMigrationFetchJobStatus is rather inconvinient. Some of its callers don't need status to be updated, some don't need to update elapsed time right away. So let's update status or elapsed time in callers instead. This patch drops updating job status on getting job stats by client. This way we

[libvirt] [PATCH v4 11/13] qemu: always get job condition on getting job stats

2017-09-01 Thread Nikolay Shirokovskiy
Looks like it is more simple to drop this optimization as we are going to add getting disks stats during migration via quering qemu process and checking if we have to acquire job condition becomes more complicate. --- src/qemu/qemu_driver.c | 15 +-- 1 file changed, 5 insertions(+),

[libvirt] [PATCH v4 05/13] qemu: drop excessive zero-out in qemuMigrationFetchJobStatus

2017-09-01 Thread Nikolay Shirokovskiy
qemuMonitorGetMigrationStats will do it for us anyway. --- src/qemu/qemu_migration.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 33171e5..e2760d1 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1387,7

[libvirt] [PATCH v4 02/13] qemu: introduce qemu domain job status

2017-09-01 Thread Nikolay Shirokovskiy
This patch simply switches code from using VIR_DOMAIN_JOB_* to introduced QEMU_DOMAIN_JOB_STATUS_*. Later this gives us freedom to introduce states for postcopy and mirroring phases. --- src/qemu/qemu_domain.c | 27 -- src/qemu/qemu_domain.h | 10 +++-

[libvirt] [PATCH v4 04/13] qemu: drop QEMU_MIGRATION_COMPLETED_UPDATE_STATS

2017-09-01 Thread Nikolay Shirokovskiy
This way we get stats only in one place. The former code waits for complete/postcopy status basically and don't need to mess with stats. The patch drops raising an error on stats updates failure. This does not make much sense anyway. --- src/qemu/qemu_migration.c | 24 +++- 1

[libvirt] [PATCH v4 03/13] qemu: introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY

2017-09-01 Thread Nikolay Shirokovskiy
Let's introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY state for job.current->status instead of checking job.current->stats.status. The latter can be changed when fetching migration statistics. Moving state function from the variable and leave only store function seems more managable. This patch removes

[libvirt] [PATCH v4 01/13] qemu: drop code for VIR_DOMAIN_JOB_BOUNDED and timeRemaining

2017-09-01 Thread Nikolay Shirokovskiy
qemu driver does not have VIR_DOMAIN_JOB_BOUNDED jobs and timeRemaining is always 0. --- src/qemu/qemu_domain.c | 7 --- src/qemu/qemu_domain.h | 1 - src/qemu/qemu_driver.c | 3 +-- src/qemu/qemu_migration_cookie.c | 5 - 4 files changed, 1 insertion(+), 15

[libvirt] [PATCH v4 12/13] qemu: migrate: add mirror stats to migration stats

2017-09-01 Thread Nikolay Shirokovskiy
When getting job info in case mirror does not reach ready phase fetch mirror stats from qemu. Otherwise mirror stats are already saved in current job. --- src/qemu/qemu_domain.c| 31 +++ src/qemu/qemu_domain.h| 9 src/qemu/qemu_driver.c| 5 +

[libvirt] [PATCH v4 00/13] qemu: migration: show disks stats for nbd migration

2017-09-01 Thread Nikolay Shirokovskiy
. Patches that were explicitly ACKed in previous review (up to style issues) marked with A. Nikolay Shirokovskiy (13): A qemu: drop code for VIR_DOMAIN_JOB_BOUNDED and timeRemaining A qemu: introduce qemu domain job status A qemu: introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY A qemu: drop

[libvirt] [PATCH v4 09/13] qemu: start all async job with job status active

2017-09-01 Thread Nikolay Shirokovskiy
Setting status to none has little value - getting job status will not return even elapsed time. After this patch getting job stats stays correct in a sence it will not fetch migration stats because it consults stats.status before doing the fetch. --- src/qemu/qemu_domain.c| 1 +

[libvirt] [PATCH v4 08/13] qemu: fail querying destination migration statistics always

2017-09-01 Thread Nikolay Shirokovskiy
Querying destination migration statistics may result in getting a failure or getting a elapsed time value depending on stats.status value which is odd. Instead let's always fail. Clients should be ready to handle this as currently getting failure period can be considerable. ---

[libvirt] [PATCH] qemu: handle -1 for pid in qemuDomainGetMachineName

2017-08-31 Thread Nikolay Shirokovskiy
We call qemuDomainGetMachineName on domain start. On first start (after daemon start) pid is 0 and virSystemdGetMachineNameByPID don't get called. But after domain shutting down pid became -1 so on next start virSystemdGetMachineNameByPID is called and returned an error. Error is ignored so it is

Re: [libvirt] [PATCH] keycodes: fix for 'make dist'

2017-08-31 Thread Nikolay Shirokovskiy
On 31.08.2017 10:25, Michal Privoznik wrote: > On 08/30/2017 01:19 PM, Nikolay Shirokovskiy wrote: >> 'make dist' fails with error now: >> >> make[2]: Entering directory `/root/dev/libvirt/src' >> make[2]: *** No rule to make target `linux', needed by `distdir

Re: [libvirt] [PATCH v3 REBASE 03/16] qemu: introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY

2017-08-30 Thread Nikolay Shirokovskiy
On 28.08.2017 17:55, Jiri Denemark wrote: > On Thu, Aug 24, 2017 at 09:56:40 +0300, Nikolay Shirokovskiy wrote: >> Current code consults job.current->stats.status to check for postcopy >> state. First it is more correct to check for both job.current->status >> and job

[libvirt] [PATCH] keycodes: fix for 'make dist'

2017-08-30 Thread Nikolay Shirokovskiy
'make dist' fails with error now: make[2]: Entering directory `/root/dev/libvirt/src' make[2]: *** No rule to make target `linux', needed by `distdir'. Stop It turns out that in am__libvirt_util_la_SOURCES_DIST variable KEYTABLES is not expanded correctly. Like 'linux' stays 'linux' instead of

Re: [libvirt] [PATCH v3 REBASE 13/16] qemu: support getting disks stats during stopping block jobs

2017-08-30 Thread Nikolay Shirokovskiy
On 30.08.2017 11:07, Jiri Denemark wrote: > On Thu, Aug 24, 2017 at 09:56:50 +0300, Nikolay Shirokovskiy wrote: >> Let's store disks stats for completed mirror jobs in current >> job info. So on getting migration job stats thru API >> we take records for completed jobs

Re: [libvirt] [PATCH v3 REBASE 12/16] qemu: migrate: show disks stats on job info requests

2017-08-30 Thread Nikolay Shirokovskiy
On 29.08.2017 18:20, Jiri Denemark wrote: > On Thu, Aug 24, 2017 at 09:56:49 +0300, Nikolay Shirokovskiy wrote: >> This patch shows incorrect info when client request comes >> when migration routine is stopping mirror jobs or mirror >> jobs already stopped. This issue will

Re: [libvirt] [PATCH v3 REBASE 06/16] qemu: refactor fetching migration stats

2017-08-30 Thread Nikolay Shirokovskiy
On 29.08.2017 16:45, Jiri Denemark wrote: > On Thu, Aug 24, 2017 at 09:56:43 +0300, Nikolay Shirokovskiy wrote: >> qemuMigrationFetchJobStatus is rather inconvinient. Some of its >> callers don't need status to be updated, some don't need to update >> elapsed time right

[libvirt] [PATCH v3 REBASE 02/16] qemu: introduce qemu domain job status

2017-08-24 Thread Nikolay Shirokovskiy
This patch simply switches code from using VIR_DOMAIN_JOB_* to introduced QEMU_DOMAIN_JOB_STATUS_*. Later this gives us freedom to introduce states for postcopy and mirroring phases. --- src/qemu/qemu_domain.c | 27 -- src/qemu/qemu_domain.h | 10 +++-

[libvirt] [PATCH v3 REBASE 12/16] qemu: migrate: show disks stats on job info requests

2017-08-24 Thread Nikolay Shirokovskiy
This patch shows incorrect info when client request comes when migration routine is stopping mirror jobs or mirror jobs already stopped. This issue will be addressed in next patch. --- src/qemu/qemu_driver.c| 4 src/qemu/qemu_migration.c | 49

[libvirt] [PATCH v3 REBASE 01/16] qemu: drop code for VIR_DOMAIN_JOB_BOUNDED and timeRemaining

2017-08-24 Thread Nikolay Shirokovskiy
qemu driver does not have VIR_DOMAIN_JOB_BOUNDED jobs and timeRemaining is always 0. --- src/qemu/qemu_domain.c | 7 --- src/qemu/qemu_domain.h | 1 - src/qemu/qemu_migration_cookie.c | 5 - 3 files changed, 13 deletions(-) diff --git a/src/qemu/qemu_domain.c

[libvirt] [PATCH v3 REBASE 16/16] qemu: migration: don't expose incomplete job as complete

2017-08-24 Thread Nikolay Shirokovskiy
In case of real migration (not migrating to file on save, dump etc) migration info is not complete at time qemu finishes migration in normal (non postcopy) mode. We need to update disks stats, downtime info etc. Thus let's not expose this job status as completed. To archive this let's set status

[libvirt] [PATCH v3 REBASE 06/16] qemu: refactor fetching migration stats

2017-08-24 Thread Nikolay Shirokovskiy
qemuMigrationFetchJobStatus is rather inconvinient. Some of its callers don't need status to be updated, some don't need to update elapsed time right away. So let's update status or elapsed time in callers instead. In qemuMigrationConfirmPhase we should fetch stats with copy flag set as stats

[libvirt] [PATCH v3 REBASE 13/16] qemu: support getting disks stats during stopping block jobs

2017-08-24 Thread Nikolay Shirokovskiy
Let's store disks stats for completed mirror jobs in current job info. So on getting migration job stats thru API we take records for completed jobs from current job info and records for still active jobs by querying qemu process. As we need to keep disks stats for completed mirror jobs in

[libvirt] [PATCH v3 REBASE 14/16] qemu: migation: resolve race on getting job info and stopping block jobs

2017-08-24 Thread Nikolay Shirokovskiy
During stopping mirror block jobs vm lock is droped on awating block job events, thus next scenario is possible: 1. stop mirror block job is sent 2. migration routine awaits for block job event 3. mirror job stopped and event send 4. getting migration job info routine asks for block job info and

[libvirt] [PATCH v3 REBASE 03/16] qemu: introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY

2017-08-24 Thread Nikolay Shirokovskiy
Current code consults job.current->stats.status to check for postcopy state. First it is more correct to check for both job.current->status and job.current->stats.status.code because on some paths on failures we change only the former. Second if qemu supports migration events then stats can change

[libvirt] [PATCH v3 REBASE 11/16] qemu: always get job condition on getting job stats

2017-08-24 Thread Nikolay Shirokovskiy
Looks like it is more simple to drop this optimization as we are going to add getting disks stats during migration via quering qemu process and checking if we have to acquire job condition becomes more complicate. --- src/qemu/qemu_driver.c | 15 +-- 1 file changed, 5 insertions(+),

[libvirt] [PATCH v3 REBASE 10/16] qemu: introduce migrating job status

2017-08-24 Thread Nikolay Shirokovskiy
Instead of checking stat.status let's set status to migrating as soon as migrate command is send (waiting for completion is a good place too). --- src/qemu/qemu_domain.c| 1 + src/qemu/qemu_domain.h| 1 + src/qemu/qemu_driver.c| 4 +++- src/qemu/qemu_migration.c | 9 +++-- 4 files

[libvirt] [PATCH v3 REBASE 15/16] qemu: migrate: copy disks stats to completed job

2017-08-24 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_migration.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 906f8fe..54cfdd0 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3867,6 +3867,13 @@ qemuMigrationRun(virQEMUDriverPtr

[libvirt] [PATCH v3 REBASE 04/16] qemu: drop QEMU_MIGRATION_COMPLETED_UPDATE_STATS

2017-08-24 Thread Nikolay Shirokovskiy
This way we get stats only in one place. The former code waits for complete/postcopy status basically and don't need to mess with stats. The patch drops raising an error on stats updates failure. This does not make much sense anyway. --- src/qemu/qemu_migration.c | 24 +++- 1

[libvirt] [PATCH v3 REBASE 09/16] qemu: start all async job with job status active

2017-08-24 Thread Nikolay Shirokovskiy
Setting status to none has little value - getting job status will not return even elapsed time. After this patch getting job stats stays correct in a sence it will not fetch migration stats because it consults stats.status before doing the fetch. --- src/qemu/qemu_domain.c| 1 +

[libvirt] [PATCH v3 REBASE 07/16] qemu: simplify getting completed job stats

2017-08-24 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_driver.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c62d416..b8a4df7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -12905,12 +12905,18 @@

[libvirt] [PATCH v3 REBASE 00/16] qemu: migration: show disks stats for nbd migration

2017-08-24 Thread Nikolay Shirokovskiy
] memory migration stats example Memory processed: 3.307 MiB Memory remaining: 0.000 B Memory total: 1.032 GiB Nikolay Shirokovskiy (16): qemu: drop code for VIR_DOMAIN_JOB_BOUNDED and timeRemaining A qemu: introduce qemu domain job status A qemu: introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY A qemu

[libvirt] [PATCH v3 REBASE 05/16] qemu: drop excessive zero-out in qemuMigrationFetchJobStatus

2017-08-24 Thread Nikolay Shirokovskiy
qemuMonitorGetMigrationStats will do it for us anyway. --- src/qemu/qemu_migration.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index b7ad65d..cc42f7a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1387,7

[libvirt] [PATCH v3 REBASE 08/16] qemu: fail querying destination migration statistics always

2017-08-24 Thread Nikolay Shirokovskiy
Querying destination migration statistics may result in getting a failure or getting a elapsed time value depending on stats.status value which is odd. Instead let's always fail. Clients should be ready to handle this as currently getting failure period can be considerable. ---

[libvirt] [PATCH] vz: build fix

2017-08-24 Thread Nikolay Shirokovskiy
6e6faf6d changed vzDomObjAlloc signature in source but not in header file. --- src/vz/vz_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h index ea2e2da..d213183 100644 --- a/src/vz/vz_utils.h +++ b/src/vz/vz_utils.h @@ -116,7 +116,7

Re: [libvirt] [PATCH v2] vz: support disabled items in vz boot order

2017-08-23 Thread Nikolay Shirokovskiy
On 03.08.2017 15:18, John Ferlan wrote: > > > On 06/30/2017 02:34 AM, Nikolay Shirokovskiy wrote: >> At the time the check was written virtuozzo did not use disabled items in >> boot >> order configuration. Boot items were always enabled. Now they can be disa

Re: [libvirt] [PATCH v2] qemu: command: align disk serial check to schema

2017-08-23 Thread Nikolay Shirokovskiy
On 03.08.2017 02:24, John Ferlan wrote: > > > On 03/28/2017 04:10 AM, Nikolay Shirokovskiy wrote: >> Disk serial schema has extra '.+' allowed characters in comparison >> with check in code. Looks like there is no reason for that as qemu >> allows any

Re: [libvirt] [PATCH v3 00/16] qemu: migration: show disks stats for nbd migration

2017-07-20 Thread Nikolay Shirokovskiy
On 14.07.2017 12:20, Jiri Denemark wrote: > On Fri, Jul 14, 2017 at 09:51:48 +0300, Nikolay Shirokovskiy wrote: >> ping > > Oops, I completely forgot about this series. But since it is a few > months old, could you resend the series after rebasing it to current > libvirt

Re: [libvirt] [PATCH v3 00/16] qemu: migration: show disks stats for nbd migration

2017-07-14 Thread Nikolay Shirokovskiy
ping On 11.04.2017 10:39, Nikolay Shirokovskiy wrote: > diff from v2: > > > 1. Fix style issues. > 2. Rework patch for fetching job info >(save logic to use temporary variable when drop vm lock) > 3. Update disk stats when block jobs are canceled. > 4.

[libvirt] [PATCH v2] vz: support disabled items in vz boot order

2017-06-30 Thread Nikolay Shirokovskiy
At the time the check was written virtuozzo did not use disabled items in boot order configuration. Boot items were always enabled. Now they can be disabled as well. Supporting such items is easy - they just should be ignored. --- src/vz/vz_sdk.c | 7 ++- 1 file changed, 2 insertions(+), 5

[libvirt] [PATCH] vz: support disabled items in prlsdk boot order

2017-06-29 Thread Nikolay Shirokovskiy
--- src/vz/vz_sdk.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 8ccd7ea..a6eb0dd 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1736,11 +1736,8 @@ prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def)

Re: [libvirt] [PATCH v2 RFC 0/4] qemu: replace nested job with interruptible async job state

2017-05-25 Thread Nikolay Shirokovskiy
ping On 02.05.2017 13:06, Nikolay Shirokovskiy wrote: > This is the next version of RFC [1] 'drop nested job concept'. Actually > it is quite different from the first. Patches that accomodate callers to > use functions to enter/exit monitor with without driver and asyncJob arguments &g

[libvirt] [PATCH] vz: support virDomainGetBlockInfo in driver

2017-05-15 Thread Nikolay Shirokovskiy
Actually physical size is not available in vz sdk right now so let's set it to allocation as an estimation in non sparse case. --- src/vz/vz_driver.c | 50 ++ src/vz/vz_sdk.c| 23 +++ src/vz/vz_sdk.h| 1 + 3 files

[libvirt] [PATCH v2 RFC 07/12] qemu: backup: add qemuDomainBackupCreateXML implementation

2017-05-12 Thread Nikolay Shirokovskiy
Supported options - backup to file or block device - specify format of backup --- src/conf/backup_conf.c | 32 ++ src/conf/backup_conf.h | 5 +++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 112 ++- 4 files changed,

[libvirt] [PATCH v2 RFC 00/12] introduce push backups

2017-05-12 Thread Nikolay Shirokovskiy
/archives/libvir-list/2016-March/msg00937.html [2] https://www.redhat.com/archives/libvir-list/2016-September/msg00192.html [3] https://www.redhat.com/archives/libvir-list/2017-May/msg00130.html Nikolay Shirokovskiy (12): api: backup: add api to create backup api: backup: add driver based

[libvirt] [PATCH v2 RFC 12/12] docs: add backup html docs

2017-05-12 Thread Nikolay Shirokovskiy
--- docs/Makefile.am | 3 +++ docs/apibuild.py | 2 ++ docs/docs.html.in | 4 +++- docs/format.html.in | 1 + docs/formatbackup.html.in | 58 +++ docs/index.html.in| 3 ++- 6 files changed, 69 insertions(+),

[libvirt] [PATCH v2 RFC 03/12] remote: backup: add create backup implementation

2017-05-12 Thread Nikolay Shirokovskiy
--- daemon/remote.c | 8 src/access/viraccessperm.c | 3 ++- src/access/viraccessperm.h | 6 ++ src/remote/remote_driver.c | 7 +++ src/remote/remote_protocol.x | 23 ++- src/rpc/gendispatch.pl | 29 ++--- 6

[libvirt] [PATCH v2 RFC 02/12] api: backup: add driver based implementation

2017-05-12 Thread Nikolay Shirokovskiy
--- include/libvirt/virterror.h | 2 + src/Makefile.am | 2 + src/datatypes.c | 60 + src/datatypes.h | 29 ++ src/driver-hypervisor.h | 5 ++ src/libvirt-domain-backup.c | 209

[libvirt] [PATCH v2 RFC 06/12] conf: backup: add backup xml definition

2017-05-12 Thread Nikolay Shirokovskiy
Backup xml description is like this: backup name - element is optional. - disk @type attribute is optional, default to 'file'. Valid values are 'file', 'block', 'dir', 'network', 'volume' just as usual for specifing domain disk sources. It specifies backup type. -

[libvirt] [PATCH v2 RFC 04/12] backup: qemu: monitor: add drive-backup command

2017-05-12 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_monitor.c | 14 ++ src/qemu/qemu_monitor.h | 5 + src/qemu/qemu_monitor_json.c | 34 ++ src/qemu/qemu_monitor_json.h | 5 + 4 files changed, 58 insertions(+) diff --git a/src/qemu/qemu_monitor.c

[libvirt] [PATCH v2 RFC 09/12] qemu: backup: prepare backup destination

2017-05-12 Thread Nikolay Shirokovskiy
Prepare here is usual preparation for a disk to be used by qemu made by qemuDomainDiskChainElementPrepare. That is set security labels, add to lock manager and whitelist in cgroups. All three are related to backup target too. Adding to a lock manager is less obvious but can be useful if mirations

[libvirt] [PATCH v2 RFC 05/12] backup: misc: add backup block job type

2017-05-12 Thread Nikolay Shirokovskiy
--- examples/object-events/event-test.c | 3 +++ include/libvirt/libvirt-domain.h| 3 +++ src/conf/domain_conf.c | 2 +- src/qemu/qemu_monitor_json.c| 2 ++ tools/virsh-domain.c| 3 ++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH v2 RFC 08/12] qemu: backup: check backup destination before start

2017-05-12 Thread Nikolay Shirokovskiy
If backup target is file then check it is not present or regular empty file otherwise. If backup target is block device then check that it is present and block device actually. --- src/qemu/qemu_driver.c | 73 ++ 1 file changed, 73 insertions(+)

[libvirt] [PATCH v2 RFC 01/12] api: backup: add api to create backup

2017-05-12 Thread Nikolay Shirokovskiy
+ * Author: Nikolay Shirokovskiy <nshirokovs...@virtuozzo.com> + * + * Copyright (C) 2017 Parallels International GmbH + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free So

[libvirt] [PATCH v2 RFC 11/12] schema: backup: add schema and its tests

2017-05-12 Thread Nikolay Shirokovskiy
--- docs/schemas/domainbackup.rng | 79 ++ tests/domainbackupxml/block_target.xml | 5 ++ tests/domainbackupxml/explicit_description.xml | 6 ++ tests/domainbackupxml/explicit_file_type.xml | 5 ++ tests/domainbackupxml/explicit_format.xml

[libvirt] [PATCH v2 RFC 10/12] virsh: backup: add backup-create command

2017-05-12 Thread Nikolay Shirokovskiy
--- po/POTFILES.in | 1 + tools/Makefile.am| 1 + tools/virsh-backup.c | 100 +++ tools/virsh-backup.h | 29 +++ tools/virsh-util.c | 11 ++ tools/virsh-util.h | 3 ++ tools/virsh.c| 2 ++

[libvirt] [PATCH] docs: install html fonts and related

2017-05-11 Thread Nikolay Shirokovskiy
--- docs/Makefile.am | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 105fe68..7a10a50 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -54,6 +54,20 @@ css = \ libvirt.css \ main.css +fonts

Re: [libvirt] [RFC PATCH REBASE 00/10] introduce push backups

2017-05-10 Thread Nikolay Shirokovskiy
On 10.05.2017 11:11, Daniel P. Berrange wrote: > On Fri, May 05, 2017 at 09:22:21AM +0300, Nikolay Shirokovskiy wrote: >> Push backup is a backup when hypervisor itself copy backup data to >> destination >> in contrast to pull backup when hypervisor exports backup data t

[libvirt] [RFC PATCH REBASE 01/10] api: backup: add api to create backup

2017-05-05 Thread Nikolay Shirokovskiy
+ * Author: Nikolay Shirokovskiy <nshirokovs...@virtuozzo.com> + * + * Copyright (C) 2017 Parallels International GmbH + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free So

[libvirt] [RFC PATCH REBASE 09/10] qemu: backup: prepare backup destination

2017-05-05 Thread Nikolay Shirokovskiy
Prepare here is usual preparation for a disk to be used by qemu made by qemuDomainDiskChainElementPrepare. That is set security labels, add to lock manager and whitelist in cgroups. All three are related to backup target too. Adding to a lock manager is less obvious but can be useful if mirations

[libvirt] [RFC PATCH REBASE 06/10] conf: backup: add backup xml definition

2017-05-05 Thread Nikolay Shirokovskiy
Backup xml description is like this: backup name - element is optional. - disk @type attribute is optional, default to 'file'. Valid values are 'file', 'block', 'dir', 'network', 'volume' just as usual for specifing domain disk sources. It specifies backup type. -

[libvirt] [RFC PATCH REBASE 02/10] api: backup: add driver based implementation

2017-05-05 Thread Nikolay Shirokovskiy
--- include/libvirt/virterror.h | 2 + src/Makefile.am | 2 + src/datatypes.c | 60 + src/datatypes.h | 29 +++ src/driver-hypervisor.h | 5 ++ src/libvirt-domain-backup.c | 202

[libvirt] [RFC PATCH REBASE 04/10] backup: qemu: monitor: add drive-backup command

2017-05-05 Thread Nikolay Shirokovskiy
--- src/qemu/qemu_monitor.c | 14 ++ src/qemu/qemu_monitor.h | 5 + src/qemu/qemu_monitor_json.c | 34 ++ src/qemu/qemu_monitor_json.h | 5 + 4 files changed, 58 insertions(+) diff --git a/src/qemu/qemu_monitor.c

[libvirt] [RFC PATCH REBASE 00/10] introduce push backups

2017-05-05 Thread Nikolay Shirokovskiy
and retry if job to be aborted is completed meanwhile. Of coures this series is far from being complete. Incremental backups and backup persistent metadata is to be implemented. Let's just start work in this direction. Nikolay Shirokovskiy (10): api: backup: add api to create backup api: backup

[libvirt] [RFC PATCH REBASE 07/10] qemu: backup: add qemuDomainBackupCreateXML implementation

2017-05-05 Thread Nikolay Shirokovskiy
Supported options - backup to file or block device - specify format of backup --- src/conf/backup_conf.c | 32 ++ src/conf/backup_conf.h | 5 +++ src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 112 ++- 4 files changed,

[libvirt] [RFC PATCH REBASE 08/10] qemu: backup: check backup destination before start

2017-05-05 Thread Nikolay Shirokovskiy
If backup target is file then check it is not present or regular empty file otherwise. If backup target is block device then check that it is present and block device actually. --- src/qemu/qemu_driver.c | 73 ++ 1 file changed, 73 insertions(+)

[libvirt] [RFC PATCH REBASE 05/10] backup: misc: add backup block job type

2017-05-05 Thread Nikolay Shirokovskiy
--- examples/object-events/event-test.c | 3 +++ include/libvirt/libvirt-domain.h| 3 +++ src/conf/domain_conf.c | 2 +- src/qemu/qemu_monitor_json.c| 2 ++ tools/virsh-domain.c| 3 ++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git

[libvirt] [RFC PATCH REBASE 03/10] remote: backup: add create backup implementation

2017-05-05 Thread Nikolay Shirokovskiy
--- daemon/remote.c | 8 src/access/viraccessperm.c | 3 ++- src/access/viraccessperm.h | 6 ++ src/remote/remote_driver.c | 7 +++ src/remote/remote_protocol.x | 23 ++- src/rpc/gendispatch.pl | 29 ++--- 6

Re: [libvirt] [PATCH 1/1] vz: minor cleanup in prlsdkDomainSetUserPassword

2017-05-03 Thread Nikolay Shirokovskiy
On 03.05.2017 13:44, Konstantin Neumoin wrote: > No need begin job for asynchronous operation. > > Signed-off-by: Konstantin Neumoin > --- > src/vz/vz_sdk.c | 16 ++-- > 1 file changed, 2 insertions(+), 14 deletions(-) > > diff --git a/src/vz/vz_sdk.c

Re: [libvirt] [PATCH 1/1] vz: fix raise in vzDomainBlock

2017-05-03 Thread Nikolay Shirokovskiy
On 03.05.2017 13:44, Konstantin Neumoin wrote: > Need begin job before lookup disk in config, > because it can be edited at this moment. I would slightly change commit message to something like: Put domain access after acquiring job condition, otherwise another job can change it meanwhile.

Re: [libvirt] [PATCH 1/1] vz: unlock dom until resize operation

2017-05-03 Thread Nikolay Shirokovskiy
On 03.05.2017 14:23, Konstantin Neumoin wrote: > We have to use waitDomainJob instead of waitJob, because of it > unlock the domain until job has finished, so domain will be available > for other clients. > > Signed-off-by: Konstantin Neumoin > --- > src/vz/vz_sdk.c |

[libvirt] [PATCH v2 RFC 4/4] qemu: remove the rest of nested job parts

2017-05-02 Thread Nikolay Shirokovskiy
It is not clear whether nested job could be saved in status file or not so it stays in job types enum. --- src/qemu/qemu_domain.c | 28 +--- src/qemu/qemu_domain.h | 6 +- src/qemu/qemu_process.c | 2 +- 3 files changed, 3 insertions(+), 33 deletions(-) diff --git

[libvirt] [PATCH v2 RFC 3/4] qemu: remove nesting job usage from qemuProcessStop

2017-05-02 Thread Nikolay Shirokovskiy
81f50cb92 adds getting nested job on stopping domain to prevent leaking of monitor object on race between aborting job and stopping domain cased by that abort. One of the causes of this problem is that async job and concurrent regular job were not fully isolated and async job can continue to run

[libvirt] [PATCH v2 RFC 2/4] qemu: remove liveness check from qemuDomainObjExitMonitor

2017-05-02 Thread Nikolay Shirokovskiy
As qemuProcessStop is called only in the context of some job and jobs can not overlap now this check becomes useless. Previously async job can continue to run while concurrent regular job is still waiting for qemu response. Now it is not possible. --- src/qemu/qemu_domain.c | 33

[libvirt] [PATCH v2 RFC 1/4] qemu: replace nested job with interruptible async job state

2017-05-02 Thread Nikolay Shirokovskiy
Nested job is a construction that gives way to run regular jobs while async job is running. But the period when another job is actually can be started is when async job waits for some event with domain lock dropped. Let's code this condition straitforward using asyncInterruptible flag. Upon

[libvirt] [PATCH v2 RFC 0/4] qemu: replace nested job with interruptible async job state

2017-05-02 Thread Nikolay Shirokovskiy
://www.redhat.com/archives/libvir-list/2016-November/msg01357.html Nikolay Shirokovskiy (4): qemu: replace nested job with interruptible async job state qemu: remove liveness check from qemuDomainObjExitMonitor qemu: remove nesting job usage from qemuProcessStop qemu: remove the rest of nested

Re: [libvirt] [PATCH 0/2] qemu: migration: bugfixes for cancelling drive mirror

2017-04-27 Thread Nikolay Shirokovskiy
On 27.04.2017 15:40, Jiri Denemark wrote: > On Fri, Apr 07, 2017 at 14:06:23 +0300, Nikolay Shirokovskiy wrote: >> Nikolay Shirokovskiy (2): >> qemu: take current async job into account in qemuBlockNodeNamesDetect >> qemu: migration: fix race on cancelling drive m

Re: [libvirt] [PATCH 0/2] qemu: migration: bugfixes for cancelling drive mirror

2017-04-24 Thread Nikolay Shirokovskiy
ping On 07.04.2017 14:06, Nikolay Shirokovskiy wrote: > Nikolay Shirokovskiy (2): > qemu: take current async job into account in qemuBlockNodeNamesDetect > qemu: migration: fix race on cancelling drive mirror > > src/qemu/qemu_block.c | 6 -- > src/qemu/qem

Re: [libvirt] [PATCH 2/2] vz: support virDomainBlockResize

2017-04-14 Thread Nikolay Shirokovskiy
On 14.04.2017 13:01, Konstantin Neumoin wrote: > Signed-off-by: Konstantin Neumoin > --- > src/vz/vz_driver.c | 58 > ++ > src/vz/vz_sdk.c| 37 ++ > src/vz/vz_sdk.h| 1 + > 3

Re: [libvirt] [PATCH 1/2] vz: support virDomainSetVcpus

2017-04-14 Thread Nikolay Shirokovskiy
On 14.04.2017 13:01, Konstantin Neumoin wrote: > Signed-off-by: Konstantin Neumoin > --- > src/vz/vz_driver.c | 43 +++ > src/vz/vz_sdk.c| 23 +++ > src/vz/vz_sdk.h| 1 + > 3 files changed, 67

Re: [libvirt] [PATCH] qemu: fix crash on getting block stats for empty cdrom

2017-04-13 Thread Nikolay Shirokovskiy
Ok, forget about it) because c3de3873 "qemu: Don't update physical storage size of empty drives" is already in upstream. On 30.01.2017 10:14, Nikolay Shirokovskiy wrote: > Looks like it was introduced in c5f61513. Before this commit handling empty > cdrom > was correct be

Re: [libvirt] [PATCH v2] qemu: command: align disk serial check to schema

2017-04-12 Thread Nikolay Shirokovskiy
ping On 28.03.2017 11:10, Nikolay Shirokovskiy wrote: > Disk serial schema has extra '.+' allowed characters in comparison > with check in code. Looks like there is no reason for that as qemu > allows any character AFAIK for serial. This discrepancy is originated > in 85d15b51 w

[libvirt] [PATCH v3 03/16] qemu: introduce QEMU_DOMAIN_JOB_STATUS_POSTCOPY

2017-04-11 Thread Nikolay Shirokovskiy
Current code consults job.current->stats.status to check for postcopy state. First it is more correct to check for both job.current->status and job.current->stats.status.code because on some paths on failures we change only the former. Second if qemu supports migration events then stats can change

[libvirt] [PATCH v3 10/16] qemu: introduce migrating job status

2017-04-11 Thread Nikolay Shirokovskiy
Instead of checking stat.status let's set status to migrating as soon as migrate command is send (waiting for completion is a good place too). --- src/qemu/qemu_domain.c| 1 + src/qemu/qemu_domain.h| 1 + src/qemu/qemu_driver.c| 4 +++- src/qemu/qemu_migration.c | 9 +++-- 4 files

[libvirt] [PATCH v3 11/16] qemu: always get job condition on getting job stats

2017-04-11 Thread Nikolay Shirokovskiy
Looks like it is more simple to drop this optimization as we are going to add getting disks stats during migration via quering qemu process and checking if we have to acquire job condition becomes more complicate. --- src/qemu/qemu_driver.c | 15 +-- 1 file changed, 5 insertions(+),

[libvirt] [PATCH v3 14/16] qemu: migation: resolve race on getting job info and stopping block jobs

2017-04-11 Thread Nikolay Shirokovskiy
During stopping mirror block jobs vm lock is droped on awating block job events, thus next scenario is possible: 1. stop mirror block job is sent 2. migration routine awaits for block job event 3. mirror job stopped and event send 4. getting migration job info routine asks for block job info and

[libvirt] [PATCH v3 13/16] qemu: support getting disks stats during stopping block jobs

2017-04-11 Thread Nikolay Shirokovskiy
Let's store disks stats for completed mirror jobs in current job info. So on getting migration job stats thru API we take records for completed jobs from current job info and records for still active jobs by querying qemu process. As we need to keep disks stats for completed mirror jobs in

<    4   5   6   7   8   9   10   11   12   13   >