[libvirt] process= support for 'qemu-kvm -name' [Bug 576950]

John Morrissey jwm at horde.net
Mon Oct 18 17:45:12 UTC 2010


[plowing through a stack of small patches that i've been neglecting...
 sorry for the delay.]

On Tue, Mar 30, 2010 at 03:05:06PM +0100, Daniel P. Berrange wrote:
> On Sun, Mar 28, 2010 at 10:19:51PM -0400, John Morrissey wrote:
> > I wrote (attached here, and to the bug) a quick patch that sets the
> > process name to the same value as the window title.
[snip]
> > @@ -3550,7 +3553,15 @@ int qemudBuildCommandLine(virConnectPtr conn,
> >  
> >      if (qemuCmdFlags & QEMUD_CMD_FLAG_NAME) {
> >          ADD_ARG_LIT("-name");
> > -        ADD_ARG_LIT(def->name);
> > +        if (qemuCmdFlags & QEMUD_CMD_FLAG_NAME_PROCESS) {
> > +            char *name;
> > +            if (virAsprintf(&name, "%s,process=%s",
> > +                            def->name, def->name) < 0)
> > +                goto no_memory;
> > +            ADD_ARG_LIT(name);
> 
> I think it will be quite misleading to do this. eg a VM named 'foo'
> 
>   # qemu-system-x86_64 -vnc :2 -hda /var/lib/libvirt/images/plain.img -name foo,process=foo
> 
> Now the process listing shows
> 
>   # ps -w
>     PID TTY          TIME CMD
>   12009 pts/1    00:00:01 bash
>   12646 pts/1    00:00:00 ksmtuned
>   14494 pts/1    00:00:02 foo
>   14508 pts/1    00:00:00 sleep
>   14511 pts/1    00:00:00 ps
> 
> which leaves no indication that 'foo' is a QEMU process at all which is 
> rather bad IMHO. At the very least I think we should keep the binary base
> name here, and have the VM name as a postfix, eg so it shows

Unfortunately, qemu uses prctl() to set the process title, which has a limit
of 16 characters. How about "qemu:$VM_NAME" for the process title
(attached), so we waste as little as possible?

I'll look at doing something to increase the length limitation in qemu.

john
-- 
John Morrissey          _o            /\         ----  __o
jwm at horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-set-qemu-process-title.patch
Type: text/x-diff
Size: 2564 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101018/af731659/attachment-0001.bin>


More information about the libvir-list mailing list