[PATCH v1 1/7] qemu_command: Drop useless alias checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At the point when we are building the command line
all aliases are assigned. There's no point in checking.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index abeb24846..47ece35f6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3526,12 +3526,6 @@ qemuBuildMemoryDimmBackendStr(virDomainMemoryDefPtr mem,
     const char *backendType;
     char *ret = NULL;
 
-    if (!mem->info.alias) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("memory device alias is not assigned"));
-        return NULL;
-    }
-
     if (virAsprintf(&alias, "mem%s", mem->info.alias) < 0)
         goto cleanup;
 
@@ -3555,12 +3549,6 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem)
     virBuffer buf = VIR_BUFFER_INITIALIZER;
     const char *device;
 
-    if (!mem->info.alias) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("missing alias for memory device"));
-        return NULL;
-    }
-
     switch ((virDomainMemoryModel) mem->model) {
     case VIR_DOMAIN_MEMORY_MODEL_NVDIMM:
     case VIR_DOMAIN_MEMORY_MODEL_DIMM:
@@ -3925,8 +3913,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
 
     if (vlan >= 0) {
         virBufferAsprintf(&buf, "vlan=%d,", vlan);
-        if (net->info.alias)
-            virBufferAsprintf(&buf, "name=host%s,", net->info.alias);
+        virBufferAsprintf(&buf, "name=host%s,", net->info.alias);
     } else {
         virBufferAsprintf(&buf, "id=host%s,", net->info.alias);
     }
@@ -5860,12 +5847,6 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager,
         virDomainRNGDefPtr rng = def->rngs[i];
         char *tmp;
 
-        if (!rng->info.alias) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                           _("RNG device is missing alias"));
-            return -1;
-        }
-
         /* possibly add character device for backend */
         if (qemuBuildRNGBackendChrdevStr(logManager, cmd, cfg, def,
                                          rng, qemuCaps, &tmp,
-- 
2.13.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux