[libvirt] [PATCH 12/18] conf: use disk source accessors in uml/

Eric Blake eblake at redhat.com
Wed Mar 19 17:20:44 UTC 2014


Part of a series of cleanups to use new accessor methods.

* src/uml/uml_conf.c (umlBuildCommandLine): Use accessors.
* src/uml/uml_driver.c (umlDomainAttachUmlDisk): Likewise.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 src/uml/uml_conf.c   | 4 ++--
 src/uml/uml_driver.c | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index 3567b03..27c53f9 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -1,7 +1,7 @@
 /*
  * uml_conf.c: UML driver configuration
  *
- * Copyright (C) 2006-2013 Red Hat, Inc.
+ * Copyright (C) 2006-2014 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -410,7 +410,7 @@ virCommandPtr umlBuildCommandLine(virConnectPtr conn,
             goto error;
         }

-        virCommandAddArgPair(cmd, disk->dst, disk->src);
+        virCommandAddArgPair(cmd, disk->dst, virDomainDiskGetSource(disk));
     }

     for (i = 0; i < vm->def->nnets; i++) {
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 28e65f4..a49b56b 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2144,13 +2144,14 @@ static int umlDomainAttachUmlDisk(struct uml_driver *driver,
         }
     }

-    if (!disk->src) {
+    if (!virDomainDiskGetSource(disk)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        "%s", _("disk source path is missing"));
         goto error;
     }

-    if (virAsprintf(&cmd, "config %s=%s", disk->dst, disk->src) < 0)
+    if (virAsprintf(&cmd, "config %s=%s", disk->dst,
+                    virDomainDiskGetSource(disk)) < 0)
         return -1;

     if (umlMonitorCommand(driver, vm, cmd, &reply) < 0)
-- 
1.8.5.3




More information about the libvir-list mailing list