[libvirt] PATCH: Pass -name argument to QEMU
Daniel P. Berrange
berrange at redhat.com
Thu May 15 14:39:18 UTC 2008
On Thu, May 15, 2008 at 10:36:18AM -0400, Daniel Veillard wrote:
> On Tue, May 13, 2008 at 12:21:02AM +0100, Daniel P. Berrange wrote:
> > This patch makes libvirt pass the -name argumet to QEMU it if it supported
> > by the QEMU binary in question. THis allows QEMU to set the VNC title and
> > allows Xenner to set the Xen guest name in xenstore.
>
>
> Fine by me, +1
>
> > @@ -2348,6 +2350,7 @@
> > len = 1 + /* qemu */
> > 2 + /* machine type */
> > disableKQEMU + /* Disable kqemu */
> > + (vm->qemuCmdFlags & QEMUD_CMD_FLAG_NAME ? 2 : 0) + /* -name XXX */
> > 2 * vm->def->ndisks + /* disks*/
> > (vm->def->nnets > 0 ? (4 * vm->def->nnets) : 2) + /* networks */
> > 1 + /* usb */
> > @@ -2394,6 +2397,12 @@
>
> I just start to find that arg length computation a bit long and messy.
> As we add the args maybe it's time to do that a bit more dynamically, no ?
Yes it is getting a little messy. Its probably worth dynamically expanding
the array as we add each arg. If we define a simple macro to handle the
realloc of argv, and the strdup of the actual arg in one go, it should make
the code fairly clear.
Dan.
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list