From patchwork Fri Jan 22 19:30:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 60197 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp51421lbb; Fri, 22 Jan 2016 11:33:29 -0800 (PST) X-Received: by 10.140.93.77 with SMTP id c71mr6077143qge.46.1453491196256; Fri, 22 Jan 2016 11:33:16 -0800 (PST) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id d10si8558515qgf.109.2016.01.22.11.33.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jan 2016 11:33:16 -0800 (PST) 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 u0MJUp4e010328; Fri, 22 Jan 2016 14:30:51 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0MJUdsk019876 for ; Fri, 22 Jan 2016 14:30:39 -0500 Received: from colepc.redhat.com (ovpn-113-198.phx2.redhat.com [10.3.113.198]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MJUaPQ002518; Fri, 22 Jan 2016 14:30:39 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 22 Jan 2016 14:30:18 -0500 Message-Id: <9eee18210a0e2f10a0b1135d270754df996eb0e0.1453489951.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/17] qemu: command: Drop xen disk and vga handling 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 Yet more leftover bits from xenner days --- src/qemu/qemu_command.c | 180 +++++++++------------ src/qemu/qemu_domain.c | 9 ++ .../qemuargv2xmldata/qemuargv2xml-disk-xenvbd.args | 25 --- .../qemuargv2xmldata/qemuargv2xml-disk-xenvbd.xml | 45 ------ tests/qemuargv2xmltest.c | 1 - .../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 26 --- tests/qemuxml2argvtest.c | 2 +- .../qemuxml2xmlout-disk-xenvbd.xml | 45 ------ tests/qemuxml2xmltest.c | 1 - 9 files changed, 90 insertions(+), 244 deletions(-) delete mode 100644 tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.args delete mode 100644 tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.xml delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args delete mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-xenvbd.xml -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 75fb352..bf6eb9f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -822,9 +822,6 @@ static int qemuAssignDeviceDiskAliasFixed(virDomainDiskDefPtr disk) case VIR_DOMAIN_DISK_BUS_VIRTIO: ret = virAsprintf(&dev_name, "virtio%d", devid); break; - case VIR_DOMAIN_DISK_BUS_XEN: - ret = virAsprintf(&dev_name, "xenblk%d", devid); - break; case VIR_DOMAIN_DISK_BUS_SD: ret = virAsprintf(&dev_name, "sd%d", devid); break; @@ -3811,9 +3808,8 @@ qemuBuildDriveStr(virConnectPtr conn, idx = -1; break; - case VIR_DOMAIN_DISK_BUS_XEN: case VIR_DOMAIN_DISK_BUS_SD: - /* Xen and SD have no address type currently, so assign + /* SD disks have no address type currently, so assign * based on index */ break; } @@ -7839,10 +7835,6 @@ qemuBuildObsoleteAccelArg(virCommandPtr cmd, } break; - case VIR_DOMAIN_VIRT_XEN: - /* XXX better check for xenner */ - break; - default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("the QEMU binary does not support %s"), @@ -10242,8 +10234,7 @@ qemuBuildCommandLine(virConnectPtr conn, static PCI addresses, so we don't really care that we can't use -device */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - if (disk->bus != VIR_DOMAIN_DISK_BUS_XEN && - disk->bus != VIR_DOMAIN_DISK_BUS_SD) { + if (disk->bus != VIR_DOMAIN_DISK_BUS_SD) { withDeviceArg = true; } else { virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE); @@ -10766,96 +10757,92 @@ qemuBuildCommandLine(virConnectPtr conn, VIR_FREE(str); } } else { - if (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_XEN) { - /* nothing - vga has no effect on Xen pvfb */ - } else { - if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_QXL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU does not support QXL graphics adapters")); - goto error; - } + if ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL) && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_QXL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU does not support QXL graphics adapters")); + goto error; + } - const char *vgastr = qemuVideoTypeToString(primaryVideoType); - if (!vgastr || STREQ(vgastr, "")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("video type %s is not supported with QEMU"), - virDomainVideoTypeToString(primaryVideoType)); - goto error; - } + const char *vgastr = qemuVideoTypeToString(primaryVideoType); + if (!vgastr || STREQ(vgastr, "")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type %s is not supported with QEMU"), + virDomainVideoTypeToString(primaryVideoType)); + goto error; + } - virCommandAddArgList(cmd, "-vga", vgastr, NULL); + virCommandAddArgList(cmd, "-vga", vgastr, NULL); - /* If we cannot use --device option to specify the video device - * in QEMU we will fallback to the old --vga option. To get the - * correct device name for the --vga option the 'qemuVideo' is - * used, but to set some device attributes we need to use the - * --global option and for that we need to specify the device - * name the same as for --device option and for that we need to - * use 'qemuDeviceVideo'. - * - * See 'Graphics Devices' section in docs/qdev-device-use.txt in - * QEMU repository. - */ - const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); - - if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && - (def->videos[0]->vram || def->videos[0]->ram) && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - unsigned int ram = def->videos[0]->ram; - unsigned int vram = def->videos[0]->vram; - unsigned int vgamem = def->videos[0]->vgamem; - - if (vram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'vram' must be less than '%u'"), - UINT_MAX / 1024); - goto error; - } - if (ram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'ram' must be less than '%u'"), - UINT_MAX / 1024); - goto error; - } + /* If we cannot use --device option to specify the video device + * in QEMU we will fallback to the old --vga option. To get the + * correct device name for the --vga option the 'qemuVideo' is + * used, but to set some device attributes we need to use the + * --global option and for that we need to specify the device + * name the same as for --device option and for that we need to + * use 'qemuDeviceVideo'. + * + * See 'Graphics Devices' section in docs/qdev-device-use.txt in + * QEMU repository. + */ + const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); - if (ram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.ram_size=%u", - dev, ram * 1024); - } - if (vram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram_size=%u", - dev, vram * 1024); - } - if (vgamem && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vgamem / 1024); - } - } + if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + (def->videos[0]->vram || def->videos[0]->ram) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { + unsigned int ram = def->videos[0]->ram; + unsigned int vram = def->videos[0]->vram; + unsigned int vgamem = def->videos[0]->vgamem; - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && - def->videos[0]->vram && - ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || - (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { - unsigned int vram = def->videos[0]->vram; - - if (vram < 1024) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("value for 'vgamem' must be at " - "least 1 MiB (1024 KiB)")); - goto error; - } + if (vram > (UINT_MAX / 1024)) { + virReportError(VIR_ERR_OVERFLOW, + _("value for 'vram' must be less than '%u'"), + UINT_MAX / 1024); + goto error; + } + if (ram > (UINT_MAX / 1024)) { + virReportError(VIR_ERR_OVERFLOW, + _("value for 'ram' must be less than '%u'"), + UINT_MAX / 1024); + goto error; + } + if (ram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.ram_size=%u", + dev, ram * 1024); + } + if (vram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram_size=%u", + dev, vram * 1024); + } + if (vgamem && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", - dev, vram / 1024); + dev, vgamem / 1024); + } + } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && + def->videos[0]->vram && + ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { + unsigned int vram = def->videos[0]->vram; + + if (vram < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("value for 'vgamem' must be at " + "least 1 MiB (1024 KiB)")); + goto error; } + + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vram / 1024); } if (def->nvideos > 1) { @@ -12000,8 +11987,6 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, def->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY; } else if (STREQ(values[i], "virtio")) { def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO; - } else if (STREQ(values[i], "xen")) { - def->bus = VIR_DOMAIN_DISK_BUS_XEN; } else if (STREQ(values[i], "sd")) { def->bus = VIR_DOMAIN_DISK_BUS_SD; } @@ -12165,8 +12150,6 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, ignore_value(VIR_STRDUP(def->dst, "sda")); } else if (def->bus == VIR_DOMAIN_DISK_BUS_VIRTIO) { ignore_value(VIR_STRDUP(def->dst, "vda")); - } else if (def->bus == VIR_DOMAIN_DISK_BUS_XEN) { - ignore_value(VIR_STRDUP(def->dst, "xvda")); } else if (def->bus == VIR_DOMAIN_DISK_BUS_FDC) { ignore_value(VIR_STRDUP(def->dst, "fda")); } else { @@ -13925,10 +13908,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, virDomainVideoDefPtr vid; if (VIR_ALLOC(vid) < 0) goto error; - if (def->virtType == VIR_DOMAIN_VIRT_XEN) - vid->type = VIR_DOMAIN_VIDEO_TYPE_XEN; - else - vid->type = video; + vid->type = video; vid->vram = virDomainVideoDefaultRAM(def, vid->type); if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { vid->ram = virDomainVideoDefaultRAM(def, vid->type); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index a1dd604..aa12f88 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1243,6 +1243,7 @@ qemuDomainDefPostParse(virDomainDefPtr def, { virQEMUDriverPtr driver = opaque; virQEMUCapsPtr qemuCaps = NULL; + size_t i; int ret = -1; if (def->os.bootloader || def->os.bootloaderArgs) { @@ -1251,6 +1252,14 @@ qemuDomainDefPostParse(virDomainDefPtr def, goto cleanup; } + for (i = 0; i < def->ndisks; i++) { + if (def->disks[i]->bus == VIR_DOMAIN_DISK_BUS_XEN) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("qemu does not support disk bus 'xen'")); + goto cleanup; + } + } + if (def->virtType == VIR_DOMAIN_VIRT_XEN) { virReportError(VIR_ERR_INTERNAL_ERROR, _("qemu emulator '%s' does not support xen"), diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.args b/tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.args deleted file mode 100644 index 07fb4e4..0000000 --- a/tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.args +++ /dev/null @@ -1,25 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/home/test \ -USER=test \ -LOGNAME=test \ -QEMU_AUDIO_DRV=none \ -/usr/bin/qemu \ --name QEMUGuest1 \ --S \ --M pc \ --m 214 \ --smp 1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --nographic \ --monitor unix:/tmp/test-monitor,server,nowait \ --no-acpi \ --boot c \ --usb \ --drive file=/dev/HostVG/QEMUGuest1,format=raw,if=ide,bus=0,unit=0 \ --drive file=/dev/HostVG/QEMUGuest2,format=raw,if=ide,media=cdrom,bus=1,unit=0 \ --drive file=/tmp/data.img,format=raw,if=xen,index=0 \ --drive file=/tmp/logs.img,format=raw,if=xen,index=6 \ --net none \ --serial none \ --parallel none diff --git a/tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.xml b/tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.xml deleted file mode 100644 index e0bad71..0000000 --- a/tests/qemuargv2xmldata/qemuargv2xml-disk-xenvbd.xml +++ /dev/null @@ -1,45 +0,0 @@ - - QEMUGuest1 - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - destroy - restart - destroy - - /usr/bin/qemu - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index d6189c7..43f3a78 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -189,7 +189,6 @@ mymain(void) DO_TEST("disk-floppy"); DO_TEST("disk-many"); DO_TEST("disk-virtio"); - DO_TEST("disk-xenvbd"); DO_TEST("disk-drive-boot-disk"); DO_TEST("disk-drive-boot-cdrom"); DO_TEST("disk-drive-fmt-qcow"); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args deleted file mode 100644 index 8bd9dbd..0000000 --- a/tests/qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args +++ /dev/null @@ -1,26 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/home/test \ -USER=test \ -LOGNAME=test \ -QEMU_AUDIO_DRV=none \ -/usr/bin/qemu \ --name QEMUGuest1 \ --S \ --M pc \ --m 214 \ --smp 1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --nographic \ --nodefaults \ --monitor unix:/tmp/test-monitor,server,nowait \ --no-acpi \ --boot c \ --usb \ --drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ --device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,media=cdrom,\ -id=drive-ide0-1-0 \ --device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \ --drive file=/tmp/data.img,format=raw,if=xen,index=0 \ --drive file=/tmp/logs.img,format=raw,if=xen,index=6 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6b47d3a..d3454db 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -752,7 +752,7 @@ mymain(void) DO_TEST("disk-order", QEMU_CAPS_DRIVE_BOOT, QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO); - DO_TEST("disk-xenvbd", QEMU_CAPS_DRIVE_BOOT); + DO_TEST_PARSE_ERROR("disk-xenvbd", NONE); DO_TEST("disk-drive-boot-disk", QEMU_CAPS_DRIVE_BOOT); DO_TEST("disk-drive-boot-cdrom", diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-xenvbd.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-xenvbd.xml deleted file mode 100644 index e0bad71..0000000 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-xenvbd.xml +++ /dev/null @@ -1,45 +0,0 @@ - - QEMUGuest1 - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 219136 - 1 - - hvm - - - - destroy - restart - destroy - - /usr/bin/qemu - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 6b9c153..be10b66 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -334,7 +334,6 @@ mymain(void) DO_TEST("disk-cdrom"); DO_TEST("disk-floppy"); DO_TEST("disk-many"); - DO_TEST("disk-xenvbd"); DO_TEST("disk-usb-device"); DO_TEST("disk-virtio"); DO_TEST("floppy-drive-fat");