This reverts commit c79ebf53b5fe0a33bf407b3bcb49e3a27ec97eb4. We can't just add checks to the XML parser once we've accepted such configuration in the past. --- src/conf/domain_conf.c | 22 ---------------------- tests/qemuxml2argvtest.c | 3 +-- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 48a220f..c4cbbff 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4181,28 +4181,6 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, } } - /* Validate LUN configuration - * NOTE: virStorageTranslateDiskSourcePool is not run yet, so for - * disk "volume"'s, the closest we can get at config time is - * to ensure mode isn't direct since host/default will allow - * lun/block usage. At run time if it's determined the wrong - * voltype and pooltype values are set, then failure occurs - */ - if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN && - !(disk->src->type == VIR_STORAGE_TYPE_BLOCK || - (disk->src->type == VIR_STORAGE_TYPE_NETWORK && - disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) || - (disk->src->type == VIR_STORAGE_TYPE_VOLUME && - disk->src->srcpool && - disk->src->srcpool->mode != - VIR_STORAGE_SOURCE_POOL_MODE_DIRECT))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk '%s' improperly configured for a " - "device='lun'"), - disk->dst); - return -1; - } - if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && virDomainDiskDefAssignAddress(xmlopt, disk, def) < 0) return -1; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8842b2f..4211e82 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -780,8 +780,7 @@ mymain(void) DO_TEST_FAILURE("disk-drive-network-rbd-no-colon", NONE); DO_TEST("disk-drive-no-boot", QEMU_CAPS_BOOTINDEX); - DO_TEST_PARSE_ERROR("disk-device-lun-type-invalid", - QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_FAILURE("disk-device-lun-type-invalid", QEMU_CAPS_VIRTIO_SCSI); DO_TEST_FAILURE("disk-usb-nosupport", NONE); DO_TEST("disk-usb-device", QEMU_CAPS_DEVICE_USB_STORAGE, -- 2.8.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list