[libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-21 Thread Daniel P. Berrange
The save process was relying on use of the shell >> append operator to ensure the save data was placed after the libvirt header + XML. This doesn't work for block devices though. Replace this code with use of 'dd' and its 'seek' parameter. The qemuMonitorMigateToCommand() monitor API is used for b

[libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel P. Berrange
The save process was relying on use of the shell >> append operator to ensure the save data was placed after the libvirt header + XML. This doesn't work for block devices though. Replace this code with use of 'dd' and its 'seek' parameter. This means that we need to pad the header + XML out to a mu

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-21 Thread Daniel Veillard
On Wed, Apr 21, 2010 at 05:56:12PM +0100, Daniel P. Berrange wrote: > The save process was relying on use of the shell >> append > operator to ensure the save data was placed after the libvirt > header + XML. This doesn't work for block devices though. > Replace this code with use of 'dd' and its '

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-21 Thread Eric Blake
On 04/21/2010 10:56 AM, Daniel P. Berrange wrote: > The save process was relying on use of the shell >> append > operator to ensure the save data was placed after the libvirt > header + XML. This doesn't work for block devices though. > Replace this code with use of 'dd' and its 'seek' parameter. >

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel P. Berrange
On Wed, Apr 21, 2010 at 11:02:33PM +0200, Daniel Veillard wrote: > On Wed, Apr 21, 2010 at 05:56:12PM +0100, Daniel P. Berrange wrote: > > The save process was relying on use of the shell >> append > > operator to ensure the save data was placed after the libvirt > > header + XML. This doesn't work

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel P. Berrange
On Wed, Apr 21, 2010 at 03:03:43PM -0600, Eric Blake wrote: > On 04/21/2010 10:56 AM, Daniel P. Berrange wrote: > > The save process was relying on use of the shell >> append > > operator to ensure the save data was placed after the libvirt > > header + XML. This doesn't work for block devices thou

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel Veillard
On Thu, Apr 22, 2010 at 11:36:06AM +0100, Daniel P. Berrange wrote: > On Wed, Apr 21, 2010 at 11:02:33PM +0200, Daniel Veillard wrote: > > On Wed, Apr 21, 2010 at 05:56:12PM +0100, Daniel P. Berrange wrote: > > > The save process was relying on use of the shell >> append > > > operator to ensure th

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel P. Berrange
On Thu, Apr 22, 2010 at 01:16:15PM +0200, Daniel Veillard wrote: > On Thu, Apr 22, 2010 at 11:36:06AM +0100, Daniel P. Berrange wrote: > > On Wed, Apr 21, 2010 at 11:02:33PM +0200, Daniel Veillard wrote: > > > On Wed, Apr 21, 2010 at 05:56:12PM +0100, Daniel P. Berrange wrote: > > > > The save proc

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel Veillard
On Thu, Apr 22, 2010 at 12:43:28PM +0100, Daniel P. Berrange wrote: > The save process was relying on use of the shell >> append > operator to ensure the save data was placed after the libvirt > header + XML. This doesn't work for block devices though. > Replace this code with use of 'dd' and its '

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel Veillard
On Thu, Apr 22, 2010 at 02:00:56PM +0200, Daniel Veillard wrote: > On Thu, Apr 22, 2010 at 12:43:28PM +0100, Daniel P. Berrange wrote: > > The save process was relying on use of the shell >> append > > operator to ensure the save data was placed after the libvirt > > header + XML. This doesn't work

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel P. Berrange
On Thu, Apr 22, 2010 at 02:12:22PM +0200, Daniel Veillard wrote: > On Thu, Apr 22, 2010 at 02:00:56PM +0200, Daniel Veillard wrote: > > On Thu, Apr 22, 2010 at 12:43:28PM +0100, Daniel P. Berrange wrote: > > > The save process was relying on use of the shell >> append > > > operator to ensure the s

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Eric Blake
[adding bug-coreutils] On 04/22/2010 04:37 AM, Daniel P. Berrange wrote: >>> -if (virAsprintf(&dest, "exec:%s >>%s 2>/dev/null", argstr, >>> safe_target) < 0) { >>> +if (virAsprintf(&dest, "exec:%s | dd of=%s seek=%llub", >>> +argstr, safe_target, offset) < 0) { >> >>

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-22 Thread Daniel P. Berrange
On Thu, Apr 22, 2010 at 08:39:26AM -0600, Eric Blake wrote: > [adding bug-coreutils] > > On 04/22/2010 04:37 AM, Daniel P. Berrange wrote: > >>> -if (virAsprintf(&dest, "exec:%s >>%s 2>/dev/null", argstr, > >>> safe_target) < 0) { > >>> +if (virAsprintf(&dest, "exec:%s | dd of=%s seek=%ll

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-23 Thread Laine Stump
On 04/22/2010 07:43 AM, Daniel P. Berrange wrote: The save process was relying on use of the shell>> append operator to ensure the save data was placed after the libvirt header + XML. This doesn't work for block devices though. Replace this code with use of 'dd' and its 'seek' parameter. This me

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-25 Thread Laine Stump
On 04/24/2010 12:50 AM, Laine Stump wrote: Is it really necessary to add this padding even when we *aren't* using dd? (ie, when is_reg == 1). Nevermind. Now that I've actual RTFC, I see that this new code *always* use dd. However, I just noticed an SELinux complaint about dd attempting to

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-28 Thread Daniel P. Berrange
On Sun, Apr 25, 2010 at 03:04:21AM -0400, Laine Stump wrote: > On 04/24/2010 12:50 AM, Laine Stump wrote: > > > >Is it really necessary to add this padding even when we *aren't* using > >dd? (ie, when is_reg == 1). > > Nevermind. Now that I've actual RTFC, I see that this new code *always* > use

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2010-04-28 Thread Laine Stump
On 04/28/2010 08:49 AM, Daniel P. Berrange wrote: On Sun, Apr 25, 2010 at 03:04:21AM -0400, Laine Stump wrote: On 04/24/2010 12:50 AM, Laine Stump wrote: Is it really necessary to add this padding even when we *aren't* using dd? (ie, when is_reg == 1). Nevermind. Now that I'v

Re: [libvirt] [PATCH 3/4] Fix QEMU save/restore with block devices

2013-03-23 Thread Jim Meyering
tags 6004 + notabug close 6004 thanks Eric Blake wrote: > [adding bug-coreutils] > > On 04/22/2010 04:37 AM, Daniel P. Berrange wrote: - if (virAsprintf(&dest, "exec:%s >>%s 2>/dev/null", argstr, safe_target) < 0) { +if (virAsprintf(&dest, "exec:%s | dd of=%s seek=%llub", +