@@ -1589,12 +1589,8 @@ bhyveConnectGetDomainCapabilities(virConnectPtr conn,
return ret;
if (virttype_str &&
- (virttype = virDomainVirtTypeFromString(virttype_str)) < 0) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unknown virttype: %s"),
- virttype_str);
+ (virttype = virDomainVirtTypeFromString(virttype_str)) < 0)
goto cleanup;
- }
if (virttype != VIR_DOMAIN_VIRT_BHYVE) {
virReportError(VIR_ERR_INVALID_ARG,
@@ -104,7 +104,7 @@ VIR_ENUM_IMPL(virDomainTaint, NULL,
"custom-ga-command",
);
-VIR_ENUM_IMPL(virDomainVirt, NULL,
+VIR_ENUM_IMPL(virDomainVirt, "domain type",
VIR_DOMAIN_VIRT_LAST,
"none",
"qemu",
@@ -19327,11 +19327,8 @@ virDomainDefParseCaps(virDomainDefPtr def,
"%s", _("missing domain type attribute"));
return -1;
}
- if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("invalid domain type %s"), virttype);
+ if ((def->virtType = virDomainVirtTypeFromString(virttype)) < 0)
return -1;
- }
if (!ostype) {
if (def->os.bootloader) {
@@ -28035,11 +28032,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST,
-1);
- if (!(type = virDomainVirtTypeToString(def->virtType))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected domain type %d"), def->virtType);
+ if (!(type = virDomainVirtTypeToString(def->virtType)))
goto error;
- }
if (def->id == -1)
flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
@@ -6365,12 +6365,8 @@ libxlConnectGetDomainCapabilities(virConnectPtr conn,
cfg = libxlDriverConfigGet(driver);
if (virttype_str &&
- (virttype = virDomainVirtTypeFromString(virttype_str)) < 0) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unknown virttype: %s"),
- virttype_str);
+ (virttype = virDomainVirtTypeFromString(virttype_str)) < 0)
goto cleanup;
- }
if (virttype != VIR_DOMAIN_VIRT_XEN) {
virReportError(VIR_ERR_INVALID_ARG,
@@ -4800,11 +4800,8 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
virQEMUCapsPtr ret = NULL;
if (virttypeStr &&
- (virttype = virDomainVirtTypeFromString(virttypeStr)) < 0) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unknown virttype: %s"), virttypeStr);
+ (virttype = virDomainVirtTypeFromString(virttypeStr)) < 0)
goto cleanup;
- }
if (archStr &&
(arch = virArchFromString(archStr)) == VIR_ARCH_NONE) {
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- Not sure if we should apply this now or after some flag day. I'm open to suggestions src/bhyve/bhyve_driver.c | 6 +----- src/conf/domain_conf.c | 12 +++--------- src/libxl/libxl_driver.c | 6 +----- src/qemu/qemu_capabilities.c | 5 +---- 4 files changed, 6 insertions(+), 23 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list