[libvirt] [PATCH] Cosmetic change to 'virsh nodedev-list --tree' output

Maybe it's just me, but I try to select an item from the tree using double-click and get annoyed when "+-" gets included in the selection. * src/virsh.c: add a space between "+-" and the node device name in 'virsh nodedev-list --tree' --- src/virsh.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/virsh.c b/src/virsh.c index 94c3c4e..2d0cf81 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -5370,6 +5370,8 @@ cmdNodeListDevicesPrint(vshControl *ctl, if (depth && depth < MAX_DEPTH) { indentBuf[indentIdx] = '+'; indentBuf[indentIdx+1] = '-'; + indentBuf[indentIdx+2] = ' '; + indentBuf[indentIdx+3] = '\0'; } /* Print this device */ @@ -5398,7 +5400,7 @@ cmdNodeListDevicesPrint(vshControl *ctl, /* If there is a child device, then print another blank line */ if (nextlastdev != -1) { vshPrint(ctl, "%s", indentBuf); - vshPrint(ctl, " |\n"); + vshPrint(ctl, " |\n"); } /* Finally print all children */ -- 1.6.2.5

Confused me when poking at another 'driver' variable in gdb which gcc had optimized away * src/remote_internal.c: rename driver to remote_driver --- src/remote_internal.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remote_internal.c b/src/remote_internal.c index a58b768..de3c288 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -7461,7 +7461,7 @@ unsigned long remoteVersion(void) return REMOTE_PROTOCOL_VERSION; } -static virDriver driver = { +static virDriver remote_driver = { VIR_DRV_REMOTE, "remote", remoteOpen, /* open */ @@ -7639,7 +7639,7 @@ static virStateDriver state_driver = { int remoteRegister (void) { - if (virRegisterDriver (&driver) == -1) return -1; + if (virRegisterDriver (&remote_driver) == -1) return -1; if (virRegisterNetworkDriver (&network_driver) == -1) return -1; if (virRegisterInterfaceDriver (&interface_driver) == -1) return -1; if (virRegisterStorageDriver (&storage_driver) == -1) return -1; -- 1.6.2.5

On Mon, Aug 17, 2009 at 03:06:27PM +0100, Mark McLoughlin wrote:
Confused me when poking at another 'driver' variable in gdb which gcc had optimized away
* src/remote_internal.c: rename driver to remote_driver --- src/remote_internal.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/remote_internal.c b/src/remote_internal.c index a58b768..de3c288 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -7461,7 +7461,7 @@ unsigned long remoteVersion(void) return REMOTE_PROTOCOL_VERSION; }
-static virDriver driver = { +static virDriver remote_driver = { VIR_DRV_REMOTE, "remote", remoteOpen, /* open */ @@ -7639,7 +7639,7 @@ static virStateDriver state_driver = { int remoteRegister (void) { - if (virRegisterDriver (&driver) == -1) return -1; + if (virRegisterDriver (&remote_driver) == -1) return -1; if (virRegisterNetworkDriver (&network_driver) == -1) return -1; if (virRegisterInterfaceDriver (&interface_driver) == -1) return -1; if (virRegisterStorageDriver (&storage_driver) == -1) return -1;
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Aug 17, 2009 at 03:06:26PM +0100, Mark McLoughlin wrote:
Maybe it's just me, but I try to select an item from the tree using double-click and get annoyed when "+-" gets included in the selection.
Haha, yeah, that's bugged the hell out of me. Dunno why I didn't change it myself already !
* src/virsh.c: add a space between "+-" and the node device name in 'virsh nodedev-list --tree' --- src/virsh.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/virsh.c b/src/virsh.c index 94c3c4e..2d0cf81 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -5370,6 +5370,8 @@ cmdNodeListDevicesPrint(vshControl *ctl, if (depth && depth < MAX_DEPTH) { indentBuf[indentIdx] = '+'; indentBuf[indentIdx+1] = '-'; + indentBuf[indentIdx+2] = ' '; + indentBuf[indentIdx+3] = '\0'; }
/* Print this device */ @@ -5398,7 +5400,7 @@ cmdNodeListDevicesPrint(vshControl *ctl, /* If there is a child device, then print another blank line */ if (nextlastdev != -1) { vshPrint(ctl, "%s", indentBuf); - vshPrint(ctl, " |\n"); + vshPrint(ctl, " |\n"); }
/* Finally print all children */
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.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
-
Mark McLoughlin