[libvirt] [PATCH] virsh: tell if domain is updated in dominfo

* tools/virsh.c (introduce new information 'Updated' for 'dominfo', standsfor if a domain is updated via operations like 'update-device', 'update-disk', etc.) --- tools/virsh.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index ae88cc0..d260443 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1992,6 +1992,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) virSecurityModel secmodel; virSecurityLabel seclabel; int persistent = 0; + int updated = -1; int ret = TRUE, autostart; unsigned int id; char *str, uuid[VIR_UUID_STRING_BUFLEN]; @@ -2053,6 +2054,12 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) else vshPrint(ctl, "%-15s %s\n", _("Persistent:"), persistent ? _("yes") : _("no")); + updated = virDomainIsUpdated(dom); + if (updated < 0) + vshPrint(ctl, "%-15s %s\n", _("Updated:"), _("unknown")); + else + vshPrint(ctl, "%-15s %s\n", _("Updated:"), updated ? _("yes") : _("no")); + /* Check and display whether the domain autostarts or not */ if (!virDomainGetAutostart(dom, &autostart)) { vshPrint(ctl, "%-15s %s\n", _("Autostart:"), -- 1.7.3.2

This patch is based on following 4 patches: https://www.redhat.com/archives/libvir-list/2010-November/msg00661.html https://www.redhat.com/archives/libvir-list/2010-November/msg00662.html https://www.redhat.com/archives/libvir-list/2010-November/msg00663.html https://www.redhat.com/archives/libvir-list/2010-November/msg00664.html These 4 patches are still not ACKed, could anyone help review it? Thanks - Osier 于 2010年11月18日 15:26, Osier Yang 写道:
* tools/virsh.c (introduce new information 'Updated' for 'dominfo', standsfor if a domain is updated via operations like 'update-device', 'update-disk', etc.) --- tools/virsh.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index ae88cc0..d260443 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1992,6 +1992,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) virSecurityModel secmodel; virSecurityLabel seclabel; int persistent = 0; + int updated = -1; int ret = TRUE, autostart; unsigned int id; char *str, uuid[VIR_UUID_STRING_BUFLEN]; @@ -2053,6 +2054,12 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) else vshPrint(ctl, "%-15s %s\n", _("Persistent:"), persistent ? _("yes") : _("no"));
+ updated = virDomainIsUpdated(dom); + if (updated< 0) + vshPrint(ctl, "%-15s %s\n", _("Updated:"), _("unknown")); + else + vshPrint(ctl, "%-15s %s\n", _("Updated:"), updated ? _("yes") : _("no")); + /* Check and display whether the domain autostarts or not */ if (!virDomainGetAutostart(dom,&autostart)) { vshPrint(ctl, "%-15s %s\n", _("Autostart:"), -- 1.7.3.2
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Thu, Nov 18, 2010 at 03:26:57PM +0800, Osier Yang wrote:
* tools/virsh.c (introduce new information 'Updated' for 'dominfo', standsfor if a domain is updated via operations like 'update-device', 'update-disk', etc.) --- tools/virsh.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c index ae88cc0..d260443 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1992,6 +1992,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) virSecurityModel secmodel; virSecurityLabel seclabel; int persistent = 0; + int updated = -1; int ret = TRUE, autostart; unsigned int id; char *str, uuid[VIR_UUID_STRING_BUFLEN]; @@ -2053,6 +2054,12 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) else vshPrint(ctl, "%-15s %s\n", _("Persistent:"), persistent ? _("yes") : _("no"));
+ updated = virDomainIsUpdated(dom); + if (updated < 0) + vshPrint(ctl, "%-15s %s\n", _("Updated:"), _("unknown")); + else + vshPrint(ctl, "%-15s %s\n", _("Updated:"), updated ? _("yes") : _("no")); + /* Check and display whether the domain autostarts or not */ if (!virDomainGetAutostart(dom, &autostart)) { vshPrint(ctl, "%-15s %s\n", _("Autostart:"),
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Osier Yang