From patchwork Sun May 8 18:43:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 67327 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1260898qge; Sun, 8 May 2016 11:46:43 -0700 (PDT) X-Received: by 10.28.183.134 with SMTP id h128mr7676641wmf.63.1462733203020; Sun, 08 May 2016 11:46:43 -0700 (PDT) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id q3si29585057wjs.102.2016.05.08.11.46.42 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 08 May 2016 11:46:43 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u48Ii9Rs012438; Sun, 8 May 2016 14:44:09 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u48Ihmdq016840 for ; Sun, 8 May 2016 14:43:48 -0400 Received: from colepc.redhat.com (ovpn-113-25.phx2.redhat.com [10.3.113.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u48IhhIa024246; Sun, 8 May 2016 14:43:47 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 8 May 2016 14:43:41 -0400 Message-Id: <3d1769c1a57ec8b68e839e1954141fe33999791b.1462732781.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 6/6] qemu: command: Use -name guest= if available X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com -name guest= is the explicit parameter for passing a VM name. Using it is required to allow a VM with an '=' in the name https://bugzilla.redhat.com/show_bug.cgi?id=1276485 --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 4 ++++ tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml | 1 + tests/qemucaps2xmldata/all_1.6.0-1.caps | 1 + tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps | 1 + tests/qemuxml2argvdata/qemuxml2argv-name-escape.args | 8 ++++---- tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml | 2 +- tests/qemuxml2argvtest.c | 3 ++- 15 files changed, 23 insertions(+), 6 deletions(-) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 30dc33a..610c6af 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -328,6 +328,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "device-tray-moved-event", "nec-usb-xhci-ports", "virtio-scsi-pci.iothread", + "name-guest", ); @@ -2666,6 +2667,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { { "spice", "gl", QEMU_CAPS_SPICE_GL }, { "chardev", "logfile", QEMU_CAPS_CHARDEV_LOGFILE }, { "name", "debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS }, + { "name", "guest", QEMU_CAPS_NAME_GUEST }, }; static int diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index e7d0a60..9145f2d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -359,6 +359,7 @@ typedef enum { QEMU_CAPS_DEVICE_TRAY_MOVED, /* DEVICE_TRAY_MOVED event */ QEMU_CAPS_NEC_USB_XHCI_PORTS, /* -device nec-usb-xhci.p3 ports setting */ QEMU_CAPS_VIRTIO_SCSI_IOTHREAD, /* virtio-scsi-{pci,ccw}.iothread */ + QEMU_CAPS_NAME_GUEST, /* -name guest= */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6b89508..0461a2f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6871,6 +6871,10 @@ qemuBuildNameCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, "-name"); + /* The 'guest' option let's us handle a name with '=' embedded in it */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NAME_GUEST)) + virBufferAddLit(&buf, "guest="); + qemuBufferEscapeComma(&buf, def->name); if (cfg->setProcessName && diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.xml index 4663e19..2428aff 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.x86_64.xml @@ -168,6 +168,7 @@ + 2001001 0 diff --git a/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.xml index a8df7e1..68ea0de 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0-1.x86_64.xml @@ -181,6 +181,7 @@ + 2004000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.xml index 2160173..73f0147 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0-1.x86_64.xml @@ -182,6 +182,7 @@ + 2004000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml index f4e6db1..362ec1c 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-1.aarch64.xml @@ -158,6 +158,7 @@ + 2005094 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml b/tests/qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml index 96a02a5..1d5d670 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-1.ppc64le.xml @@ -152,6 +152,7 @@ + 2005094 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.xml index 9024d63..5970d19 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-1.x86_64.xml @@ -187,6 +187,7 @@ + 2005050 0 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml index f4d60d1..2138049 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-2.aarch64.xml @@ -158,6 +158,7 @@ + 2005094 0 diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmldata/all_1.6.0-1.caps index 1484c79..d39d0be 100644 --- a/tests/qemucaps2xmldata/all_1.6.0-1.caps +++ b/tests/qemucaps2xmldata/all_1.6.0-1.caps @@ -125,4 +125,5 @@ + diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps index 8bd8a18..5a0372c 100644 --- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps +++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps @@ -124,4 +124,5 @@ + diff --git a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args index b50b8c4..b59706c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args @@ -5,16 +5,16 @@ USER=test \ LOGNAME=test \ QEMU_AUDIO_DRV=none \ /usr/bin/qemu \ --name foo,,bar,debug-threads=on \ +-name guest=foo=1,,bar=2,debug-threads=on \ -S \ --object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-foo,,\ -bar/master-key.aes \ +-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-foo=1,,\ +bar=2/master-key.aes \ -M pc \ -m 214 \ -smp 1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo,,bar/monitor.sock,\ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo=1,,bar=2/monitor.sock,\ server,nowait \ -mon chardev=charmonitor,id=monitor,mode=readline \ -no-acpi \ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml index e263553..5e8c747 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml @@ -1,5 +1,5 @@ - foo,bar + foo=1,bar=2 c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 219100 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5d15dfd..68f0a84 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1894,7 +1894,8 @@ mymain(void) NONE); DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, - QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC); + QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC, + QEMU_CAPS_NAME_GUEST); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS); DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);