On 27.11.2014 12:18, Ian Campbell wrote:
> On Thu, 2014-11-27 at 11:02 +0100, Stefan Bader wrote:
>> On 21.11.2014 13:50, Ian Campbell wrote:
>>> Package: xen-utils-common
>>> Version: 4.4.0-1
>>> Severity: important
>>> Tags: patch
>>>
>>> Under some circumstances the xl toolstack needs to create a loopback
>>> mount of a guest disk in dom0 (e.g. in order to run pygrub). Depending
>>> on the nature of the guest disk (e.g. qcow2 or raw file image based)
>>> this can require a qemu instance in dom0.
>>>
>>> The upstream xencommons starts such a qemu on boot. The following patch
>>> adds this to the Debian packages init script as well.
>>>
>>> Once I have a bug number for this I will add it to debian/changelog and
>>> push the result to feature/bugNNNN as usual.
>>>
>>> Thanks,
>>> Ian.
>>>
>>> commit 26cce2a65c77f731e23a1395f1fe4a5da47287a4
>>> Author: Ian Campbell <i...@debian.org>
>>> Date:   Fri Nov 21 11:27:45 2014 +0000
>>>
>>>     Start a qemu process in dom0 to service the toolstacks loopback disk 
>>> attaches.
>>>     
>>>     This is used to e.g. run pygrub on a VM with a qcow2 disk image.
>>>     
>>>     Also, remove correct pidfile when stopping xenconsoled.
>>>
>>> diff --git a/debian/changelog b/debian/changelog
>>> index 484583f..ff48d6a 100644
>>> --- a/debian/changelog
>>> +++ b/debian/changelog
>>> @@ -1,3 +1,12 @@
>>> +xen (4.4.1-4) UNRELEASED; urgency=medium
>>> +
>>> +  [ Ian Campbell ]
>>> +  * Start a qemu process in dom0 to service the toolstacks loopback disk
>>> +    attaches.
>>> +  * Remove correct pidfile when stopping xenconsoled.
>>> +
>>> + -- Ian Campbell <i...@debian.org>  Fri, 21 Nov 2014 11:26:40 +0000
>>> +
>>>  xen (4.4.1-3) unstable; urgency=medium
>>>  
>>>    [ Bastian Blank ]
>>> diff --git a/debian/xen-utils-common.xen.init 
>>> b/debian/xen-utils-common.xen.init
>> ...
>>> +
>>> +qemu_start_real()
>>> +{
>>> +   start-stop-daemon --start --quiet --pidfile "$QEMU_PIDFILE" --exec 
>>> "$QEMU" --test > /dev/null \
>>> +           || return 1
>>> +   start-stop-daemon --start --quiet --pidfile "$QEMU_PIDFILE" --exec 
>>> "$QEMU" -- \
>>> +           $QEMU_ARGS -pidfile "$QEMU_PIDFILE" \
>>> +           || return 2
>>> +}
>>> +
>>> +qemu_stop_real()
>>> +{
>>> +   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile 
>>> "$QEMU_PIDFILE" --name xenconsoled
>>> +   RETVAL="$?"
>>> +   [ "$RETVAL" = 2 ] && return 2
>>> +   start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec 
>>> "$QEMU"
>>> +   [ "$?" = 2 ] && return 2
>>> +   rm -f $QEMU_PIDFILE
>>> +   return "$RETVAL"
>>> +}
>>> +
>>> +
>>
>> Not sure this already was handled but the --name argument of qemu_stop_real
>> seems a copy-and-paste bug.
> 
> Yes it is, whoops!
> 
>>  Playing with it right now, --exec instead of --name
>> also works out better since qemu-system-i386 is just about too long.
> 
> So it is, so this is probably a good idea.
> 
> Will you send an updated patch once you've finished testing?

Yes, sure, I can do that.

Stefan
> 
> Ian.
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to