
On Mon, Oct 18, 2010 at 06:17:14PM -0400, John Morrissey wrote:
On Mon, Oct 18, 2010 at 06:58:34PM +0100, Daniel P. Berrange wrote:
On Mon, Oct 18, 2010 at 01:45:12PM -0400, John Morrissey wrote:
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?
Urgh, 16 characters is tiny :-( I think we had better add a configuration parameter to /etc/qemu/qemu.conf to allow admins to turn this feature on/off, with the default being off. At least until QEMU can support a sensibly sized process name... [snip] The patch looks fine, as long as you can add the qemu.conf config param to turn it on/off
Sure, attached.
I tried to make some of the whitespace in the sample config more consistent; hope that doesn't cause headaches. [...] --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -370,6 +370,10 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, CHECK_TYPE ("allow_disk_format_probing", VIR_CONF_LONG); if (p) driver->allowDiskFormatProbing = p->l;
+ p = virConfGetValue (conf, "set_process_name"); + CHECK_TYPE ("set_process_name", VIR_CONF_LONG); + if (p) driver->setProcessName = p->l; + virConfFree (conf); return 0; } @@ -1165,8 +1169,11 @@ static unsigned long long qemudComputeCmdFlags(const char *help, flags |= QEMUD_CMD_FLAG_ENABLE_KVM; if (strstr(help, "-no-reboot")) flags |= QEMUD_CMD_FLAG_NO_REBOOT; - if (strstr(help, "-name")) + if (strstr(help, "-name")) { flags |= QEMUD_CMD_FLAG_NAME; + if (strstr(help, ",process=")) + flags |= QEMUD_CMD_FLAG_NAME_PROCESS; + } if (strstr(help, "-uuid")) flags |= QEMUD_CMD_FLAG_UUID; if (strstr(help, "-xen-domid")) [...] diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index d2e6857..005031d 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -95,6 +95,7 @@ enum qemud_cmd_flags { QEMUD_CMD_FLAG_ENABLE_KQEMU = (1LL << 39), /* -enable-kqemu flag */ QEMUD_CMD_FLAG_FSDEV = (1LL << 40), /* -fstype filesystem passthrough */ QEMUD_CMD_FLAG_NESTING = (1LL << 41), /* -enable-nesting (SVM/VMX) */ + QEMUD_CMD_FLAG_NAME_PROCESS = (1LL << 42), /* Is -name process= available */ };
Patch looks fine but I didn't applied it yet because "make check" raises an error now: TEST: qemuhelptest .....Computed flags do not match: got 0x64f0a8ffd7e, expected 0x24f0a8ffd7e !Computed flags do not match: got 0x4425ef9dc6e, expected 0x425ef9dc6e !Computed flags do not match: got 0x64ede6ffd7e, expected 0x24ede6ffd7e ! 8 FAIL FAIL: qemuhelptest I think it's simply that the new flag must be added to some of the expected result in tests/qemuhelptest.c, should not be hard to find out and clear, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/