[libvirt] [PATCH] Fix error message when failing to detect filesystem

From: "Daniel P. Berrange" <berrange@redhat.com> If we looped through /etc/filesystems trying to mount with each type and failed all options, we forget to actually raise an error message. * src/lxc/lxc_container.c: Raise error if unable to detect the filesystems. Also fix existing error message --- src/lxc/lxc_container.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index fbd5267..36ac3a9 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -725,7 +725,7 @@ retry: continue; virReportSystemError(errno, - _("Failed to bind mount directory %s to %s"), + _("Failed to mount device %s to %s"), src, fs->dst); goto cleanup; } @@ -746,6 +746,12 @@ retry: goto retry; } + if (ret != 0) { + virReportSystemError(ENODEV, + _("Failed to mount device %s to %s, unable to detect filesystem"), + src, fs->dst); + } + VIR_DEBUG("Done mounting filesystem ret=%d tryProc=%d", ret, tryProc); cleanup: -- 1.7.6.4

On 11/01/2011 09:02 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@redhat.com>
If we looped through /etc/filesystems trying to mount with each type and failed all options, we forget to actually raise an error message.
* src/lxc/lxc_container.c: Raise error if unable to detect the filesystems. Also fix existing error message --- src/lxc/lxc_container.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 11/01/2011 11:02 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@redhat.com>
If we looped through /etc/filesystems trying to mount with each type and failed all options, we forget to actually raise an error message.
* src/lxc/lxc_container.c: Raise error if unable to detect the filesystems. Also fix existing error message --- src/lxc/lxc_container.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index fbd5267..36ac3a9 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -725,7 +725,7 @@ retry: continue;
virReportSystemError(errno, - _("Failed to bind mount directory %s to %s"), + _("Failed to mount device %s to %s"), src, fs->dst); goto cleanup; } @@ -746,6 +746,12 @@ retry: goto retry; }
+ if (ret != 0) { + virReportSystemError(ENODEV, + _("Failed to mount device %s to %s, unable to detect filesystem"), s/, unab/. Unab/ ? + src, fs->dst); + } + VIR_DEBUG("Done mounting filesystem ret=%d tryProc=%d", ret, tryProc);
cleanup: ACK
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Stefan Berger