Re: [libvirt] [PATCH] Return VIR_ERR_NO_SUPPORT in qemu SetMemory()/SetVcpus() if domain is active.
On Wed, Jun 11, 2008 at 01:45:19PM -0700, Kaitlin Rupert wrote: qemu doesn't support setting the memory or vcpus of an active guest. In this case, use the VIR_ERR_NO_SUPPORT return code to indicate that the action failed because its not supported. Right, that's what we discussed yesterday, makes sense, applied and commited Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] PATCH: Fix call to save iptables rules
When the virtual network forwarding support was introduced, the refactoring appears to have caused the call to save iptables rules to be left out. This patch fixes it. Daniel. Index: src/qemu_driver.c === RCS file: /data/cvs/libvirt/src/qemu_driver.c,v retrieving revision 1.86 diff -u -p -r1.86 qemu_driver.c --- src/qemu_driver.c 12 Jun 2008 08:55:13 - 1.86 +++ src/qemu_driver.c 12 Jun 2008 11:18:58 - @@ -1259,7 +1259,7 @@ qemudAddIptablesRules(virConnectPtr conn if (!driver-iptables !(driver-iptables = iptablesContextNew())) { qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, %s, _(failed to allocate space for IP tables support)); -return 1; +return 0; } @@ -1319,23 +1319,22 @@ qemudAddIptablesRules(virConnectPtr conn } -/* The remaining rules are only needed for IP forwarding */ -if (!network-def-forward) { -iptablesSaveRules(driver-iptables); -return 1; +if (network-def-forward) { +/* If masquerading is enabled, set up the rules*/ +if (network-def-forwardMode == QEMUD_NET_FORWARD_NAT +!qemudAddMasqueradingIptablesRules(conn, driver, network)) +goto err8; +/* else if routing is enabled, set up the rules*/ +else if (network-def-forwardMode == QEMUD_NET_FORWARD_ROUTE + !qemudAddRoutingIptablesRules(conn, driver, network)) +goto err8; } -/* If masquerading is enabled, set up the rules*/ -if (network-def-forwardMode == QEMUD_NET_FORWARD_NAT) { -if (qemudAddMasqueradingIptablesRules(conn, driver, network)) -return 1; -} -/* else if routing is enabled, set up the rules*/ -else if (network-def-forwardMode == QEMUD_NET_FORWARD_ROUTE) { -if (qemudAddRoutingIptablesRules(conn, driver, network)) -return 1; -} +iptablesSaveRules(driver-iptables); + +return 1; + err8: iptablesRemoveForwardAllowCross(driver-iptables, network-bridge); err7: -- |: 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 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] PATCH: Fix misc compile warnings
Enabling a bunch of non-default configure options shows some compiler warnings. This patch fixes them Daniel Index: src/lxc_driver.c === RCS file: /data/cvs/libvirt/src/lxc_driver.c,v retrieving revision 1.11 diff -u -p -r1.11 lxc_driver.c --- src/lxc_driver.c9 Jun 2008 22:51:32 - 1.11 +++ src/lxc_driver.c12 Jun 2008 11:19:09 - @@ -1202,6 +1202,8 @@ static virDriver lxcDriver = { NULL, /* domainMigrateFinish */ NULL, /* domainBlockStats */ NULL, /* domainInterfaceStats */ +NULL, /* domainBlockPeek */ +NULL, /* domainMemoryPeek */ NULL, /* nodeGetCellsFreeMemory */ NULL, /* getFreeMemory */ }; Index: src/openvz_conf.c === RCS file: /data/cvs/libvirt/src/openvz_conf.c,v retrieving revision 1.24 diff -u -p -r1.24 openvz_conf.c --- src/openvz_conf.c 6 Jun 2008 11:09:57 - 1.24 +++ src/openvz_conf.c 12 Jun 2008 11:19:09 - @@ -41,13 +41,14 @@ #include unistd.h #include limits.h #include errno.h +#include string.h #include libxml/parser.h #include libxml/tree.h #include libxml/xpath.h #include libxml/uri.h -#include libvirt/virterror.h +#include internal.h #include openvz_driver.h #include openvz_conf.h @@ -55,8 +56,6 @@ #include buf.h #include memory.h -#include string.h - static char *openvzLocateConfDir(void); static void error (virConnectPtr conn, virErrorNumber code, const char *info); static struct openvz_vm_def *openvzParseXML(virConnectPtr conn, xmlDocPtr xml); Index: src/openvz_driver.c === RCS file: /data/cvs/libvirt/src/openvz_driver.c,v retrieving revision 1.21 diff -u -p -r1.21 openvz_driver.c --- src/openvz_driver.c 6 Jun 2008 11:09:57 - 1.21 +++ src/openvz_driver.c 12 Jun 2008 11:19:09 - @@ -761,6 +761,8 @@ static virDriver openvzDriver = { NULL, /* domainMigrateFinish */ NULL, /* domainBlockStats */ NULL, /* domainInterfaceStats */ +NULL, /* domainBlockPeek */ +NULL, /* domainMemoryPeek */ NULL, /* nodeGetCellsFreeMemory */ NULL, /* nodeGetFreeMemory */ }; @@ -770,6 +772,7 @@ static virStateDriver openvzStateDriver openvzShutdown, openvzReload, openvzActive, +NULL, /* sigHandler */ }; int openvzRegister(void) { Index: tests/testutils.c === RCS file: /data/cvs/libvirt/tests/testutils.c,v retrieving revision 1.16 diff -u -p -r1.16 testutils.c --- tests/testutils.c 29 May 2008 19:41:40 - 1.16 +++ tests/testutils.c 12 Jun 2008 11:19:09 - @@ -329,10 +329,7 @@ int virtTestMain(int argc, int oomCount; if ((debugStr = getenv(VIR_TEST_DEBUG)) != NULL) { -if (virStrToLong_i(debugStr, NULL, 10, testDebug) 0) -testDebug = 0; - -if (testDebug 0) +if (virStrToLong_ui(debugStr, NULL, 10, testDebug) 0) testDebug = 0; } -- |: 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 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix misc compile warnings
On Thu, Jun 12, 2008 at 12:21:56PM +0100, Daniel P. Berrange wrote: Enabling a bunch of non-default configure options shows some compiler warnings. This patch fixes them Thanks - Yes I wasn't aware that those could be enabled have it compile without needing extra software. +1 Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix call to save iptables rules
On Thu, Jun 12, 2008 at 12:21:10PM +0100, Daniel P. Berrange wrote: When the virtual network forwarding support was introduced, the refactoring appears to have caused the call to save iptables rules to be left out. This patch fixes it. Yes, this seems OK. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my OCaml programming blog: http://camltastic.blogspot.com/ Fedora now supports 59 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix call to save iptables rules
On Thu, Jun 12, 2008 at 12:21:10PM +0100, Daniel P. Berrange wrote: When the virtual network forwarding support was introduced, the refactoring appears to have caused the call to save iptables rules to be left out. This patch fixes it. Principle sounds good, but i don't really understand that code, so ignore me on that one :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix misc compile warnings
On Thu, Jun 12, 2008 at 12:21:56PM +0100, Daniel P. Berrange wrote: Enabling a bunch of non-default configure options shows some compiler warnings. This patch fixes them Ouch, +1, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [RFC 0/5]: Fix up iSCSI handling (again)
All, I've been sitting on this for way too long, so I'm sending these patches out for some initial review while I continue to test them. The following 5 patches rework the iSCSI LUN scanning again. The aim here is to: 1) Do minor cleanup of the existing code 2) Fix a bug where we aren't properly finding the LUNs on pre 2.6.24 kernels 3) Fix a bug seen in oVirt where we race between libvirtd scanning the sysfs path and udev actually making the sysfs path in the first place 4) Further lessen our dependence on direct calls to iscsiadm, in case they change the output in the future. I've started testing this patchset against a variety of Fedora's, old and new. Anything older than FC-6 is a lost cause; either it doesn't have iSCSI stuff (FC-1 through FC-4), or the iscsi stuff it has is so radically different that it's basically a different commandset (RHEL-4 and FC-5). In some light testing, though, this patchset seems to work on FC-6, F-7, F-8, and F-9 (RHEL-5 still to be tested). As Dan mentioned earlier, I have collected output from the relevant iscsiadm commands so that we can build our own fake iscsiadm in tests; I'll be working on that test as well as continuing to test these patches against live iSCSI targets. Note that this patchset is not to be applied yet; I've only lightly tested it so far. I'd just like to see what people think about all of this. Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [RFC 1/5]: Return exitstatus from virStorageBackendRunProgRegex
This patch changes things around so that virStorageBackendRunProgRegex() does *not* virStorageReportError() if the fork()/exec() process it spawned returned a != 0 exit code. Rather, it returns the exitcode in this case, and it is up to the higher level to determine whether this is a fatal error or not. The use case for this change is in the iSCSI stuff; older versions of iscsiadm tools would return a failure when getting the session number, despite the command succeeding. Signed-off-by: Chris Lalancette [EMAIL PROTECTED] Index: src/storage_backend.c === RCS file: /data/cvs/libvirt/src/storage_backend.c,v retrieving revision 1.14 diff -u -r1.14 storage_backend.c --- a/src/storage_backend.c 6 Jun 2008 11:09:57 - 1.14 +++ b/src/storage_backend.c 12 Jun 2008 13:19:39 - @@ -352,7 +352,8 @@ const char **regex, int *nvars, virStorageBackendListVolRegexFunc func, - void *data) + void *data, + int *outexit) { int child = 0, fd = -1, exitstatus, err, failed = 1; FILE *list = NULL; @@ -487,12 +488,8 @@ return -1; } else { if (WIFEXITED(exitstatus)) { -if (WEXITSTATUS(exitstatus) != 0) { -virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, - _(non-zero exit status from command %d), - WEXITSTATUS(exitstatus)); -return -1; -} + if (outexit != NULL) +*outexit = WEXITSTATUS(exitstatus); } else { virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, %s, _(command did not exit cleanly)); Index: src/storage_backend.h === RCS file: /data/cvs/libvirt/src/storage_backend.h,v retrieving revision 1.3 diff -u -r1.3 storage_backend.h --- a/src/storage_backend.h 10 Apr 2008 16:53:29 - 1.3 +++ b/src/storage_backend.h 12 Jun 2008 13:19:39 - @@ -133,7 +133,8 @@ const char **regex, int *nvars, virStorageBackendListVolRegexFunc func, - void *data); + void *data, + int *exitstatus); int virStorageBackendRunProgNul(virConnectPtr conn, virStoragePoolObjPtr pool, Index: src/storage_backend_iscsi.c === RCS file: /data/cvs/libvirt/src/storage_backend_iscsi.c,v retrieving revision 1.7 diff -u -r1.7 storage_backend_iscsi.c --- a/src/storage_backend_iscsi.c 6 Jun 2008 11:09:57 - 1.7 +++ b/src/storage_backend_iscsi.c 12 Jun 2008 13:19:39 - @@ -124,13 +124,18 @@ }; char *session = NULL; +/* Note that we ignore the exitstatus. Older versions of iscsiadm tools + * returned and exit status of 0, even if they succeeded. We will just + * rely on whether session got filled in properlly. + */ if (virStorageBackendRunProgRegex(conn, pool, prog, 1, regexes, vars, virStorageBackendISCSIExtractSession, - session) 0) + session, + NULL) 0) return NULL; if (session == NULL) { @@ -373,7 +378,7 @@ regexes, vars, virStorageBackendISCSIMakeLUN, - (void *)session); + (void *)session, NULL); } Index: src/storage_backend_logical.c === RCS file: /data/cvs/libvirt/src/storage_backend_logical.c,v retrieving revision 1.6 diff -u -r1.6 storage_backend_logical.c --- a/src/storage_backend_logical.c 6 Jun 2008 11:09:57 - 1.6 +++ b/src/storage_backend_logical.c 12 Jun 2008 13:19:39 - @@ -213,15 +213,30 @@ lv_name,uuid,devices,seg_size,vg_extent_size, pool-def-name, NULL }; + int exitstatus; -return virStorageBackendRunProgRegex(conn, - pool, - prog, - 1, - regexes, - vars, - virStorageBackendLogicalMakeVol, - vol); +if (virStorageBackendRunProgRegex(conn, +
[libvirt] [RFC 2/5]: Cleanup carriage returns in util.c
In src/util.c, virLog is just a wrapper around fprintf(stderr). Make sure to put line breaks at the end of lines that use virLog() (noticed during testing). Signed-off-by: Chris Lalancette [EMAIL PROTECTED] --- libvirt.regexfix/src/util.c 2008-05-29 21:20:23.0 +0200 +++ libvirt/src/util.c 2008-06-12 15:26:07.0 +0200 @@ -341,20 +341,20 @@ int __virFileReadAll(const char *path, i char *s; if (!(fh = fopen(path, r))) { -virLog(Failed to open file '%s': %s, +virLog(Failed to open file '%s': %s\n, path, strerror(errno)); goto error; } s = fread_file_lim(fh, maxlen+1, len); if (s == NULL) { -virLog(Failed to read '%s': %s, path, strerror (errno)); +virLog(Failed to read '%s': %s\n, path, strerror (errno)); goto error; } if (len maxlen || (int)len != len) { VIR_FREE(s); -virLog(File '%s' is too large %d, max %d, +virLog(File '%s' is too large %d, max %d\n, path, (int)len, maxlen); goto error; } @@ -415,16 +415,16 @@ int virFileLinkPointsTo(const char *chec return 0; case EINVAL: -virLog(File '%s' is not a symlink, +virLog(File '%s' is not a symlink\n, checkLink); return 0; } -virLog(Failed to read symlink '%s': %s, +virLog(Failed to read symlink '%s': %s\n, checkLink, strerror(errno)); return 0; } else if (n = PATH_MAX) { -virLog(Symlink '%s' contents too long to fit in buffer, +virLog(Symlink '%s' contents too long to fit in buffer\n, checkLink); return 0; } @@ -441,7 +441,7 @@ int virFileLinkPointsTo(const char *chec dir[PATH_MAX-1] = '\0'; if (!(p = strrchr(dir, '/'))) { -virLog(Symlink path '%s' is not absolute, checkLink); +virLog(Symlink path '%s' is not absolute\n, checkLink); return 0; } @@ -451,7 +451,7 @@ int virFileLinkPointsTo(const char *chec *p = '\0'; if (virFileBuildPath(dir, dest, NULL, tmp, PATH_MAX) 0) { -virLog(Path '%s/%s' is too long, dir, dest); +virLog(Path '%s/%s' is too long\n, dir, dest); return 0; } @@ -461,20 +461,20 @@ int virFileLinkPointsTo(const char *chec /* canonicalize both paths */ if (!realpath(dest, real)) { -virLog(Failed to expand path '%s' :%s, dest, strerror(errno)); +virLog(Failed to expand path '%s' :%s\n, dest, strerror(errno)); strncpy(real, dest, PATH_MAX); real[PATH_MAX-1] = '\0'; } if (!realpath(checkDest, checkReal)) { -virLog(Failed to expand path '%s' :%s, checkDest, strerror(errno)); +virLog(Failed to expand path '%s' :%s\n, checkDest, strerror(errno)); strncpy(checkReal, checkDest, PATH_MAX); checkReal[PATH_MAX-1] = '\0'; } /* compare */ if (STRNEQ(checkReal, real)) { -virLog(Link '%s' does not point to '%s', ignoring, +virLog(Link '%s' does not point to '%s', ignoring\n, checkLink, checkReal); return 0; } @@ -492,7 +492,7 @@ int virFileLinkPointsTo (const char *checkLink ATTRIBUTE_UNUSED, const char *checkDest ATTRIBUTE_UNUSED) { -virLog (_(%s: not implemented), __FUNCTION__); +virLog (_(%s: not implemented\n), __FUNCTION__); return 0; } -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [RFC 3/5]: Fix up the call to iscsiadm --mode session
Older versions of iscsiadm didn't support the -P 0 flag to the iscsiadm --mode session command. However, just running iscsiadm --mode session seems to work on all version of iscsiadm commands back to FC-6, so just use that. Signed-off-by: Chris Lalancette [EMAIL PROTECTED] --- libvirt.virLogcleanup/src/storage_backend_iscsi.c 2008-06-12 15:18:53.0 +0200 +++ libvirt/src/storage_backend_iscsi.c 2008-06-12 15:29:04.0 +0200 @@ -107,7 +107,7 @@ virStorageBackendISCSISession(virConnect virStoragePoolObjPtr pool) { /* - * # iscsiadm --mode session -P 0 + * # iscsiadm --mode session * tcp: [1] 192.168.122.170:3260,1 demo-tgt-b * tcp: [2] 192.168.122.170:3260,1 demo-tgt-a * @@ -120,7 +120,7 @@ virStorageBackendISCSISession(virConnect 2, }; const char *prog[] = { -ISCSIADM, --mode, session, -P, 0, NULL +ISCSIADM, --mode, session, NULL }; char *session = NULL; -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [RFC 4/5]: Move the sendtarget command into the login command
A small bugfix; we only need to call the iscsiadm sendtarget command when we are first logging in; we don't need to do it for logout. Move the sendtarget command into the Login() function. Signed-off-by: Chris Lalancette [EMAIL PROTECTED] --- libvirt.iscsi-mode-session/src/storage_backend_iscsi.c 2008-06-12 15:29:04.0 +0200 +++ libvirt/src/storage_backend_iscsi.c 2008-06-12 15:31:00.0 +0200 @@ -158,14 +158,6 @@ virStorageBackendISCSIConnection(virConn --targetname, pool-def-source.devices[0].path, action, NULL }; -const char *cmdsendtarget[] = { -ISCSIADM, --mode, discovery, --type, sendtargets, ---portal, portal, NULL -}; - -if (virRun(conn, (char **)cmdsendtarget, NULL) 0) -return -1; - if (virRun(conn, (char **)cmdargv, NULL) 0) return -1; @@ -403,6 +395,14 @@ virStorageBackendISCSILogin(virConnectPt virStoragePoolObjPtr pool, const char *portal) { +const char *cmdsendtarget[] = { +ISCSIADM, --mode, discovery, --type, sendtargets, +--portal, portal, NULL +}; + +if (virRun(conn, (char **)cmdsendtarget, NULL) 0) +return -1; + return virStorageBackendISCSIConnection(conn, pool, portal, --login); } -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [RFC 5/5]: Rewrite findLuns function
This rather large patch rewrites the virStorageBackendISCSIFindLUNs() function to only rely on sysfs for finding LUNs, given a session number. Along the way, it also fixes the bug where we wouldn't find LUNs for older kernels (with the block:sda format), and also (possibly) fixes a race condition where we could try to find the LUN before udev has finished connecting it. I say it possibly fixes it because I haven't been able to hit it so far, but I definitely need more testing to try and confirm. Signed-off-by: Chris Lalancette [EMAIL PROTECTED] --- libvirt.sendtarget/src/storage_backend_iscsi.c 2008-06-12 15:31:00.0 +0200 +++ libvirt/src/storage_backend_iscsi.c 2008-06-12 15:43:39.0 +0200 @@ -164,110 +164,30 @@ virStorageBackendISCSIConnection(virConn return 0; } - static int -virStorageBackendISCSIMakeLUN(virConnectPtr conn, - virStoragePoolObjPtr pool, - char **const groups, - void *data) +virStorageBackendISCSINewLun(virConnectPtr conn, virStoragePoolObjPtr pool, + unsigned int lun, char *dev) { virStorageVolDefPtr vol; int fd = -1; -unsigned int target, channel, id, lun; -char lunid[100]; -int opentries = 0; char *devpath = NULL; -char *session = data; -char sysfs_path[PATH_MAX]; -char *dev = NULL; -DIR *sysdir; -struct dirent *block_dirent; -struct stat sbuf; -int len; - -if ((virStrToLong_ui(groups[0], NULL, 10, target) 0) || -(virStrToLong_ui(groups[1], NULL, 10, channel) 0) || -(virStrToLong_ui(groups[2], NULL, 10, id) 0) || -(virStrToLong_ui(groups[3], NULL, 10, lun) 0)) { -virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, %s, - _(Failed parsing iscsiadm commands)); -return -1; -} - -if (lun == 0) { -/* the 0'th LUN isn't a real LUN, it's just a control LUN; skip it */ -return 0; -} - -snprintf(sysfs_path, PATH_MAX, - /sys/class/iscsi_session/session%s/device/ - target%d:%d:%d/%d:%d:%d:%d/block, - session, target, channel, id, target, channel, id, lun); - -if (stat(sysfs_path, sbuf) 0) { -/* block path in subdir didn't exist; this is unexpected, so fail */ -virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, - _(Failed to find the sysfs path for %d:%d:%d:%d: %s), - target, channel, id, lun, strerror(errno)); -return -1; -} - -sysdir = opendir(sysfs_path); -if (sysdir == NULL) { -/* we failed for some reason; return an error */ -virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, - _(Failed to opendir sysfs path %s: %s), - sysfs_path, strerror(errno)); -return -1; -} - -while ((block_dirent = readdir(sysdir)) != NULL) { -len = strlen(block_dirent-d_name); -if ((len == 1 block_dirent-d_name[0] == '.') || -(len == 2 block_dirent-d_name[0] == '.' block_dirent-d_name[1] == '.')) { -/* the . and .. directories; just skip them */ -continue; -} - -/* OK, not . or ..; let's see if it is a SCSI device */ -if (len 2 -block_dirent-d_name[0] == 's' -block_dirent-d_name[1] == 'd') { -/* looks like a scsi device, smells like scsi device; it must be - a scsi device */ -dev = strdup(block_dirent-d_name); -break; -} -} -closedir(sysdir); - -if (dev == NULL) { -/* we didn't find the sd? device we were looking for; fail */ -virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, - _(Failed to find SCSI device for %d:%d:%d:%d: %s), - target, channel, id, lun, strerror(errno)); -return -1; -} - -snprintf(lunid, sizeof(lunid)-1, lun-%s, groups[3]); + int opentries = 0; if (VIR_ALLOC(vol) 0) { virStorageReportError(conn, VIR_ERR_NO_MEMORY, %s, _(volume)); goto cleanup; } -if ((vol-name = strdup(lunid)) == NULL) { + if (asprintf((vol-name), lun-%d, lun) 0) { virStorageReportError(conn, VIR_ERR_NO_MEMORY, %s, _(name)); goto cleanup; } -if (VIR_ALLOC_N(devpath, 5 + strlen(dev) + 1) 0) { + if (asprintf(devpath, /dev/%s, dev) 0) { virStorageReportError(conn, VIR_ERR_NO_MEMORY, %s, _(devpath)); goto cleanup; -} -strcpy(devpath, /dev/); -strcat(devpath, dev); -VIR_FREE(dev); + } + /* It can take a little while between logging into the ISCSI * server and udev creating the /dev nodes, so if we get ENOENT * we must retry a few times - they should eventually appear. @@ -312,7 +232,6 @@ virStorageBackendISCSIMakeLUN(virConnect goto cleanup;
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
+ n = scandir(sysfs_path, namelist, notdotdir, versionsort); + if (n = 0) { + /* we didn't find any reasonable entries; return failure */ + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _(Failed to find any LUNs for session %s: %s), + session, strerror(errno)); + + return -1; + } Who told you/anyone who wrote this code before that the 0th lun cannot be a real entry? This assumption is wrong. Stefan -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Stefan de Konink wrote: + n = scandir(sysfs_path, namelist, notdotdir, versionsort); + if (n = 0) { + /* we didn't find any reasonable entries; return failure */ + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _(Failed to find any LUNs for session %s: %s), + session, strerror(errno)); + + return -1; + } Who told you/anyone who wrote this code before that the 0th lun cannot be a real entry? This assumption is wrong. Well, that particular piece of code isn't looking at the 0'th LUN, but there is code below that that is. However, the code here is generally looking for block devices, and the 0'th LUN is definitely not a block device. Given that, I'm not sure what else you would want to do with 0th LUN; can you give me some examples? Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Stefan de Konink wrote: Who told you/anyone who wrote this code before that the 0th lun cannot be a real entry? This assumption is wrong. Well, that particular piece of code isn't looking at the 0'th LUN, but there is code below that that is. However, the code here is generally looking for block devices, and the 0'th LUN is definitely not a block device. Given that, I'm not sure what else you would want to do with 0th LUN; can you give me some examples? The 0th LUN can be a perfect block device. OK, cool, I misunderstood. Given that, can you give me the output of: # ls -l /sys/bus/scsi/devices/3:0:0:0 Just to make sure I get the right thing? Thanks, Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Chris Lalancette schreef: Stefan de Konink wrote: Who told you/anyone who wrote this code before that the 0th lun cannot be a real entry? This assumption is wrong. Well, that particular piece of code isn't looking at the 0'th LUN, but there is code below that that is. However, the code here is generally looking for block devices, and the 0'th LUN is definitely not a block device. Given that, I'm not sure what else you would want to do with 0th LUN; can you give me some examples? The 0th LUN can be a perfect block device. OK, cool, I misunderstood. Given that, can you give me the output of: # ls -l /sys/bus/scsi/devices/3:0:0:0 Just to make sure I get the right thing? [EMAIL PROTECTED] ~ $ ls -l /sys/bus/scsi/devices/3:0:0:0 lrwxrwxrwx 1 root root 0 May 26 11:28 /sys/bus/scsi/devices/3:0:0:0 - ../../../devices/platform/host3/session3/target3:0:0/3:0:0:0 [EMAIL PROTECTED] ~ $ ls /sys/devices/platform/host3/session3/target3:0:0/3:0:0:0 block:sdar device_blocked genericiodone_cnt iorequest_cnt queue_depth rescan scsi_level subsystem typevendor delete driver iocounterbits ioerr_cnt model queue_type rev state timeoutuevent [EMAIL PROTECTED] ~ $ cat /sys/devices/platform/host3/session3/target3:0:0/3:0:0:0/model SOLARIS Stefan -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Stefan de Konink schreef: Chris Lalancette schreef: Stefan de Konink wrote: Who told you/anyone who wrote this code before that the 0th lun cannot be a real entry? This assumption is wrong. Well, that particular piece of code isn't looking at the 0'th LUN, but there is code below that that is. However, the code here is generally looking for block devices, and the 0'th LUN is definitely not a block device. Given that, I'm not sure what else you would want to do with 0th LUN; can you give me some examples? The 0th LUN can be a perfect block device. OK, cool, I misunderstood. Given that, can you give me the output of: # ls -l /sys/bus/scsi/devices/3:0:0:0 Just to make sure I get the right thing? [EMAIL PROTECTED] ~ $ ls -l /sys/devices/platform/host3/session3/target3:0:0/3:0:0:0 total 0 lrwxrwxrwx 1 root root0 May 24 16:38 block:sdar - ../../../../../../block/sdar --w--- 1 root root 4096 Jun 12 16:34 delete -r--r--r-- 1 root root 4096 Jun 12 16:34 device_blocked lrwxrwxrwx 1 root root0 May 24 16:38 driver - ../../../../../../bus/scsi/drivers/sd lrwxrwxrwx 1 root root0 Jun 12 16:34 generic - ../../../../../../class/scsi_generic/sg44 -r--r--r-- 1 root root 4096 Jun 12 16:34 iocounterbits -r--r--r-- 1 root root 4096 Jun 12 16:34 iodone_cnt -r--r--r-- 1 root root 4096 Jun 12 16:34 ioerr_cnt -r--r--r-- 1 root root 4096 Jun 12 16:34 iorequest_cnt -r--r--r-- 1 root root 4096 May 24 16:38 model -rw-r--r-- 1 root root 4096 Jun 12 16:34 queue_depth -r--r--r-- 1 root root 4096 Jun 12 16:34 queue_type --w--- 1 root root 4096 Jun 12 16:34 rescan -r--r--r-- 1 root root 4096 Jun 12 16:34 rev -r--r--r-- 1 root root 4096 Jun 12 16:34 scsi_level -rw-r--r-- 1 root root 4096 May 26 11:28 state lrwxrwxrwx 1 root root0 May 24 16:38 subsystem - ../../../../../../bus/scsi -rw-r--r-- 1 root root 4096 Jun 12 16:34 timeout -r--r--r-- 1 root root 4096 May 24 16:38 type --w--- 1 root root 4096 Jun 12 16:34 uevent -r--r--r-- 1 root root 4096 May 24 16:38 vendor -l was important ;) Stefan -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 1/5]: Return exitstatus from virStorageBackendRunProgRegex
On Thu, Jun 12, 2008 at 04:09:00PM +0200, Chris Lalancette wrote: case for this change is in the iSCSI stuff; older versions of iscsiadm tools would return a failure when getting the session number, despite the command succeeding. Oh joy :-( Index: src/storage_backend.c === RCS file: /data/cvs/libvirt/src/storage_backend.c,v retrieving revision 1.14 diff -u -r1.14 storage_backend.c --- a/src/storage_backend.c 6 Jun 2008 11:09:57 - 1.14 +++ b/src/storage_backend.c 12 Jun 2008 13:19:39 - @@ -352,7 +352,8 @@ const char **regex, int *nvars, virStorageBackendListVolRegexFunc func, - void *data) + void *data, + int *outexit) Whitespace damage { int child = 0, fd = -1, exitstatus, err, failed = 1; FILE *list = NULL; @@ -487,12 +488,8 @@ return -1; } else { if (WIFEXITED(exitstatus)) { -if (WEXITSTATUS(exitstatus) != 0) { -virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, - _(non-zero exit status from command %d), - WEXITSTATUS(exitstatus)); -return -1; -} + if (outexit != NULL) + *outexit = WEXITSTATUS(exitstatus); More here. Can you check your $HOME/.emacs file has the magic detailed in the HACKING file to preserve whitespace. There's a few more places with problems, but I won't list every single one here. Aside from that, the patch looks reasonable. Regards, 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 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 2/5]: Cleanup carriage returns in util.c
On Thu, Jun 12, 2008 at 04:09:05PM +0200, Chris Lalancette wrote: In src/util.c, virLog is just a wrapper around fprintf(stderr). Make sure to put line breaks at the end of lines that use virLog() (noticed during testing). ACK, though someday we should remove all this virLog stuff and propagate a real libvirt error to caller. 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 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 3/5]: Fix up the call to iscsiadm --mode session
On Thu, Jun 12, 2008 at 04:09:09PM +0200, Chris Lalancette wrote: Older versions of iscsiadm didn't support the -P 0 flag to the iscsiadm --mode session command. However, just running iscsiadm --mode session seems to work on all version of iscsiadm commands back to FC-6, so just use that. Worst case you'll get extra info on stdout when removing -P 0, but this will get ignored by the regexes we apply, so 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 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Stefan de Konink wrote: [EMAIL PROTECTED] ~ $ ls -l /sys/devices/platform/host3/session3/target3:0:0/3:0:0:0 total 0 lrwxrwxrwx 1 root root0 May 24 16:38 block:sdar - ../../../../../../block/sdar --w--- 1 root root 4096 Jun 12 16:34 delete -r--r--r-- 1 root root 4096 Jun 12 16:34 device_blocked lrwxrwxrwx 1 root root0 May 24 16:38 driver - ../../../../../../bus/scsi/drivers/sd lrwxrwxrwx 1 root root0 Jun 12 16:34 generic - ../../../../../../class/scsi_generic/sg44 -r--r--r-- 1 root root 4096 Jun 12 16:34 iocounterbits -r--r--r-- 1 root root 4096 Jun 12 16:34 iodone_cnt -r--r--r-- 1 root root 4096 Jun 12 16:34 ioerr_cnt -r--r--r-- 1 root root 4096 Jun 12 16:34 iorequest_cnt -r--r--r-- 1 root root 4096 May 24 16:38 model -rw-r--r-- 1 root root 4096 Jun 12 16:34 queue_depth -r--r--r-- 1 root root 4096 Jun 12 16:34 queue_type --w--- 1 root root 4096 Jun 12 16:34 rescan -r--r--r-- 1 root root 4096 Jun 12 16:34 rev -r--r--r-- 1 root root 4096 Jun 12 16:34 scsi_level -rw-r--r-- 1 root root 4096 May 26 11:28 state lrwxrwxrwx 1 root root0 May 24 16:38 subsystem - ../../../../../../bus/scsi -rw-r--r-- 1 root root 4096 Jun 12 16:34 timeout -r--r--r-- 1 root root 4096 May 24 16:38 type --w--- 1 root root 4096 Jun 12 16:34 uevent -r--r--r-- 1 root root 4096 May 24 16:38 vendor OK, hopefully just one more request; I'm trying to figure out a way to distinguish a disk from a control LUN, since in my case (Linux iscsi target), 0 is a control LUN. Can you give me the output of: # cat /sys/bus/scsi/devices/3:0:0:0/model and # cat /sys/bus/scsi/devices/3:0:0:0/type from both your netapp target and your sun target? Here, at least, for our control LUN, model returns Controller while for the real LUNs model returns VIRTUAL-DISK, so I'm hoping I can distinguish somehow based on what is in model, and if not that, based on type. Thanks again for the info, Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Daniel P. Berrange schreef: Can't you distinguish based on the fact that there'll be no /dev/sdNN node for it ? You mean an explicit check for the 'block:' ? I really wonder how Linux internally distinguishes between a 'controller'. (And even more what a controller is...) Stefan -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Daniel P. Berrange wrote: # cat /sys/bus/scsi/devices/3:0:0:0/model and # cat /sys/bus/scsi/devices/3:0:0:0/type from both your netapp target and your sun target? Here, at least, for our control LUN, model returns Controller while for the real LUNs model returns VIRTUAL-DISK, so I'm hoping I can distinguish somehow based on what is in model, and if not that, based on type. Can't you distinguish based on the fact that there'll be no /dev/sdNN node for it ? Unfortunately, no. The /sys/bus/scsi/devices/3:0:0:0/block:sda (or block/sda) link will only exist once udev has finished plugging the device in. So we have to loop waiting for that to appear. In the case of a control LUN, that will never appear, so we will wait 5 seconds (the current default) to see it appear, and then when it doesn't, we won't know how to distinguish the error case from the control LUN case. I guess we could just not throw an error if we never see a block device, but we would still delay the libvirtd daemon (and the client) unnecessarily. Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
Chris Lalancette [EMAIL PROTECTED] wrote: This rather large patch rewrites the virStorageBackendISCSIFindLUNs() function to only rely on sysfs for finding LUNs, given a session number. Along the way, it also fixes the bug where we wouldn't find LUNs for older kernels (with the block:sda format), and also (possibly) fixes a race condition where we could try to find the LUN before udev has finished connecting it. I say it possibly fixes it because I haven't been able to hit it so far, but I definitely need more testing to try and confirm. ... Hi Chris, ACK to the first 4 parts. Here there's one nit and one problem: +virStorageBackendISCSINewLun(virConnectPtr conn, virStoragePoolObjPtr pool, + unsigned int lun, char *dev) dev const, and doesn't need to go past column 80. Dan already mentioned TABs. + if (strlen(block) == 5) { + /* OK, this is exactly block; must be new-style */ + snprintf(sysfs_path, PATH_MAX, + /sys/bus/scsi/devices/%u:%u:%u:%u/block, + host, bus, target, lun); + sysdir = opendir(sysfs_path); + if (sysdir == NULL) { + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _(Failed to opendir sysfs path %s: %s), + sysfs_path, strerror(errno)); + retval = -1; + goto namelist_cleanup; + } + while ((sys_dirent = readdir(sysdir))) { + if (!notdotdir(sys_dirent)) + continue; + + scsidev = strdup(sys_dirent-d_name); + break; + } + closedir(sysdir); + } + else { + /* old-style; just parse out the sd */ + block2 = strrchr(block, ':'); + if (block2 == NULL) { + /* Hm, wasn't what we were expecting; have to give up */ + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, + _(Failed to parse block path %s), + block); + retval = -1; + goto namelist_cleanup; + } + block2++; + scsidev = strdup(block2); + } This needs a check for scsidev == NULL, since virStorageBackendISCSINewLun would segfault on a NULL; it dereferences the pointer (via its dev parameter) with this: + if (asprintf(devpath, /dev/%s, dev) 0) { + retval = virStorageBackendISCSINewLun(conn, pool, lun, scsidev); + if (retval 0) + break; ... -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Fix qemudParseVMDeviceDef() to check for proper network device tag name
Is it too late to get this change in? Instead of net, the tag name should be interface. Previously, attempting to attach a network device to a KVM guest would return: libvir: QEMU error : XML description for unknown device type is not well formed or invalid error: Failed to attach device from attach-disk.xml With this fix, it returns: libvir: QEMU error test_domain: this function is not supported by the hypervisor: only CDROM disk devices can be attached libvir: QEMU error : this function is not supported by the hypervisor: only CDROM disk devices can be attached error: Failed to attach device from attach-disk.xml Index: src/qemu_conf.c === RCS file: /data/cvs/libvirt/src/qemu_conf.c,v retrieving revision 1.77 diff -u -p -r1.77 qemu_conf.c --- src/qemu_conf.c 12 Jun 2008 10:19:24 - 1.77 +++ src/qemu_conf.c 12 Jun 2008 16:17:59 - @@ -2964,7 +2964,7 @@ qemudParseVMDeviceDef(virConnectPtr conn if (xmlStrEqual(node-name, BAD_CAST disk)) { dev-type = QEMUD_DEVICE_DISK; qemudParseDiskXML(conn, (dev-data.disk), node); -} else if (xmlStrEqual(node-name, BAD_CAST net)) { +} else if (xmlStrEqual(node-name, BAD_CAST interface)) { dev-type = QEMUD_DEVICE_NET; qemudParseInterfaceXML(conn, (dev-data.net), node); } else if (xmlStrEqual(node-name, BAD_CAST input)) { -- Kaitlin Rupert IBM Linux Technology Center [EMAIL PROTECTED] -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Release of libvirt-0.4.3
Two months since the last release and a lot of changes had accumulated in the meantime. So it was really time for a release, 0.4.3 is available at ftp://libvirt.org/pub/libvirt It containns a some new features, bug fixes and improvements, but the largest part is actually code cleanups: * New features: - Linux Container start and stop (Dave Leskovec) - Network interface model settings (Daniel Berrange) - serial and parallel device support for QEmu and Xen (Daniel Berrange) - Sound support for QEmu and Xen (Cole Robinson) - vCPU settings for QEmu (Cole Robinson) - support for NUMA and vCPU pinning in QEmu (Daniel Berrange) - new virDomainBlockPeek API (Richard Jones) * Documentation: - coding guidelines (Jim Meyering and Richard Jones) - small man page missing entries and cleanup - Web site revamp (Daniel Berrange) - typo fixes (Atsushi SAKAI) - more docs on network XML format (Daniel Berrange) - libvirt Wiki (Daniel Berrange) - policykit config docs (Cole Robinson) - XML domain docs revamp (Daniel Berrange) - docs for remote listen-tls/tcp fixes (Kenneth Nagin) * Bug fixes: - save change to config file for Xen (Ryan Scott) - fix /var/run/libvirt/ group ownership (Anton Protopopov) - ancient libparted workaround (Soren Hansen) - out of bount array access (Daniel Berrange) - remote check bug (Dave Leskovec) - LXC signal and daemon restart problems (Dave Leskovec) - bus selection logic fix in the daemon config (Daniel Berrange) - 2 memory leaks in the daemon (Jim Meyering) - daemon pid file logic bug fix (Daniel Berrange) - python generator fixes (Daniel Berrange) - ivarious leaks and memory problem pointed by valgrind (Daniel Berrange) - iptables forwarding cleanup (Daniel Berrange) - Xen cpuset value checking (Hiroyuki Kaguchi) - container process checks for LXC (Dave Leskovec) - let xend check block device syntax (Hiroyuki Kaguchi) - UUIDString for python fixes (Cole Robinson) * Improvements: - fixes for MinGW compilation (Richard Jones) - autostart for running Xen domains (Cole Robinson) - control of listening IP for daemon (Stefan de Konink) - various Xenner related fixes and improvements (Daniel Berrange) - autostart status printed in virsh domainfo (Shigeki Sakamoto) - better error messages for xend driver (Richard Jones) * Code cleanups: - OpenVZ compilation (Richard Jones) - conn dom and net fields deprecation in error structures (Richard Jones) - Xen-ism on UUID (Richard Jones) - add missing .pod to dist (Richard Jones) - tab cleanup from sources (Jim Meyering) - remove unused field in virsh control structure (Richard Jones) - compilation without pthread.h (Jim Meyering) - cleanup of tests (Daniel Berrange) - syntax-check improvements (Jim Meyering) - python cleanup - remove dependancy on libc is_* character tests (Jim Meyering) - format related cleanups (Jim Meyering) - cleanup of the buffer internal APIs (Daniel Berrange) - conversion to the new memory allocation API (Daniel Berrange) - lcov coverage testing (Daniel Berrange) - gnulib updates (Jim Meyering) - compatibility fix with RHEL 5 (Daniel Berrange) - SuSE compatibility fix (Jim Fehlig) - const'ification of a number of structures (Jim Meyering) - string comparison macro cleanups (Daniel Berrange) - character range testing cleanups and assorted bug fixes (Jim Meyering) - QEmu test fixes (Daniel Berrange) - configure macro cleanup (Daniel Berrange) - refactor QEmu command line building code (Daniel Berrange) - type punning warning in remote code (Richard Jones) - refactoring of internal headers (Richard Jones) - generic out of memory testing and associated bug fixes (Daniel Berrange) - don't raise internal error for unsupported features (Kaitlin Rupert) - missing driver entry points (Daniel Berrange) thanks to everybody who contributed, with ideas or patches, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ [EMAIL PROTECTED] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC 5/5]: Rewrite findLuns function
On Thu, Jun 12, 2008 at 05:20:19PM +0200, Chris Lalancette wrote: Daniel P. Berrange wrote: # cat /sys/bus/scsi/devices/3:0:0:0/model and # cat /sys/bus/scsi/devices/3:0:0:0/type from both your netapp target and your sun target? Here, at least, for our control LUN, model returns Controller while for the real LUNs model returns VIRTUAL-DISK, so I'm hoping I can distinguish somehow based on what is in model, and if not that, based on type. Can't you distinguish based on the fact that there'll be no /dev/sdNN node for it ? Unfortunately, no. The /sys/bus/scsi/devices/3:0:0:0/block:sda (or block/sda) link will only exist once udev has finished plugging the device in. So we have to loop waiting for that to appear. In the case of a control LUN, that will never appear, so we will wait 5 seconds (the current default) to see it appear, and then when it doesn't, we won't know how to distinguish the error case from the control LUN case. I guess we could just not throw an error if we never see a block device, but we would still delay the libvirtd daemon (and the client) unnecessarily. Hmmm, well, presumably udev knows to not create a /dev/sdNN node based on some of the information in sysfs. So we just have to find out what udev's decision is based on and copy it. Perhaps the 'driver' link in sysfs will not exist ? Or point to something other than the 'sd' driver ? 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 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Release of libvirt-0.4.3
Daniel, really, thanks for doing this. The two virDomain*Peek APIs are what make virt-df the virt-mem toolbox work. On Thu, Jun 12, 2008 at 03:19:30PM -0400, Daniel Veillard wrote: Two months since the last release and a lot of changes had accumulated in the meantime. So it was really time for a release, 0.4.3 is available at ftp://libvirt.org/pub/libvirt This URL is actually wrong. The FTP URL is: ftp://libvirt.org/libvirt/ or by HTTP: http://libvirt.org/sources/ It containns a some new features, bug fixes and improvements, but the largest part is actually code cleanups: * New features: [...] - new virDomainBlockPeek API (Richard Jones) And don't forget virDomainMemoryPeek API :-) Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] where is autogen.sh on libvirt?
Hi, I am looking thorough the package on ftp://libvirt.org/libvirt/ but cannot find autogen.sh files on 0.4.3 and snapshot package. Is there any reason? Of course cvs package have autogen.sh. Thanks Atsushi SAKAI -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list