Having a translation enum full of empty strings seems excessive. Now that the validiation is performed in qemuDomainDeviceDefValidateFS, remove it completely and open-code the two allowed cases. Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> --- src/qemu/qemu_command.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 803f7ece19..a0246bbe32 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -179,17 +179,6 @@ VIR_ENUM_IMPL(qemuControllerModelUSB, "none", ); -VIR_ENUM_DECL(qemuDomainFSDriver); -VIR_ENUM_IMPL(qemuDomainFSDriver, - VIR_DOMAIN_FS_DRIVER_TYPE_LAST, - "local", - "local", - "handle", - NULL, - NULL, - NULL, -); - VIR_ENUM_DECL(qemuNumaPolicy); VIR_ENUM_IMPL(qemuNumaPolicy, VIR_DOMAIN_NUMATUNE_MEM_LAST, @@ -2704,13 +2693,11 @@ static char * qemuBuildFSStr(virDomainFSDefPtr fs) { VIR_AUTOCLEAN(virBuffer) opt = VIR_BUFFER_INITIALIZER; - const char *driver = qemuDomainFSDriverTypeToString(fs->fsdriver); const char *wrpolicy = virDomainFSWrpolicyTypeToString(fs->wrpolicy); - virBufferAdd(&opt, driver, -1); - if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_PATH || fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT) { + virBufferAddLit(&opt, "local"); if (fs->accessmode == VIR_DOMAIN_FS_ACCESSMODE_MAPPED) { virBufferAddLit(&opt, ",security_model=mapped"); } else if (fs->accessmode == VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH) { @@ -2718,6 +2705,9 @@ qemuBuildFSStr(virDomainFSDefPtr fs) } else if (fs->accessmode == VIR_DOMAIN_FS_ACCESSMODE_SQUASH) { virBufferAddLit(&opt, ",security_model=none"); } + } else if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE) { + /* removed since qemu 4.0.0 see v3.1.0-29-g93aee84f57 */ + virBufferAddLit(&opt, "handle"); } if (fs->wrpolicy) -- 2.19.2 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list